Skip to content

Use Projected CRS for Mask Buffering (Instead of Silencing geopandas Warning) - #189

Merged
mxkpp merged 6 commits into
NGWPC-7625_PI_10_ngen_forcing_refactorfrom
silence_crs_warning
Aug 14, 2026
Merged

Use Projected CRS for Mask Buffering (Instead of Silencing geopandas Warning)#189
mxkpp merged 6 commits into
NGWPC-7625_PI_10_ngen_forcing_refactorfrom
silence_crs_warning

Conversation

@mdeshotel

Copy link
Copy Markdown

Use projected crs instead of geographic crs for buffering watershed. The new buffer seems reasonable and provides full coverage; see below.

image

Additions

Removals

Changes

Testing

Screenshots

Notes

Todos

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Code follows project standards (link if applicable)
  • Passes all existing automated tests
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future todos are captured in comments
  • Visually tested in supported browsers and devices (see checklist below 👇)
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
  • Reviewers requested with the Reviewers tool ➡️

Testing checklist

Target Environment support

  • Linux

@mdeshotel
mdeshotel requested a review from mxkpp June 25, 2026 18:01

@mxkpp mxkpp left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Questions below

Comment thread NextGen_Forcings_Engine_BMI/NextGen_Forcings_Engine/historical_forcing.py Outdated
Comment thread NextGen_Forcings_Engine_BMI/NextGen_Forcings_Engine/historical_forcing.py Outdated
Comment thread NextGen_Forcings_Engine_BMI/NextGen_Forcings_Engine/historical_forcing.py Outdated
@mxkpp
mxkpp force-pushed the silence_crs_warning branch from 9073aa5 to dbbdb4d Compare August 6, 2026 18:50
@mxkpp

mxkpp commented Aug 6, 2026

Copy link
Copy Markdown

Rebased against development

@mxkpp

mxkpp commented Aug 7, 2026

Copy link
Copy Markdown

This looked mostly good. To cover any of the Hawaiian islands without distortion, I changed Hawaii to dynamically determine the UTM zone of the centroid of the area being modeled and use that UTM projection instead of applying one Hawaii projection. Also increased the buffer to 6km and have it asserting horizontal units of that temporary CRS.

I tested by running CONUS and oCONUS, NWM and AORC and reviewing the output PNG plots. To do that, uncomment this part

if self.mpi_config.rank == 0:
    self.plot_precip(ds)
self.write_sum_tif(self.computed_ds)

And then see the RAINRATE PNGs that come out with this kind of path:

run_ngen/kge_dds/test_bmi/01123000/Output/Calibration_Run/ngen_dr9zi66n_worker/RAINRATE_2013-07-25T01:00:00.000000000_0.png

I think this is ready to merge.

@mxkpp
mxkpp requested a review from idtodd August 7, 2026 17:37
@mxkpp

mxkpp commented Aug 7, 2026

Copy link
Copy Markdown

@idtodd do you mind reviewing my final commit here? I reviewed the earlier commits already.

@mxkpp
mxkpp self-requested a review August 7, 2026 17:42
@mxkpp mxkpp changed the title use projected crs instead of silencing warning from geographic crs use Use Projected CRS for Mask Buffering (Instead of Silencing geopandas Warning) Aug 7, 2026
@mxkpp

mxkpp commented Aug 7, 2026

Copy link
Copy Markdown

Note: for Alaska NWM, even though the PNG plot looks okay, the output NetCDF file does not seem to draw in the correct spot in QGIS (it is much too wide, too short, and located above the North Pole). Need to determine if this is an issue with QGIS or if the output NetCDF actually has an issue.

@mxkpp
mxkpp force-pushed the silence_crs_warning branch from 7dbd8a5 to 92f5333 Compare August 11, 2026 13:51
@mxkpp

mxkpp commented Aug 11, 2026

Copy link
Copy Markdown

Rebased

@mxkpp

mxkpp commented Aug 11, 2026

Copy link
Copy Markdown

Note: for Alaska NWM, even though the PNG plot looks okay, the output NetCDF file does not seem to draw in the correct spot in QGIS (it is much too wide, too short, and located above the North Pole). Need to determine if this is an issue with QGIS or if the output NetCDF actually has an issue.

I confirmed that the output Alaska NetCDF files draw strangely on the development branch as well, so that is not new behavior with these changes. Good.

@mxkpp
mxkpp changed the base branch from development to NGWPC-7625_PI_10_ngen_forcing_refactor August 13, 2026 18:16
@mxkpp
mxkpp force-pushed the silence_crs_warning branch from 92f5333 to 561bd26 Compare August 13, 2026 18:17
@mxkpp
mxkpp merged commit bb8c3b5 into NGWPC-7625_PI_10_ngen_forcing_refactor Aug 14, 2026
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