Changeset 45b99e6 in flex_extract.git for source/python/mods/get_mars_data.py


Ignore:
Timestamp:
Feb 15, 2019, 3:48:31 PM (5 years ago)
Author:
Anne Philipp <anne.philipp@…>
Branches:
master, ctbto, dev
Children:
b9f1214
Parents:
ae2756e
Message:

added possibility to extract ensemble members with ELDA stream (and ENFO)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/python/mods/get_mars_data.py

    rd4696e0 r45b99e6  
    209209
    210210
     211def check_dates_for_nonflux_fc_times(types, times):
     212    '''
     213    '''
     214    for ty, ti in zip(types,times):
     215        if ty.upper() == 'FC' and int(ti) == 18:
     216            return True
     217    return False
     218
     219
    211220def mk_dates(c, fluxes):
    212221    '''Prepares start and end date depending on flux or non flux data.
     
    258267        start = start - timedelta(days=1)
    259268        end = end + timedelta(days=1)
     269
     270    # if we have non-flux forecast data starting at 18 UTC
     271    # we need to start retrieving data one day in advance
     272    if not fluxes and check_dates_for_nonflux_fc_times(c.type, c.time):
     273        start = start - timedelta(days=1)
    260274
    261275    return start, end, chunk
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG