-
Notifications
You must be signed in to change notification settings - Fork 174
JP-2664: Fix NRS-MOS source ids to be 5 digits and positive #6915
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
JP-2664: Fix NRS-MOS source ids to be 5 digits and positive #6915
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6915 +/- ##
==========================================
- Coverage 79.48% 79.35% -0.14%
==========================================
Files 418 418
Lines 37352 37420 +68
==========================================
+ Hits 29691 29694 +3
- Misses 7661 7726 +65
*This pull request uses carry forward flags. Click here to find out more.
Continue to review full report at Codecov.
|
@hbushouse Addressed the source_id listed in the datamodels - should there be a log message mapping old to new source_ids? |
Yes, I think a log message would be nice to have. |
Some test data files are in the directory listed in JP-2664. None of them have any negative source_ids, but almost all of them are > 99999. So that would make a good test to see the new "sxxxxx" fields in the output file names and SOURCEID values in the headers. |
I had data from the same PID with negative values (which spawned this ticket), and I find similar results as found for the >5 digit numbers - source_ids are created starting from 00001 and work their way up. Loaded datamodels show matching values. Results are in the ticket directory (for sources until I lost VPN connection and broke the processing run). |
Yeah, the earlier version of the data that you had was created using a bad MSA meta file that had the source_id column of the shutters table defined as int16 instead of int32. So all of the source_ids bigger than the int16 limit rolled over to negative numbers. The ones in the data directory now were reprocessed using a corrected MSA metafile from Mike, which made all the negative values go away. But legit negative values can still occur for slits that don't have a real source from the catalog. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Is the reason to limit to 5 digits only to prevent complications down the line, specifically archive? Just curious.
Yes. I believe the archive ingest is setup to expect 5, and only 5, digits in the source id field of the file names and I don't think anyone has checked in detail yet to know whether Cal is OK with creating ones that have more than 5 digits. Haven't actually checked the part(s) of the code yet that fill in the {source_id} part of product names somewhere in level 3 processing. Do you happen to recall where that's done? |
Ah hah. Found it: https://github.com/spacetelescope/jwst/blob/master/jwst/associations/lib/rules_level3_base.py#L621 calwebb_spec3 calls Ack! Never mind. Look what happens:
So it appears to be more than happy to take ids longer than 5 digits, despite the formatting rule. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good. Results look good (including the internal SOURCEID keyword values). I approve.
Closes #
Resolves JP-2664
Description
This PR adds a check on the source_id created in calwebb_spec3, and modifies values that fall outside 0-99999. The wording in the JP ticket indicated this is a temporary fix, so it has been worded/coded as such; if I misinterpreted the level of 'hotfix' involved, I can edit the addition.
Checklist