flasc.analysis.energy_ratio_input#
Energy ratio input module.
Functions
Generate an np.array of length N where each element is an integer between 0 and num_blocks-1. |
Classes
EnergyRatioInput class. |
- flasc.analysis.energy_ratio_input.generate_block_list(N, num_blocks=10)[source]#
Generate an np.array of length N where each element is an integer between 0 and num_blocks-1.
Generate an np.array of length N where each element is an integer between 0 and num_blocks-1 with each value repeating N/num_blocks times.
- Parameters:
N (int) -- Length of the array to generate
num_blocks (int) -- Number of blocks to generate. Defaults to 10.
- Returns:
An array of length N with values between 0 and num_blocks-1
- Return type:
np.array
- class flasc.analysis.energy_ratio_input.EnergyRatioInput(df_list_in, df_names, num_blocks=10)[source]#
EnergyRatioInput class.
This class holds the structured inputs for calculating energy ratios
- Parameters:
df_list_in (List[DataFrame])
df_names (List[str])
num_blocks (int)
- get_df()[source]#
Get the concatenated dataframe.
- Return type:
DataFrame
- Returns:
The concatenated dataframe
- Return type:
pl.DataFrame
- resample_energy_table(perform_resample=True)[source]#
Use the block column of an energy table to resample the data.
- Return type:
DataFrame
- Parameters:
perform_resample (bool) -- Boolean, if False returns original energy table. Defaults to True.
- Returns:
- A new energy table with (approximately)
the same number of rows as the original
- Return type:
pl.DataFrame