flasc.analysis.energy_ratio_input#

Energy ratio input module.

Functions

generate_block_list

Generate an np.array of length N where each element is an integer between 0 and num_blocks-1.

Classes

EnergyRatioInput

EnergyRatioInput class.

flasc.analysis.energy_ratio_input.generate_block_list(N: int, num_blocks: int = 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: List[DataFrame | FlascDataFrame], df_names: List[str], num_blocks: int = 10)[source]#

EnergyRatioInput class.

This class holds the structured inputs for calculating energy ratios

Parameters:
  • df_list_in (List[pd.DataFrame | FlascDataFrame])

  • df_names (List[str])

  • num_blocks (int)

get_df() DataFrame[source]#

Get the concatenated dataframe.

Returns:

The concatenated dataframe

Return type:

pl.DataFrame

resample_energy_table(perform_resample: bool = True) DataFrame[source]#

Use the block column of an energy table to resample the data.

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