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

Quasarnet afterburner tries to write to input directory #2281

Closed
akremin opened this issue Jun 18, 2024 · 1 comment
Closed

Quasarnet afterburner tries to write to input directory #2281

akremin opened this issue Jun 18, 2024 · 1 comment
Labels

Comments

@akremin
Copy link
Member

akremin commented Jun 18, 2024

While trying to run some reproducibility tests of QuasarNP, I attempted to use daily redrock and coadd files as inputs but save the outputs to an alternate location for comparison with the outputs in daily. This is failing with the following traceback. The solution is to either write temporary files to the current working directory, or more ideally to the output directory rather than assuming the user will have write permission on the input directory.

Command:
desi_qso_qn_afterburner --coadd /global/cfs/cdirs/desi/spectro/redux/daily/tiles/cumulative/9203/20240409/coadd-0-9203-thru20240409.fits --redrock /global/cfs/cdirs/desi/spectro/redux/daily/tiles/cumulative/9203/20240409/redrock-0-9203-thru20240409.fits --output ./test-qso_qn-0-9203-thru20240409.fits --target_selection all --save_target all

Output:

DEBUG: Reading templates from /global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/code/redrock-templates/main
INFO:qsoqn.py:502:main: SANITY CHECK: The indices of REDROCK HDU and FIBERMAP HDU match.
INFO:qsoqn.py:537:main: Nbr objetcs for QN: 500
Model grid not found in file, defaulting to logarithmic
INFO:qsoqn.py:318:selection_targets_with_QN: We select QSO from QN with c_thresh=0.5 and n_thresh=1 --> 41 objects are QSO for QN
INFO:qsoqn.py:326:selection_targets_with_QN: Remove 35 objetcs with SPECTYPE==QSO and |z_RR - z_QN| < 0.05 (since even with the prior, RR will give the same result)
INFO:qsoqn.py:331:selection_targets_with_QN: RUN RR on 6
Traceback (most recent call last):
  File "/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/code/desispec/main/bin/desi_qso_qn_afterburner", line 10, in <module>
    sys.exit(qsoqn.main(args))
  File "/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/code/desispec/main/py/desispec/scripts/qsoqn.py", line 538, in main
    QSO_from_QN = selection_targets_with_QN(redrock, fibermap, sel_to_QN, DESI_TARGET,
  File "/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/code/desispec/main/py/desispec/scripts/qsoqn.py", line 334, in selection_targets_with_QN
    redshift, err_redshift, coeffs = collect_redshift_with_new_RR_run(spectra_name, redrock['TARGETID'][sel_QN], z_QN[index_with_QN_with_no_pb], param_RR, comm=comm)
  File "/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/code/desispec/main/py/desispec/scripts/qsoqn.py", line 221, in collect_redshift_with_new_RR_run
    write_prior_for_RR(targetid[sel], z_prior[sel], filename_priors)
  File "/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/code/desispec/main/py/desispec/scripts/qsoqn.py", line 151, in write_prior_for_RR
    out = fitsio.FITS(filename_priors, 'rw', clobber=True)
  File "/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/fitsio/fitslib.py", line 522, in __init__
    self._FITS = _fitsio_wrap.FITS(filename, self.intmode, create)
OSError: FITSIO status = 105: couldn't create the named file
failed to create new file (already exists?):
/global/cfs/cdirs/desi/spectro/redux/daily/tiles/cumulative/9203/20240409/priors
-tmp-0-9203-thru20240409.fits
@sbailey
Copy link
Contributor

sbailey commented Nov 7, 2024

Fixed by PR #2402; closing.

@sbailey sbailey closed this as completed Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants