I'm trying to get 2D wave spectra for a region of ocean using the following query:

c.retrieve(
'reanalysis-era5-complete',{
'class': 'ea',
'date': '2003' + '-' + '02' + '-20/to/' + '2003' + '-' + '03' + '-01',
'direction': '1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19/20/21/22/23/24',
'domain': 'g',
'expver': '1',
'frequency': '1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19/20/21/22/23/24/25/26/27/28/29/30',
'number': '0/1/2/3/4/5/6/7/8/9',
'param': '251.140',
'stream': 'ewda',
'time': '00:00:00/03:00:00/06:00:00/09:00:00/12:00:00/15:00:00/18:00:00/21:00:00',
'area': str(maxLat) + '/' + str(maxLon) + '/' + str(minLat) + '/' + str(minLon), # North, West, South, East. Default: global
'grid': '0.5/0.5', # Latitude/longitude. Default: spherical harmonics or reduced Gaussian grid
'type': 'an',
'format': 'netcdf', # Output needs to be regular lat-lon, so only works in combination with 'grid'!
}, 'ISSM_Trial_ERA5_Data_NEW.nc')

I get back a 6 dimensional array that contains date, lat, lon, direction, frequency, and ensemble. I was expecting to get a single spectral density for each combination of date, lat, lon, direction and frequency. I'm not sure what the 10 ensemble values are. Do I need to do something with these 10 ensemble values to get the spectral desity? Thanks in advance for any assistance you can provide.


James

4 Comments

  1. Hi,

    here some guidelines for 2D wave spectra data:

    ERA5: data documentation - Wave spectra


    Thanks

    Michela

    1. Hi,

      I'm very sorry to disturb you,I want to ask you a question about downloading 2D wave spectra,and I want to download netcdf format,it is my script:

      # import cdsapi
      # c = cdsapi.Client()
      # c.retrieve('reanalysis-era5-complete', {
      # 'class': 'ea',
      # 'date': '2018-04-25',
      # 'direction': '1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19/20/21/22/23/24',
      # 'domain': 'g',
      # 'expver': '1',
      # 'frequency': '1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19/20/21/22/23/24/25/26/27/28/29/30',
      # 'param': '251.140',
      # 'stream': 'wave',
      # 'time': '00:00:00/01:00:00/02:00:00/03:00:00/04:00:00/05:00:00/06:00:00/07:00:00/08:00:00/09:00:00/10:00:00/11:00:00/12:00:00/13:00:00/14:00:00/15:00:00/16:00:00/17:00:00/18:00:00/19:00:00/20:00:00/21:00:00/22:00:00/23:00:00',
      # 'type': 'an',
      # 'format':'netcdf',
      # }, 'ERA-spec_20180425.nc')

      but ,when I queued for more than 10hours ,there is an error:

      The request you have submitted is not valid

      Reason: reduced_ll - not on a regular lat/lon grid or on a regular Gaussian grid. Exiting.

      So ,I want to know,If is ERA5 unable to download netcdf 2D wave spectra?if it can be downloaded,How to modify the script?

      Thanks very much!

      1. I think you need to specify a regular grid. In my case I use a half degree in latitude and longitude. Try adding the line:

        'grid': '0.5/0.5', 

        1. thanks very much,I have previously specified a grid:'1*1°‘.I try it again.