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

Default to a special template for ZWARN of NODATA cases #294

Merged
merged 2 commits into from Apr 22, 2024

Conversation

geordie666
Copy link
Contributor

This PR sets ZWARN of NODATA cases to a z=0, GALAXY with blank SUBTYPE and zero coefficients.

It should address #224.

Example output files processed via:

rrdesi -i /global/cfs/cdirs/desi/spectro/redux/daily/tiles/cumulative/3351/20230905/coadd-1-3351-thru20230905.fits --outfile $SCRATCH/new.fits --ntargets 15

are at:

/pscratch/sd/a/adamyers/old.fits (before this PR)
/pscratch/sd/a/adamyers/new.fits (after this PR)

Test of the desired outcome:

import fitsio
a = fitsio.read("/pscratch/sd/a/adamyers/old.fits")
b = fitsio.read("/pscratch/sd/a/adamyers/new.fits")
print(a[[5, 14]][["ZWARN", "COEFF", "SPECTYPE", "SUBTYPE"]])
print(b[[5, 14]][["ZWARN", "COEFF", "SPECTYPE", "SUBTYPE"]])

[(516, [ 6.13320718e+01, -7.90512496e+01,  4.09394471e+01, -4.52058606e+01,  2.58237348e+00,  2.92976339e+00,  1.51155349e+01,  1.33815240e-01, -4.78952134e+00,  8.33736341e+00], 'GALAXY', '')
 (516, [-2.85894625e-02,  8.61347220e+02,  1.78825596e+00, -2.12392741e+00,  0.00000000e+00,  0.00000000e+00,  0.00000000e+00,  0.00000000e+00,  0.00000000e+00,  0.00000000e+00], 'QSO', 'LOZ')]
[(516, [0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], 'GALAXY', '')
 (516, [0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], 'GALAXY', '')]

@geordie666
Copy link
Contributor Author

This is still a work in progress while we determine whether we need more special-casing (as described in #224).

@coveralls
Copy link

coveralls commented Apr 20, 2024

Coverage Status

coverage: 38.547% (+0.2%) from 38.311%
when pulling 0b43353 on ADM-null-template
into 1b9f888 on main.

@geordie666 geordie666 added the Work In Progress Work In Progress. Don't merge this PR yet! label Apr 20, 2024
@sbailey
Copy link
Collaborator

sbailey commented Apr 22, 2024

Thanks, looks good. I will merge this and close the issues, but we can re-open them and reconsider a custom NODATA template if we find ourselves still tripping on these.

@sbailey sbailey merged commit a100d12 into main Apr 22, 2024
12 checks passed
@sbailey sbailey deleted the ADM-null-template branch April 22, 2024 17:19
@geordie666 geordie666 removed the Work In Progress Work In Progress. Don't merge this PR yet! label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants