Skip to content
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

Datasets: Build upon set_ds_frequency.py to update all necessarry attributes in .zarr #16

Open
5 tasks
mateuszmatu opened this issue Dec 17, 2024 · 1 comment
Assignees

Comments

@mateuszmatu
Copy link
Collaborator

mateuszmatu commented Dec 17, 2024

Currently, there are three things we have to change manually after creating a .zarr file with anemoi-datasets:

  • Change frequency from "1h" to 1 (already done in set_ds_frequency.py)

  • There are two places where resolution is defined in .zarr. In the first location resolution is set to "o96", whereas in the second location it is set to "null". "null" has to be changed to "o96" (or whatever the resolution is set to).

  • When creating a dataset with only one variable, e.g. the surface mask (at z=0), the variable name is set to "" in .zattrs of the .zarr file. This means that anemoi-training is not able to extract the variable, as it does not have a name. Add functionality to set_ds_frequency.py to handle this.
    For a variable named "land_binary_mask_0" the changes would look like this:
    "variables": [ "variables": [
    "" ------> "land_binary_mask_0"
    ] ]

And:
"variables_metadata": { "variables_metadata":{
"": { "land_binary_mask_0":{
"mars": { "mars":{
"date": "20240101", "date": "20240101"
"step": 0, "step": 0,
"time": "0000", ------> "time": "0000",
"valid_datetime": "2024-01-01T00:00:00", "valid_datetime": "2024-01-01T00:00:00",
"variable": "land_binary_mask" "variable": "land_binary_mask"
} }
} }
}, },

@inakbk inakbk changed the title Build upon set_ds_frequency.py to update all necessarry attributes in .zarr Datasets: Build upon set_ds_frequency.py to update all necessarry attributes in .zarr Dec 19, 2024
@mateuszmatu
Copy link
Collaborator Author

For some reason it seems that I didn't have to change variable name for "h" in "h_norkyst_2024.zarr" manually, even though there is only a single variable included here (like had to be done with the mask dataset). Strange.
A check to see if all variables are named, and then add correct names should still be added to set_ds_frequency.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants