ADF icon indicating copy to clipboard operation
ADF copied to clipboard

Enable regional subsetting

Open wwieder opened this issue 8 months ago • 6 comments

What is this new feature?

Write or adapt python function to make regional timeseries or climo plots.

  • [ ] Create dictionary of regions to plot
  • [ ] Need workflow for unstructured and regular grids (uxarry and xarray approaches)
    • build on / adapt existing region_multicase examples in ADF
    • see also this notebook, cell 22 for a uxarray example.
  • [ ] Develop web interface for displaying results (again maybe build on region_multicase?)

wwieder avatar Apr 06 '25 14:04 wwieder

Another helpful example of regional hydrology from @olyson is on these slides

wwieder avatar Apr 09 '25 15:04 wwieder

The current NCL-based diagnostics package gets the regions information from this file:

/glade/campaign/cgd/tss/people/oleson/FROM_LMWG/diag/lnd_diag4.2/code/resources/region_definitions.nc

ncdump -h region_definitions.nc

... int region(region) ; float BOX_S(region) ; BOX_S:long_name = "Southern Boundary" ; BOX_S:_FillValue = -9999.f ; float BOX_N(region) ; BOX_N:long_name = "Northern Boundary" ; BOX_N:_FillValue = -9999.f ; float BOX_W(region) ; BOX_W:long_name = "Western Boundary" ; BOX_W:_FillValue = -9999.f ; float BOX_E(region) ; BOX_E:long_name = "Eastern Boundary" ; BOX_E:_FillValue = -9999.f ; char PS_ID(region, ncl1) ; PS_ID:long_name = "Postscript File Id" ; PS_ID:_FillValue = "" ; char PTITSTR(region, ncl2) ; PTITSTR:long_name = "Region Title" ; PTITSTR:_FillValue = "" ; char BOXSTR(region, ncl3) ; BOXSTR:long_name = "Region Lat/Lon Title" ; BOXSTR:_FillValue = "" ; ...

The main Lab Sea related land regions we've been looking at recently (as shown in the slides linked BELOW) are:

"Canadian_Arctic_B": 58N-70N, 80W-60W "Greenland_A": 58N-70N, 57W-45W

olyson avatar Apr 09 '25 17:04 olyson

Thanks Keith! seems pretty straightforward to create a python dictionary or .yaml this .nc file that can be read to subset region.

wwieder avatar Apr 09 '25 18:04 wwieder

Updated link for the regional hydrology slides is here

olyson avatar Apr 09 '25 20:04 olyson

I have something that works, but I think there's a lot of steps for this to be fully functional. Compiling a list:

  • convert region defintion netCDF file to a yml, read that in instead
  • increase number of variables that have a climo plotted; i've just added two, but left room for more in the subplots
  • check that all varaibles have climo files; likely to break otherwise
  • add option so that this works with a structured grid too
  • do conversions so that climo's are being plotted with the preferred units
  • add in observations (need to regrid/area weight for this to be accurate)
  • need to figure out how to display the figures on the website

Is it worth opening a PR for the script as it stands now? Or better to work through at least some of these first?

megandevlan avatar Apr 11 '25 16:04 megandevlan

Your call. You can always just open a draft PR so others can see it. Alternatively, if you think you'll be able knock off a few of these in relatively short time also OK to wait.

wwieder avatar Apr 11 '25 19:04 wwieder

Closed with #386

wwieder avatar May 09 '25 18:05 wwieder