mirror of
https://github.com/pim-n/pg-rad
synced 2026-03-10 19:48:12 +01:00
code file paths/names in config folder for more centralized definition of filenames
This commit is contained in:
3
src/pg_rad/configs/filepaths.py
Normal file
3
src/pg_rad/configs/filepaths.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
ATTENUATION_TABLE = 'attenuation_table.csv'
|
||||||
|
TEST_EXP_DATA = 'test_path_coords.csv'
|
||||||
|
LOGGING_CONFIG = 'logging.yml'
|
||||||
@ -3,11 +3,13 @@ from importlib.resources import files
|
|||||||
from pandas import read_csv
|
from pandas import read_csv
|
||||||
from scipy.interpolate import interp1d
|
from scipy.interpolate import interp1d
|
||||||
|
|
||||||
|
from pg_rad.configs.filepaths import ATTENUATION_TABLE
|
||||||
|
|
||||||
|
|
||||||
def get_mass_attenuation_coeff(
|
def get_mass_attenuation_coeff(
|
||||||
*args
|
*args
|
||||||
) -> float:
|
) -> float:
|
||||||
csv = files('pg_rad.data').joinpath('attenuation_table.csv')
|
csv = files('pg_rad.data').joinpath(ATTENUATION_TABLE)
|
||||||
data = read_csv(csv)
|
data = read_csv(csv)
|
||||||
x = data["energy_mev"].to_numpy()
|
x = data["energy_mev"].to_numpy()
|
||||||
y = data["mu"].to_numpy()
|
y = data["mu"].to_numpy()
|
||||||
|
|||||||
Reference in New Issue
Block a user