Preserve DATE-BEG, DATE-END when creating level2 files#963
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #963 +/- ##
==========================================
+ Coverage 58.04% 58.24% +0.19%
==========================================
Files 127 127
Lines 13833 13952 +119
==========================================
+ Hits 8030 8126 +96
- Misses 5803 5826 +23 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
… the corresponding L2_CTM file
Previously L3_CIM files were getting date_beg and date_end from the min and max of the date_obs values of the inputs (which are all the same). Now they come from date_beg and date_end of the inputs (which are homogenized but different than date_obs). Also we can skip two loops over input files when setting the outlier and bad packet flags because these are also homogenized in L2_X files.
|
This is close, but not quite there. Currently it is doing a good job of settting the database fields from auto/flows, but needs to set the same info in the file header in level2/merge.py. |
Adds metadata properties "datebeg" and "dateend". Sorts through those properties when merging data. Adds tests.
|
OK, @jmbhughes, @svank, @lowderchris this is ready for review. |
| date_created=datetime(2026, 4, 9, 1, 0, 0, tzinfo=UTC), | ||
| date_beg=datetime(2026, 4, 8, 23, 52, 17, 143000, tzinfo=UTC), | ||
| date_obs=datetime(2026, 4, 8, 23, 52, 29, 143000, tzinfo=UTC), | ||
| date_end=datetime(2026, 4, 8, 23, 52, 41, 143000, tzinfo=UTC), |
There was a problem hiding this comment.
I wonder if it would help testing to make one of the WFIs late, or something - to check how that will change things downstream in a predictable way.
There was a problem hiding this comment.
@lowderchris The commit ce41dec makes the two banks of tests the same, replaces the chained equality (which was cumbersome for 4 CTM files) with the len(set()) idiom, and actually checks the values of the returned date_beg, date_obs, and date_end, which is what I think you were going for here.
lowderchris
left a comment
There was a problem hiding this comment.
This is looking great! Time at last... I just left a suggestion or two and a question.
Co-authored-by: Chris Lowder <chris.lowder@swri.org>
PR summary
When creating observatory-specific L2 files from L1 files, make sure the beginning and ending dates (DATE-BEG and DATE-END) are preserved in the L2 files. Also, when creating mosaic files, use the earliest input DATE-BEG and the latest input DATE-END in the mosaic.
This is one possible approach. We could adopt a different approach in which the earliest and latest DATE-OBS is what goes into the DATE-BEG and DATE-END of the mosaic.
Todos
Please list tasks to complete this PR.
Test plan
Added many tests to auto/level2
Breaking changes
None known
Related Issues
Closes #948