Skip to content

Update atmos_bufr_prepobs.py for restriction logic#205

Merged
HyundeokChoi-NOAA merged 4 commits intomainfrom
feature/atmos_bufr_prepobs_update
Apr 6, 2026
Merged

Update atmos_bufr_prepobs.py for restriction logic#205
HyundeokChoi-NOAA merged 4 commits intomainfrom
feature/atmos_bufr_prepobs_update

Conversation

@HyundeokChoi-NOAA
Copy link
Copy Markdown
Contributor

This PR updates atmos_bufr_prepobs.py to integrate the new restriction‑screening workflow. The script reads restrictionFlag and restrictionExpiration from the MetaData group and determines which observations should be retained or dropped before writing the output IODA netCDF file.

exec_cmd()
except Exception as e:
logger.warning(f"ioda_restriction_filter.py failed: {e}")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change


logger.info(f"Running unified restriction filter using {stats_yaml}")

exec_cmd = Executable("python")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious if it makes more sense to call the main function in the python script in the other PR through python (import, etc.) rather than do it this way (execute it externally). Thoughts? Is there a benefit to doing it via a subprocess?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That’s a good point. I didn’t think about it that way initially. I’ll update the script so the task calls the main function directly instead of running it as a subprocess.

@HyundeokChoi-NOAA
Copy link
Copy Markdown
Contributor Author

@CoryMartin-NOAA This failure is likely due to ioda_restriction_filter.py from DA‑Utils PR #73 not being merged into the repository yet.

@CoryMartin-NOAA
Copy link
Copy Markdown
Contributor

NOAA-EMC/DA-utils#73 has been merged, you should be able to update the hash in this PR and this can be merged

@HyundeokChoi-NOAA
Copy link
Copy Markdown
Contributor Author

@CoryMartin-NOAA Got it. I’ve updated the da-utils submodule hash to the latest develop commit. Thanks for the heads‑up.

@ilianagenkova
Copy link
Copy Markdown

I approved this PR based on the extend I understand the entire obsForge.

This PR doesn't include the application of restriction:
chgrp rstprod filename
chmod 750 **filename
**
to the files containing restricted observations.
This could be added to the first filter (RSRD), i.e. restrict the ioda file that contains any populated RSRD ( missing RSRD means the data is not restricted at all).

Open a separate PR for this work, thanks!

@HyundeokChoi-NOAA
Copy link
Copy Markdown
Contributor Author

@ilianagenkova Thanks iliana. I was planning to do it.

@HyundeokChoi-NOAA HyundeokChoi-NOAA merged commit b522b4b into main Apr 6, 2026
2 checks passed
@HyundeokChoi-NOAA HyundeokChoi-NOAA deleted the feature/atmos_bufr_prepobs_update branch April 6, 2026 17:58
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.

3 participants