PAGEX Worker module

class pagex_worker.Compound(comp_0=None, comp_1=None, comp_2=None, fflag=False)[source]

Bases: object

Compound class that handles all PAGEX calculations

Parameters
  • comp_0 (str, optional) – Compound with constituents and number of constituents sep by ‘ ‘, defaults to None

  • comp_1 (str, optional) – Compound constituents sep by ‘ ‘. For known weight frac. like input, defaults to None

  • comp_2 (str, optional) – Compound weight frac sep by ‘ ‘. Elemental weight fractions not summing to 1 are normalized. Must give fflag = True if comp_1, comp_2 is used, defaults to None

  • fflag (bool, optional) – Weight frac. flag. Use comp_0 and calculated weight frac if True, else comp_1, comp_2, defaults to False

calc_weight_fraction()[source]

Private function to caluclate weight fraction

interpolate_e(custom_energies)[source]

Interpolates parameter values at defined custom energies for the previously run function.

Parameters

custom_energies (list) – Energies to interpolate in Mev, details in readme

Returns

data with now interpolated values. Can also be written to csv with write_to_csv

Return type

dict

kerma_1(relative_to_choice='Air', kerma=False)[source]

Returns Relative KERMA or Photon mass-energy absorption coefficients

Parameters
  • relative_to_choice (str, optional) – for more see readme or files, defaults to ‘AIR’

  • kerma (bool, optional) – For kerma calc., defaults to False

Returns

dict[‘params’] for parameters

Return type

dict

myu()[source]

Returns Photon mass attenuation and interaction cross section parameters

Returns

dict[‘params’] for parameters

Return type

v

plot_parameter(html=False)[source]

Plot the relevant parameters of previously run function.

total_attenuation()[source]

Calculates total attenuation coefficients from NIST database.

write_to_csv()[source]

Write data of previously run function to .csv file in current directory.

zeff_alpha_interaction()[source]

Returns Alpha particle interaction parameters

Returns

Returns Alpha particle interaction parameters

Return type

dict

zeff_by_Ratio()[source]

Returns Photon Zeff - Direct method

Returns

dict[‘params’] for parameters

Return type

dict

zeff_by_log()[source]

Returns Photon Zeff - Interpolation method

Returns

dict[‘params’] for parameters

Return type

dict

zeff_electron_interaction(density)[source]

Returns Electron interaction parameters

Parameters

density (float) – density of material

Returns

dict[‘params’] for parameters

Return type

dict

zeff_proton_interaction()[source]

Returns Proton interaction parameters

Returns

dict[‘params’] for parameters

Return type

dict

zeq_by_R(mfp=None, gp=False)[source]

Returns Photon Zeq or G-P fitting parameters and buildup factors

Parameters
  • mfp (list, optional) – list of floats for gp = True, defaults to None

  • gp (bool, optional) – for G-P fitting parameters and buildup factors, defaults to False

Returns

dict[‘params’] for parameters

Return type

dict

pagex_worker.CreateFolder(directory)[source]

Create directory if not present

pagex_worker.CreateLog(dat1, loc='InputLog.log')[source]

Create log file of all PAGEX processes

pagex_worker.main(comp_0a, do_what_now, output, ff1, comp_1a, comp_2a, eflag, mfp, density, rel_mat, custom_energies_list)[source]
pagex_worker.run_gui()[source]

Starts the program with a web brower based GUI for easy input and a help page.