Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Source/Python/Classes/MarsRetrieval.py

    re3c679d rf0dedeb  
    505505            newattrs['year'] = date.year
    506506            newattrs['month'] = date.month
    507             newattrs['day'] =  date.day         
    508  
    509         # need to correct the time apperance for CDS surface field retrievals
    510         if attrs['type'] == 'FC': # for EA5 only flux fields are retrieved as FC type
    511             # need to convert fc start times 06/18 to usual AN times
    512             # since the surface fields can only be access through their validity time
    513             start, end, step = map(int,attrs['step'].split('/')[::2])
    514             newattrs['time'] = [ "{0:0=2d}".format(s) for s in range(0,24,step) ]
    515         elif '/' in attrs['time']: # we expect a list of times separated by /
    516             newattrs['time'] = attrs['time'].split('/')
    517         elif isinstance(attrs['time'], str): # we expect a single time in here
    518             newattrs['time'] = [ attrs['time'] ]
     507            newattrs['day'] =  date.day                 
    519508       
    520509        newattrs['product_type'] = 'reanalysis'
    521510        newattrs['area'] = attrs['area'].split('/')
    522511        newattrs['grid'] = list(map(float,attrs['grid'].split('/')))
    523         newattrs['param'] = attrs['param'].split('/')   
     512        newattrs['param'] = attrs['param'].split('/')       
     513        if '/' in attrs['step']:
     514            sstep = int(attrs['step'].split('/')[4])
     515            newattrs['time'] = list(map(str,range(0,24,sstep)))             
     516        elif '160.128' in attrs['param']:
     517            newattrs['time'] = attrs['time']
    524518        newattrs['format'] = 'grib'
    525519               
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG