ecmwf-lab / ai-models

Apache License 2.0
350 stars 50 forks source link

Download CDS data to run Pangu Weather model #53

Open sudhir2016 opened 1 month ago

sudhir2016 commented 1 month ago

I was trying to run the Pangu Weather model in Google Colab using ai-models --file .

Model help showed me I need this data

Grid: [0.25, 0.25] Area: [90, 0, -90, 360] Pressure levels: Levels: [1000, 925, 850, 700, 600, 500, 400, 300, 250, 200, 150, 100, 50] Params: ['z', 'q', 't', 'u', 'v'] Single levels: Params: ['msl', '10u', '10v', '2t']

I tried to downloaded data with this command

c = cdsapi.Client() c.retrieve( 'reanalysis-era5-single-levels', # Dataset name {'date': 20230110, 'time': 0, 'param': ['msl', '10u', '10v', '2t'], 'level': ['1000', '925', '850', '700', '600', '500', '400', '300', '250','200', '150', '100', '50'], 'param': ['z', 'q', 't', 'u', 'v'], 'grid': [0.25, 0.25], 'area': [90, 0, -90, 360], 'product_type': 'reanalysis' }, 'Output.grib')

But I got a job failed error.

I am able to download if I comment out this line

'param': ['z', 'q', 't', 'u', 'v'],

But then I get this error when I run the model ValueError: cannot reshape array of size 0 into shape (5,13,721,1440)

Please help.

sudhir2016 commented 1 month ago

I realized the mistake in my cdsapi call and I changed to c = cdsapi.Client() c.retrieve( 'reanalysis-era5-single-levels', # Dataset name {'date': 20230110, 'time': 0, 'level': ['1000', '925', '850', '700', '600', '500', '400', '300', '250','200', '150', '100', '50'], 'param': ['z', 'q', 't', 'u', 'v'], 'variable': ['msl', '10u', '10v', '2t'], 'grid': [0.25, 0.25], 'area': [90, 0, -90, 360], 'product_type': 'reanalysis' }, 'Output.grib') With this I was able to download the data but I still get this error when I run the model ValueError: cannot reshape array of size 0 into shape (5,13,721,1440)