Migrate to earthkit v1.0 release candidate#162
Conversation
|
Note: we might be able to get rid of the |
|
Tested |
|
Still working on the |
Resolve conflicts: - inference_extract_requirements.py: keep branch's newer eccodes pins (eccodes>=2.44.0,<2.48.0 / eccodes-cosmo-resources-python==2.44.0.1). - plot_forecast_frame.py / plot_meteogram.py: main refactored these from marimo notebooks (.mo.py) into plain scripts with new CLI (regions_json/ stations/outdir). Took main's structure and re-applied the branch's earthkit-v1 data-model renames: step (not lead_time), valid_time (not time) for forecasts/baselines, latitude/longitude (not lat/lon) station coords, plus the grib-glob workaround for forecast frames.
|
|
jonasbhend
left a comment
There was a problem hiding this comment.
Thanks @frazane for putting this together. Looking good. I have a few comments and need to run some examples to make sure everything works. Will approve once I have checked these.
| mask = ~np.isnan(ds[_paramlist_ecmwf[0]].values.squeeze()) | ||
| global_lons = ds["longitude"].values.flatten() | ||
| if np.max(global_lons) > 180: | ||
| global_lons = ((global_lons + 180) % 360) - 180 | ||
| state["longitudes"] = np.concatenate([state["longitudes"], global_lons[mask]]) | ||
| state["latitudes"] = np.concatenate( | ||
| [state["latitudes"], ds["latitude"].values.flatten()[mask]] | ||
| ) | ||
| for param in _paramlist_ecmwf: | ||
| if param in ds: | ||
| state["fields"][PARAMS_MAP_INV[param]] = np.concatenate( | ||
| [ | ||
| state["fields"][PARAMS_MAP_INV[param]], | ||
| ds[param].values.flatten()[mask], | ||
| ] |
There was a problem hiding this comment.
If I understand correctly, this is 'expanding' the global fields to avoid seams in the plots, right? Could we maybe factor this out in a separate function to clarify what this is for?
There was a problem hiding this comment.
oh, I didn't quite catch all the lines I guess....
There was a problem hiding this comment.
This code is reproducing what the cutout operation from anemoi does: concatenates regional data with global data, where global data has a region of missing values (the mask) that is replaced by the regional data. Since this code will likely disappears in the future refactoring, would it be okay to leave it as is for now?
|
Ok the first issue I stumble upon is that we now have conflicting pins and requirements in the inference environment: (using interpolators-ich1.yaml from the branch)... I guess we need to adjust the example configs accordingly @frazane, right? |
Ah yes I didn't see this, it got into the branch during the merge with main 4a211c2. We don't need those pins anymore. |
Co-authored-by: Jonas Bhend <jonasbhend@users.noreply.github.com>
Co-authored-by: Jonas Bhend <jonasbhend@users.noreply.github.com>
Migrates evalml to the first earthkit v1.0 release candidate. This meant moving data loading off meteodata-lab and onto earthkit-data, adapting to a GRIB encoding change in the new eccodes, and aligning coordinate and dimension names with what the new stack produces. Follow up PRs will do a more thorough refactoring of the data I/O and processing code - this is only to support earthkit 1.0.
What changed
Notes