-
Notifications
You must be signed in to change notification settings - Fork 415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automated Field Solver #2070
base: main
Are you sure you want to change the base?
Automated Field Solver #2070
Conversation
This is a pretty straightforward Breadth-First Search (BFS) through a registry of calculations. The path accounts for what's available as we traverse through the "graph".
Add a basic test for the calculate functionality.
Need to broadcast temperature and relative_humidity together.
Need to not include calculated parameters in what we "have" because it's not actually available higher up in the call stack--instead manually remove from the "need" list. This also means we now need the code that detects and breaks call cycles.
This allows us to automatically calculate heat_index from NARR output.
If you want to see what this looks like currently: import xarray as xr
from metpy.cbook import get_test_data
from metpy.plots import ContourPlot, ImagePlot, MapPanel, PanelContainer
from metpy.units import units
narr = xr.open_dataset(get_test_data('narr_example.nc', as_file_obj=False))
contour = ContourPlot()
contour.data = narr
contour.field = 'heat_index'
contour.level = 1000 * units.hPa
contour.linecolor = 'red'
contour.contours = 15
panel = MapPanel()
panel.area = 'us'
panel.layers = ['coastline', 'borders', 'states', 'rivers', 'ocean', 'land']
panel.plots = [contour]
pc = PanelContainer()
pc.size = (10, 8)
pc.panels = [panel]
pc.show() |
🎉 🎉 🎉 Definitely +1 on exposing through the Dataset accessor. Given that this implementation is centered around parameter names, there are a few potentially problematic use cases that I wanted to get your thoughts on. I have no expectation that these are handled right away (if at all), but I wanted to bring them up now so that 1) we don't bake-in any assumptions we'd regret later and 2) I can get on the same page in regards to what is in-scope and out-of-scope for the solver.
|
Description Of Changes
Finally have a really solid cut at the last major deliverable from the last grant, and at long last close out #3. The implementation, once I got my head around it, was remarkably straightforward--owing to how much other infrastructure we have developed in xarray + units. The major pieces:
heat_index
vs.relative_humidity_from_mixing_ratio
) Aside: why doeswind_chill
takespeed
and notwind_speed
? 🤦♂️I've also already had to fix
heat_index
to allow broadcasting so that when we calculate e.g. relative_humidity using 1Disobaric
, things flow through the whole pipeline fine. I'm sure there's more waiting--I already tried and failed to doequivalent_potential_temperature
.Left to do:
Checklist