@juanchossn just documenting the issue we discussed yesterday.
When running the latest dev branch on the sample TriOS dataset I can select the ECMWF model in L1B without errors. However, when I select the pySAS sample dataset with ECMWF I get:
File "/Users/daurin/GitRepos/HyperCP/Source/ProcessL1b.py", line 696, in processL1b
modRoot = GetAnc_ecmwf.getAnc_ecmwf(ancGroup)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/daurin/GitRepos/HyperCP/Source/GetAnc_ecmwf.py", line 203, in getAnc_ecmwf
ancillary = GetAnc_ecmwf.get_ancillary_main(lat[index], lon[index], lat_timeStamp, ancPath)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/daurin/GitRepos/HyperCP/Source/GetAnc_ecmwf.py", line 153, in get_ancillary_main
latEff, lonEff, latLonTag, dateTagEff, timeStampEff = GetAnc_ecmwf.ECMWF_latLonTimeTags(lat, lon, timeStamp, latRes, lonRes, timeResHours)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/daurin/GitRepos/HyperCP/Source/GetAnc_ecmwf.py", line 53, in ECMWF_latLonTimeTags
epoch_time = datetime.datetime.strptime(':'.join(timeStamp.split(':')[:-2]), '%Y-%m-%dT%H:%M:%S').timestamp()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/daurin/miniforge3/envs/hypercp/lib/python3.11/_strptime.py", line 567, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/daurin/miniforge3/envs/hypercp/lib/python3.11/_strptime.py", line 349, in _strptime
raise ValueError("time data %r does not match format %r" %
ValueError: time data '2022-07-19T08' does not match format '%Y-%m-%dT%H:%M:%S'
Where the variable timeStamp is:
'2022-07-19T08:00:08'
When running the TriOS sample data, the variable timeStamp is:
'2022-07-19T08:00:10:00:00'
@juanchossn just documenting the issue we discussed yesterday.
When running the latest dev branch on the sample TriOS dataset I can select the ECMWF model in L1B without errors. However, when I select the pySAS sample dataset with ECMWF I get:
File "/Users/daurin/GitRepos/HyperCP/Source/ProcessL1b.py", line 696, in processL1b
modRoot = GetAnc_ecmwf.getAnc_ecmwf(ancGroup)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/daurin/GitRepos/HyperCP/Source/GetAnc_ecmwf.py", line 203, in getAnc_ecmwf
ancillary = GetAnc_ecmwf.get_ancillary_main(lat[index], lon[index], lat_timeStamp, ancPath)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/daurin/GitRepos/HyperCP/Source/GetAnc_ecmwf.py", line 153, in get_ancillary_main
latEff, lonEff, latLonTag, dateTagEff, timeStampEff = GetAnc_ecmwf.ECMWF_latLonTimeTags(lat, lon, timeStamp, latRes, lonRes, timeResHours)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/daurin/GitRepos/HyperCP/Source/GetAnc_ecmwf.py", line 53, in ECMWF_latLonTimeTags
epoch_time = datetime.datetime.strptime(':'.join(timeStamp.split(':')[:-2]), '%Y-%m-%dT%H:%M:%S').timestamp()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/daurin/miniforge3/envs/hypercp/lib/python3.11/_strptime.py", line 567, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/daurin/miniforge3/envs/hypercp/lib/python3.11/_strptime.py", line 349, in _strptime
raise ValueError("time data %r does not match format %r" %
ValueError: time data '2022-07-19T08' does not match format '%Y-%m-%dT%H:%M:%S'
Where the variable timeStamp is:
'2022-07-19T08:00:08'
When running the TriOS sample data, the variable timeStamp is:
'2022-07-19T08:00:10:00:00'