-
Notifications
You must be signed in to change notification settings - Fork 94
Match coordinate names against list of vertical levels from eccodes in extract_dataset_chunk_index #552
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
Match coordinate names against list of vertical levels from eccodes in extract_dataset_chunk_index #552
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -100,6 +100,104 @@ class DynamicZarrStoreError(ValueError): | |
|
|
||
| ZARR_TREE_STORE = "zarr_tree_store.json.gz" | ||
|
|
||
| # derived from eccodes/grib2/typeOfLevelConcept.def | ||
| ECCODES_VERTICAL_LEVEL_LIST = [ | ||
| "abstractMultipleLevels", | ||
| "abstractSingleLevel", | ||
| "adiabaticCondensation", | ||
| "atmosphere", | ||
| "cloudBase", | ||
| "cloudTop", | ||
| "convectiveCondensation", | ||
| "cumulonimbusBase", | ||
| "cumulonimbusTop", | ||
| "depthBelowLand", | ||
| "depthBelowLandLayer", | ||
| "depthBelowSea", | ||
| "depthBelowSeaLayer", | ||
| "entireAtmosphere", | ||
| "entireLake", | ||
| "entireMeltPond", | ||
| "entireOcean", | ||
| "eta", | ||
| "freeConvection", | ||
| "generalVertical", | ||
| "generalVerticalLayer", | ||
| "heightAboveGround", | ||
| "heightAboveGroundLayer", | ||
| "heightAboveSea", | ||
| "heightAboveSeaLayer", | ||
| "highCloudLayer", | ||
| "hybrid", | ||
| "hybridHeight", | ||
| "hybridLayer", | ||
| "hybridPressure", | ||
| "iceBottomOnWater", | ||
| "iceLayerAboveWaterSurface", | ||
| "iceLayerOnWater", | ||
| "iceLayerUnderSnowOnWater", | ||
| "iceTopOnWater", | ||
| "iceTopUnderSnowOnWater", | ||
| "indefiniteSoilDepth", | ||
| "isobaricInPa", | ||
| "isobaricInhPa", | ||
| "isobaricLayer", | ||
| "isothermZero", | ||
| "isothermal", | ||
| "lakeBottom", | ||
| "lowCloudLayer", | ||
| "lowestLevelOfCloudCoverExceedance", | ||
| "maxWind", | ||
| "meanSea", | ||
| "mediumCloudLayer", | ||
| "meltPondBottom", | ||
| "meltPondTop", | ||
| "mixedLayerDepthByDensity", | ||
| "mixedLayerDepthByDiffusivity", | ||
| "mixedLayerDepthByTemperature", | ||
| "mixedLayerDepthGeneric", | ||
| "mixedLayerParcel", | ||
| "mixingLayer", | ||
| "mostUnstableParcel", | ||
| "neutralBuoyancy", | ||
| "nominalTop", | ||
| "oceanModel", | ||
| "oceanModelLayer", | ||
| "oceanSurface", | ||
| "oceanSurfaceToBottom", | ||
| "potentialVorticity", | ||
| "pressureFromGround", | ||
| "pressureFromGroundLayer", | ||
| "road", | ||
| "roadLayer", | ||
| "roof", | ||
| "roofLayer", | ||
| "rootZone", | ||
| "seaBottom", | ||
| "seaIce", | ||
| "seaIceLayer", | ||
| "sigma", | ||
| "sigmaLayer", | ||
| "snow", | ||
| "snowLayer", | ||
| "snowLayerOverIceOnWater", | ||
| "snowTopOverIceOnWater", | ||
| "soil", | ||
| "soilLayer", | ||
| "stratosphere", | ||
| "surface", | ||
| "theta", | ||
| "thetaLayer", | ||
| "totalSoilLayer", | ||
| "tropopause", | ||
| "troposphere", | ||
| "unknown", | ||
| "urbanCanyon", | ||
| "wall", | ||
| "wallLayer", | ||
| "waterSurfaceToIsothermalOceanLayer", | ||
| ] | ||
|
|
||
|
|
||
| def repeat_steps(step_index: pd.TimedeltaIndex, to_length: int) -> np.array: | ||
| return np.tile(step_index.to_numpy(), int(np.ceil(to_length / len(step_index))))[ | ||
|
|
@@ -612,12 +710,7 @@ def extract_dataset_chunk_index( | |
| for cname, cvar in dvar.coords.items(): | ||
| if grib: | ||
| # Grib data has only one level coordinate | ||
| cname = ( | ||
| cname | ||
| if cname | ||
| in ("valid_time", "time", "step", "latitude", "longitude") | ||
| else "level" | ||
| ) | ||
| cname = "level" if cname in ECCODES_VERTICAL_LEVEL_LIST else cname | ||
|
||
|
|
||
| if all([dim_name in dim_idx for dim_name in cvar.dims]): | ||
| coord_index = tuple([dim_idx[dim_name] for dim_name in cvar.dims]) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.