-
Notifications
You must be signed in to change notification settings - Fork 3
Add vertical interpolation #79
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
base: develop
Are you sure you want to change the base?
Add vertical interpolation #79
Conversation
|
Hi @cfkanesan, thank you very much for this contribution. These would be the first methods implemented in the high-level earthkit-meteo API! Please note there is an ongoing development to add somewhat similar methods to the array level interface: #81. So it would be important to agree on a naming convention for the names and args/kwargs of all these methods. These are just my initial thoughts for interpolate_k2pdef interpolate_k2p(
field: xr.DataArray,
mode: Literal["linear_in_p", "linear_in_lnp", "nearest_sfc"],
p_field: xr.DataArray,
p_tc_values: Sequence[float],
p_tc_units: Literal["Pa", "hPa"],
) -> xr.DataArray:earhkit-meteo tends to use long method names and short args and kwargs names. So in the same spirit the name could be Maybe
Also consider assigning a default value to |
|
Hi @cfkanesan , as the outcome of some recent discussions we suggest the following naming convention and arg/kwarg ordering for the methods in the PR:
The proposal# current name: interpolate_monotonic
def interpolate_monotonic(
data,
coord,
target_coord,
interpolation)# current name: interpolate_to_pressure_levels
def interpolate_to_pressure_levels(
data,
p,
target_p,
target_p_units.
interpolation
)# current name: interpolate_to_any
def interpolate_sleve_to_coord_levels(
data,
h,
target_data,
target_coord,
folding_mode
) # current name: interpolate_to_theta_levels
def interpolate_sleve_to_theta_levels(
data,
theta,
h,
target_theta,
target_theta_units,
folding_mode,
) |
|
Hi @sandorkertesz, thanks for the feedback. Perhaps |
Hi @cfkanesan , I think using |
|
From my understanding, both |
|
Hi @cfkanesan, having checked the code, using def interpolate_monotonic(
data,
coord,
target_coord,
interpolation)
def interpolate_sleve_to_coord_levels(
data,
h,
coord,
target_coord,
folding_mode
) ... since |
| values=tc_values.tolist(), | ||
| ) | ||
|
|
||
| return interpolate_sleve_to_coord_levels(data, theta, tc, h, folding_mode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not it be:
return interpolate_sleve_to_coord_levels(data, h, theta, tc, folding_mode)
Description
High level functions implementing vertical interpolation to pressure, potential temperature and arbitrary fields.
Contributor Declaration
By opening this pull request, I affirm the following: