Source code for oasislmf.pytools.pla.common

import numpy as np

[docs] BUFFER_SIZE = 65536
[docs] DATA_SIZE = 8 # 4 bytes * 2 values
[docs] N_PAIRS = BUFFER_SIZE // DATA_SIZE
[docs] FILE_HEADER_SIZE = 4 # 4-byte integer
# 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'