Update fetchOrbit.py
parent
83f363d0c5
commit
a4cf6f5b58
|
@ -1,5 +1,7 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import re
|
import re
|
||||||
import requests
|
import requests
|
||||||
|
@ -159,8 +161,7 @@ if __name__ == '__main__':
|
||||||
timebef = (fileTS - delta).strftime(queryfmt)
|
timebef = (fileTS - delta).strftime(queryfmt)
|
||||||
timeaft = (fileTS + delta).strftime(queryfmt)
|
timeaft = (fileTS + delta).strftime(queryfmt)
|
||||||
url = server + spec[1] + str(fileTS.year).zfill(2) + '/' + str(fileTS.month).zfill(2) + \
|
url = server + spec[1] + str(fileTS.year).zfill(2) + '/' + str(fileTS.month).zfill(2) + \
|
||||||
'/' + str(fileTS.day).zfill(2) + '/' + '?validity_start={0}..{1}&sentinel1__mission={2}'.\
|
'/' + str(fileTS.day).zfill(2) +'/'
|
||||||
format(timebef, timeaft,satName)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -173,7 +174,14 @@ if __name__ == '__main__':
|
||||||
parser = MyHTMLParser(satName, url)
|
parser = MyHTMLParser(satName, url)
|
||||||
parser.feed(r.text)
|
parser.feed(r.text)
|
||||||
for resulturl, result in parser.fileList:
|
for resulturl, result in parser.fileList:
|
||||||
|
if oType == 'precise':
|
||||||
match = os.path.join(resulturl, result)
|
match = os.path.join(resulturl, result)
|
||||||
|
elif oType == "restituted":
|
||||||
|
tbef, taft, mission = fileToRange(os.path.basename(result))
|
||||||
|
if (tbef <= fileTSStart) and (taft >= fileTS):
|
||||||
|
datestr2 = FileToTimeStamp(result)[0].strftime(queryfmt2)
|
||||||
|
match = url + result
|
||||||
|
|
||||||
if match is not None:
|
if match is not None:
|
||||||
success = True
|
success = True
|
||||||
except:
|
except:
|
||||||
|
|
Loading…
Reference in New Issue