-
Notifications
You must be signed in to change notification settings - Fork 416
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
Align Coordinate Data for Multiple Variables #1599
Comments
The title for this "Align coordinate data for multiple variables" is rather broad, but based on the description, is the specific feature of interest just vertical alignment, namely subsetting data to the vertical levels where coordinate values match across multiple variables? If so, I think this would be a good fit for a Dataset accessor method. It may also motivate a basic form of vertical coordinate subtype identification (e.g., isobaric vs. height vs. isentropic vs. sigma/hybrid-sigma) so we can partition variables properly into where we want them to overlap vs. not (unless we always want the user to specify which variables to align rather than automatically choosing them). I'd concur with avoiding building this in to a decorator that's automatically applied...I think this would mean having levels disappear without explanation, which seems like poor user-side behavior. |
Yes, the intent was the vertical alignment of multiple variables. This would be most helpful when doing isentropic or vertical cross section analysis where you need the same number of vertical levels to do the interpolation. I don't know the current status, but I was commonly not getting the same number of vertical levels between temperature and moisture when I would pull a dataset from NOMADS - that was the original impetus for this functionality since you would have to do this alignment manually in that instance. |
We could add
|
There are a number of calculations (e.g.,
isentropic_interpolation
,potential_vorticity_baroclinic
) that require multiple variables to have the same number of vertical levels. Unfortunately, there are a number of methods to obtain gridded data that don't automatically return base state variables (e.g., 'Geopotential_height_isobaric', 'u-component_of_the_wind_isobaric', 'v-component_of_the_wind_isobaric', 'Temperature_isobaric', 'Relative_humidity_isobaric') with the same coordinates, specifically in there vertical. One could end up with at least two, if not three different vertical coordinates because one or more variables are missing values at very low pressure values (very high up in the atmosphere, commonly above 100-hPa level). It would be nice to have in MetPy a way to unify these variables to their common subset of values in the vertical and assign a common vertical name.I imagine a xarray Dataset going in that contains the variables needing to be unified, which will have multiple vertical coordinates (e.g., 'isobaric', 'isobaric3', 'isobaric5', etc.) and out comes a xarray Dataset with all of the same variables subset to the common levels that are available for all of the variables with a single common vertical coordinate name across all of the variables (e.g., 'isobaric_unified'). This output would then be the input for the specific MetPy calculations (as mentioned above). Another alternative would be to build this functionality into a decorator for those functions so the end user wouldn't have to specifically worry about that, but I'm not sold on that idea.
The text was updated successfully, but these errors were encountered: