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

🐛[BUG]: prep_data_array implicitly assumes order of coords #180

Open
swbg opened this issue Jan 15, 2025 · 0 comments
Open

🐛[BUG]: prep_data_array implicitly assumes order of coords #180

swbg opened this issue Jan 15, 2025 · 0 comments
Labels
? - Needs Triage Need team to review and classify bug Something isn't working

Comments

@swbg
Copy link
Contributor

swbg commented Jan 15, 2025

Version

main

On which installation method(s) does this occur?

No response

Describe the issue

earth2studio.data.utils.prep_data_array assumes that "time", "lead_time", and "variable" dimensions occur before other dimensions (e.g., "lat", "lon", "ensemble"). This leads to inconsistent tensors/coords. Most importantly, this prevents the "ensemble" dimension from being moved around, e.g., for broadcasting.

Example:

from earth2studio.data import NCAR_ERA5, prep_data_array
from earth2studio.utils.time import to_time_array

times = to_time_array(["2023-03-24 12:00:00"])
variables = ["t2m", "tcwv"]
ncar_era5 = NCAR_ERA5()
da = ncar_era5(times, variables)
x, coords = prep_data_array(da.transpose("lat", "lon", ...))

Result:
x.shape - torch.Size([721, 1440, 1, 2])
list(coords) - ['time', 'variable', 'lat', 'lon']

@swbg swbg added ? - Needs Triage Need team to review and classify bug Something isn't working labels Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
? - Needs Triage Need team to review and classify bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant