Proposed changes to the fetchOrbit.py
After running the currently modified fetchOrbits.py, I've found out that the downloaded precise orbits were based on the date that they were processed instead of the date that they can be used. I've also modified the code to prevent downloading of restituted orbit if the precise orbit is available. Pls. check if the changes I've made applies the orbit files to the Sentinel-1 SLC images properly.LT1AB
parent
e9606834c4
commit
a25f80537a
|
@ -146,7 +146,16 @@ if __name__ == '__main__':
|
||||||
for spec in orbitMap:
|
for spec in orbitMap:
|
||||||
oType = spec[0]
|
oType = spec[0]
|
||||||
|
|
||||||
url = server + spec[1] + str(fileTS.year).zfill(2) + '/' + str(fileTS.month).zfill(2) + \
|
if oType == 'precise':
|
||||||
|
queryfmt3 = "%Y-%m-%d %H:%M:%S"
|
||||||
|
dt = datetime.datetime.strptime(str(fileTS), queryfmt3)
|
||||||
|
end_date = dt + datetime.timedelta(days=20)
|
||||||
|
fileTS1 = end_date.strftime(queryfmt3)
|
||||||
|
url = server + spec[1] + str(fileTS1[0:4]) + '/' + str(fileTS1[5:7]) + \
|
||||||
|
'/' + str(fileTS1[8:10]) + '/'
|
||||||
|
|
||||||
|
elif oType == 'restituted':
|
||||||
|
url = server + spec[1] + str(fileTS.year).zfill(2) + '/' + str(fileTS.month).zfill(2) + \
|
||||||
'/' + str(fileTS.day).zfill(2) + '/'
|
'/' + str(fileTS.day).zfill(2) + '/'
|
||||||
|
|
||||||
success = False
|
success = False
|
||||||
|
@ -162,12 +171,17 @@ if __name__ == '__main__':
|
||||||
match = os.path.join(resulturl, result)
|
match = os.path.join(resulturl, result)
|
||||||
if match is not None:
|
if match is not None:
|
||||||
success = True
|
success = True
|
||||||
|
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if match is not None:
|
if success:
|
||||||
res = download_file(match, inps.outdir, session)
|
break
|
||||||
if res is False:
|
|
||||||
print('Failed to download URL: ', match)
|
if match is not None:
|
||||||
else:
|
|
||||||
print('Failed to find {1} orbits for tref {0}'.format(fileTS, satName))
|
res = download_file(match, inps.outdir, session)
|
||||||
|
if res is False:
|
||||||
|
print('Failed to download URL: ', match)
|
||||||
|
else:
|
||||||
|
print('Failed to find {1} orbits for tref {0}'.format(fileTS, satName))
|
||||||
|
|
Loading…
Reference in New Issue