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

Ability to create datasets when coordinates may not be neatly named "latitude" and "longitude" #63

Open
mariahpope opened this issue Oct 1, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@mariahpope
Copy link
Contributor

Is your feature request related to a problem? Please describe.

The class DefaultCoordinateGuesser(CoordinateGuesser) in the src/anemoi/datasets/create/functions/sources/xarray/flavour.py script currently only has the ability to work with datasets where the coordinate names are included in one of the if statements. There is an error message that the coordinate is not supported if it is not included in one of the if statements. An easy work around (in the meantime) to get this to work is to just go in an add my own if statement for whatever the name of my coordinate is (assuming it maybe is not named a neat "latitude" or "level").

Describe the solution you'd like

Some functionality to define the name of our lat, lon, level, etc. coordinate in the dataset we are loading? Or a more expansive list of if statements that include more possibilities coordinates could be named?

Overall, a way to not fail if my coordinate name is not currently included.

Describe alternatives you've considered

No response

Additional context

No response

Organisation

No response

@mariahpope mariahpope added the enhancement New feature or request label Oct 1, 2024
@b8raoult
Copy link
Collaborator

b8raoult commented Oct 3, 2024

Hi, can you try providing a dictionary as in that test:

def test_weatherbench():

@b8raoult
Copy link
Collaborator

b8raoult commented Oct 3, 2024

This is not yet documented as it is work in progress. Could you also provide a sample file or url?

@mariahpope
Copy link
Contributor Author

mariahpope commented Oct 9, 2024

Hello!

Thanks for getting back to me.

Sample file: url: "gs://noaa-ufs-gefsv13replay/ufs-hr1/0.25-degree-subsampled/03h-freq/zarr/fv3.zarr"
Dictionary of coordinates:

      flavour: {
        "rules": {
            "latitude": {"name": "grid_yt"},
            "longitude": {"name": "grid_xt"},
            "time": {"name": "time"},
            "level": {"name": "pfull"},
        },
        "levtype": "pl",
    }

I was able to create a unit test that passed with that dictionary and was also able to add it to my yaml and create a dataset. However, you will notice that there are two extra coordinates in this dataset that are actually not necessary for our purposes here, "cftime" and "ftime". A warning comes up that says those coordinates are not supported.. but things appear to keep running. If I leave those coordinates out of the dictionary in my yaml should everything still run and just drop them?

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

No branches or pull requests

2 participants