Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardcoded paths (noise + excised tim) #43

Open
kmjc opened this issue Jul 11, 2023 · 1 comment
Open

Hardcoded paths (noise + excised tim) #43

kmjc opened this issue Jul 11, 2023 · 1 comment
Labels
discussed Discussed during a NANOGrav GitFlowers Meeting. enhancement New feature or request

Comments

@kmjc
Copy link
Contributor

kmjc commented Jul 11, 2023

There are a few places where the directory structure and naming convention for the noise chains are hardcoded. There are a few separate expectations for what the path is and the files are called around the place, these are the ones I found.

in noise_utils.add_noise_to_model

if not using_wideband:
chaindir = os.path.join(base_dir,f'{model.PSR.value}_nb/')
if compare_dir is not None:
chaindir_compare = os.path.join(compare_dir,f'{model.PSR.value}_nb/')
else:
chaindir = os.path.join(base_dir,f'{model.PSR.value}_wb/')
if compare_dir is not None:
chaindir_compare = os.path.join(compare_dir,f'{model.PSR.value}_wb/')

chainfile = chaindir + 'chain_1.txt'

in noise_utils.analyze_noise

chainfile = chaindir + 'chain_1.txt'

pars = np.loadtxt(chaindir + 'pars.txt', dtype = str)

chainfile_compare = chaindir_compare + 'chain_1.txt'

pars_compare = np.loadtxt(chaindir_compare + 'pars.txt', dtype = str)

if '_wb' in chaindir:
figbase = f"./{psr_name}_noise_posterior_wb"
elif '_nb' in chaindir:
figbase = f"./{psr_name}_noise_posterior_nb"

if '_wb' in chaindir:

in utils.check_recentness_noise

pint_pal/src/pint_pal/utils.py

Lines 1235 to 1240 in 5059239

noise_runs = [os.path.dirname(os.path.dirname(os.path.abspath(p)))
for p in sorted(glob.glob(os.path.join(d,
"..",
"*.Noise.*",
tc.get_source()+"_"+tc.get_toa_type().lower(),
"chain*.txt")))]

Also the path to the excised TOAs is hardcoded in
utils.check_recentness_excision

pint_pal/src/pint_pal/utils.py

Lines 1270 to 1275 in 5059239

excision_dirs = [os.path.dirname(os.path.dirname(os.path.abspath(p)))
for p in sorted(glob.glob(os.path.join(d,
"..", "..",
"*.Outlier.*",
tc.get_source()+"."+tc.get_toa_type().lower(),
"*_excise.tim")))]

@JPGlaser JPGlaser added discussed Discussed during a NANOGrav GitFlowers Meeting. enhancement New feature or request labels May 30, 2024
@rossjjennings
Copy link
Member

Some of these, such as the use of chain_1.txt and pars.txt, are likely to be unproblematic, since the filenames are relatively standardized at the enterprise level. Others may cause problems, but it's likely we'll be changing the way we approach the noise analysis for NG20 anyway. We should revisit this once we have a better idea of how that will work.

@JPGlaser JPGlaser mentioned this issue Dec 18, 2024
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussed Discussed during a NANOGrav GitFlowers Meeting. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants