main module

This is the main module of the application. It contains the main function which processes ACM files and applies corrections.

Functions:

  • apply_corrections: Applies corrections based on user input.

  • read_files: Reads and parses ACM and TXT files.

  • generate_plots: Generates plots and animations.

  • calculate_dose_values: Calculates dose values and dose rate values.

  • snc_format_array: Formats the array to be compatible with the SNC measured txt file.

  • get_user_input: Gets user input for batch folder path and correction type.

  • main: Main function to process ACM files and apply corrections.

main.apply_corrections(counts_accumulated_df, bkrnd_and_calibration_df, include_intrinsic_corrections, array_data)[source]

Apply corrections based on user input.

Parameters:
  • counts_accumulated_df (pandas.DataFrame) – DataFrame with accumulated counts.

  • bkrnd_and_calibration_df (pandas.DataFrame) – DataFrame with background and calibration data.

  • include_intrinsic_corrections (str) – Whether to include intrinsic corrections (‘y’ or ‘n’).

  • array_data (numpy.ndarray) – Array data.

Returns:

Corrected count array.

Return type:

numpy.ndarray

main.calculate_dose_values(counts_accumulated_df, dose_per_count)[source]

Calculate dose values and dose rate values.

Parameters:
  • counts_accumulated_df (pandas.DataFrame) – DataFrame with accumulated counts.

  • dose_per_count (float) – Dose per count.

Returns:

DataFrames with dose values and dose rate values.

Return type:

tuple

main.generate_plots(dose_rate_arrays, dose_df, dose_rate_df, dose_accumulated_df, startframe, endframe, detector_number)[source]

Generate plots and animations.

Parameters:
  • dose_rate_arrays (numpy.ndarray) – Dose rate arrays.

  • dose_df (pandas.DataFrame) – DataFrame with dose data.

  • dose_rate_df (pandas.DataFrame) – DataFrame with dose rate data.

  • dose_accumulated_df (pandas.DataFrame) – DataFrame with accumulated dose data.

  • startframe (int) – Starting frame.

  • endframe (int) – Ending frame.

  • detector_number (int) – Detector number.

main.get_user_input()[source]

Get user input for batch folder path and correction type.

Returns:

Batch folder path and correction type.

Return type:

tuple

main.main()[source]

Main function to process ACM files and apply corrections.

main.read_files(acml_path, txt_path)[source]

Read and parse ACM and TXT files.

Parameters:
  • acml_path (str) – Path to the ACM file.

  • txt_path (str) – Path to the TXT file.

Returns:

DataFrames and arrays with parsed data.

Return type:

tuple

main.snc_format_array(corrected_count_array, formatted_counts)[source]

Formats the array to be compatible with the SNC measured txt file.

Parameters:
  • corrected_count_array (numpy.ndarray) – The array containing corrected dose values.

  • formatted_counts (numpy.ndarray) – The array containing the counts with positional data directly from measured file.

Returns:

Corrected values in format ready for insertion into SNC txt file.

Return type:

numpy.ndarray