Add NetCDF4 ObsFcstAna postprocessing support - #185
Draft
amfox37 wants to merge 3 commits into
Draft
Conversation
Current experiments write ObsFcstAna as .nc4 (schema ObsFcstAna_nc4_v1) instead of the legacy .bin format. postproc_ObsFcstAna.py previously only looked for .bin and silently skipped missing timesteps, so nc4-only experiments produced empty stats with no warning. - Add read_ObsFcstAna_nc4() to read_GEOSldas.py, matching the .bin reader's output contract (validated against 56 matched .bin/.nc4 timestamp pairs). - compute_monthly_sums() now tries .nc4 first, falls back to .bin. - Warn and skip (rather than silently produce empty stats) when a month has zero matched files, without aborting the rest of the batch run.
obsparam text files now include fcstvarname/fcstunits fields after varname/units, which read_obs_param() didn't account for. This shifted every subsequent field (path, name, errstd, etc.) by two lines, causing ValueError when parsing production experiments' obsparam.txt. Confirmed against DAv7_M36_ASCAT_type_13_H121 (Apr 2015): with this fix, Get_ObsFcstAna_sums.py runs end-to-end via the new nc4 reader and produces sane, non-empty monthly O-F sums for all 10 species. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Collaborator
|
Thanks, Andy, for creating the PR. It looks good to me. @gmao-qliu: when you get a chance, please also review and let me know. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for reading NetCDF4 ObsFcstAna diagnostics in the monthly postprocessing pipeline.
Summary:
read_ObsFcstAna_nc4()to read NetCDF4 ObsFcstAna files into the same structure used by the legacy binary reader.postproc_ObsFcstAna.pyto prefer.nc4ObsFcstAna files and fall back to.binfiles.read_obs_param()parsing for the current obsparam format by reading forecast variable names and units.CHANGELOG.md.Testing:
python3 -m py_compileonpostproc_ObsFcstAna.pyandread_GEOSldas.py.