Source code for oasislmf.pytools.pla.common
import numpy as np
[docs]
DATA_SIZE = 8 # 4 bytes * 2 values
[docs]
N_PAIRS = BUFFER_SIZE // DATA_SIZE
# Numpy data types for reading binary files
[docs]
event_count_dtype = np.dtype([('event_id', 'i4'), ('count', 'i4')])
[docs]
amp_factor_dtype = np.dtype([('amplification_id', 'i4'), ('factor', 'f4')])
# File names for creating dictionary of factors
[docs]
AMPLIFICATIONS_FILE_NAME = 'amplifications.bin'
[docs]
LOSS_FACTORS_FILE_NAME = 'lossfactors.bin'