-
Notifications
You must be signed in to change notification settings - Fork 16
Closed
Labels
project: seats-year4A SEATS goal for year 4A SEATS goal for year 4type: enhancementNew enhancement requestNew enhancement request
Milestone
Description
Is your feature request related to a problem?
Discussed in #440
Originally posted by tomvothecoder March 27, 2023
Hi @xCDAT/core-developers or anybody in the xCDAT community. Have any of you come across a package that implements an xarray-based function similar to cdutil.vertical.reconstructPressureFromHybrid? I am working on refactoring e3sm_diags and e3sm_to_cmip to use xarray/xCDAT and there are references to this function that I need to replace. Thanks!
Docstring:
def reconstructPressureFromHybrid(ps, A, B, Po):
"""
Reconstruct the Pressure field on sigma levels, from the surface pressure
:param Ps: Surface pressure
:param A: Hybrid Conversion Coefficient, such as: p=B.ps+A.Po.
:param B: Hybrid Conversion Coefficient, such as: p=B.ps+A.Po.
:param Po: Hybrid Conversion Coefficient, such as: p=B.ps+A.Po
:param Ps: surface pressure
.. note::
A and B are 1d sigma levels.
Po and Ps must have same units.
:returns: Pressure field, such as P=B*Ps+A*Po.
:Example:
.. doctest:: vertical_reconstructPressureFromHybrid
>>> P=reconstructPressureFromHybrid(ps,A,B,Po)
"""
...
Examples Usages:
- https://github.com/E3SM-Project/e3sm_diags/blob/4a82b0ec3b2a81233b294fa505c6aa8228ecbd27/e3sm_diags/driver/utils/general.py#L132-L146
- https://github.com/E3SM-Project/e3sm_to_cmip/blob/70f7dad381ef304b022826b540df0e7b46ba9912/e3sm_to_cmip/cmor_handlers/vars/pfull.py#L38-L47
- https://github.com/E3SM-Project/e3sm_to_cmip/blob/70f7dad381ef304b022826b540df0e7b46ba9912/e3sm_to_cmip/cmor_handlers/vars/phalf.py#L39-L50
Describe the solution you'd like
First, check of any other xarray-based package includes this feature.
- If exist - check if the implementation meets our requirements (based on
cdutil.vertical.reconstructPressureFromHybrid)- If meets our requirements -- just use this library API instead
- If does not meet our requirements -- open a new PR after Add API extending xgcm vertical regridding #388 is merged
- If none exist -- open a new PR after Add API extending xgcm vertical regridding #388 is merged
Describe alternatives you've considered
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
project: seats-year4A SEATS goal for year 4A SEATS goal for year 4type: enhancementNew enhancement requestNew enhancement request
Type
Projects
Status
Done