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

Downloading and pre-processing .grib file from cds API #49

Open
js336rice opened this issue Jul 6, 2024 · 3 comments
Open

Downloading and pre-processing .grib file from cds API #49

js336rice opened this issue Jul 6, 2024 · 3 comments

Comments

@js336rice
Copy link

js336rice commented Jul 6, 2024

Hello,

I've been attempting to download a .grib file from the CDS api. I intend to modify some of the values before feeding it into the ai-model. I was wondering if anyone had found a way to do this such that it can then be fed into the ai models? Every way I try to do this I get the following value error when I try to run fourcastnet with this file.

ValueError: operands could not be broadcast together with shapes (1,8,720,1440) (1,26,1,1)

It seems to me like there's pre-processing I need to do before feeding this file into the ai-models package, but I haven't been able to determine exactly what that is.

Does anyone know, or has anyone had success getting .grib files from CDS and then running fourcastnet or another ai model in this package on those files?

The code I'm using to obtain a grib file is as follows:

import cdsapi

c = cdsapi.Client()

c.retrieve(
'reanalysis-era5-single-levels', # Dataset name
{'date': 20230110,
'time': 0,
'param': ['10u', '10v', '2t', 'sp', 'msl', 'tcwv', '100u', '100v'],
'level': [1000, 850, 500, 250, 50],
'grid': [0.25, 0.25],
'area': [90, 0, -90, 359.75],
'product_type': 'reanalysis'
}, 'Outputv3.grib')

@sudhir2016
Copy link

I am getting the exact same error.

@sudhir2016
Copy link

I finally managed to get this command to work.
! ai-models --input cds --date 20230110 --time 0000 fourcastnet

@cqh798
Copy link

cqh798 commented Sep 29, 2024

I am getting the exact same error.

May I ask how it was resolved? I have also encountered it

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

3 participants