Changeset d727af2 in flex_extract.git for source/python/mods/tools.py
- Timestamp:
- Mar 10, 2019, 4:48:16 PM (5 years ago)
- Branches:
- master, ctbto, dev
- Children:
- 90a1ca0
- Parents:
- 79729d5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/python/mods/tools.py
r79729d5 rd727af2 69 69 except ImportError: 70 70 import builtins as exceptions 71 from datetime import datetime 71 from datetime import datetime, timedelta 72 72 from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter 73 73 … … 869 869 870 870 return 871 872 873 def generate_retrieval_period_boundary(c): 874 '''Generates retrieval period boundary datetimes from CONTROL information. 875 876 Parameters 877 ---------- 878 c : ControlFile 879 Contains all the parameters of CONTROL file and 880 command line. 881 882 Return 883 ------ 884 start_period : datetime 885 The first timestamp of the actual retrieval period disregarding 886 the temporary times which were used for processing reasons. 887 888 end_period : datetime 889 The last timestamp of the actual retrieval period disregarding 890 the temporary times which were used for processing reasons. 891 ''' 892 # generate start and end timestamp of the retrieval period 893 start_period = datetime.strptime(c.start_date + c.time[0], '%Y%m%d%H') 894 start_period = start_period + timedelta(hours=int(c.step[0])) 895 end_period = datetime.strptime(c.end_date + c.time[-1], '%Y%m%d%H') 896 end_period = end_period + timedelta(hours=int(c.step[-1])) 897 898 899 return start_period, end_period
Note: See TracChangeset
for help on using the changeset viewer.