From e6473aa79bd7f523064947ca8afae00036ed83a3 Mon Sep 17 00:00:00 2001 From: Andrew Player Date: Thu, 8 Aug 2024 14:35:43 -0500 Subject: [PATCH] swtiched from get_orb to s1_orbits --- hyp3_gamma/insar/ifm_sentinel.py | 6 +++--- hyp3_gamma/rtc/rtc_sentinel.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hyp3_gamma/insar/ifm_sentinel.py b/hyp3_gamma/insar/ifm_sentinel.py index 3e964902..57cd216b 100755 --- a/hyp3_gamma/insar/ifm_sentinel.py +++ b/hyp3_gamma/insar/ifm_sentinel.py @@ -15,11 +15,11 @@ from hyp3lib.SLC_copy_S1_fullSW import SLC_copy_S1_fullSW from hyp3lib.execute import execute from hyp3lib.getParameter import getParameter -from hyp3lib.get_orb import downloadSentinelOrbitFile from hyp3lib.makeAsfBrowse import makeAsfBrowse from hyp3lib.par_s1_slc_single import par_s1_slc_single from hyp3lib.system import gamma_version from lxml import etree, objectify +from s1_orbits import fetch_for_scene import hyp3_gamma from hyp3_gamma.insar.getDemFileGamma import get_dem_file_gamma @@ -363,8 +363,8 @@ def insar_sentinel_gamma(reference_file, secondary_file, rlooks=20, alooks=4, in orbit_files = [] for granule in (reference_file, secondary_file): log.info(f'Downloading orbit file for {granule}') - orbit_file, provider = downloadSentinelOrbitFile(granule, esa_credentials=esa_credentials) - log.info(f'Got orbit file {orbit_file} from provider {provider}') + orbit_file = str(fetch_for_scene(granule)) + log.info(f'Got orbit file {orbit_file} from s1_orbits') par_s1_slc_single(granule, pol, os.path.abspath(orbit_file)) orbit_files.append(orbit_file) diff --git a/hyp3_gamma/rtc/rtc_sentinel.py b/hyp3_gamma/rtc/rtc_sentinel.py index 9d0f4eb7..eec32db4 100755 --- a/hyp3_gamma/rtc/rtc_sentinel.py +++ b/hyp3_gamma/rtc/rtc_sentinel.py @@ -20,13 +20,13 @@ from hyp3lib.createAmp import createAmp from hyp3lib.execute import execute from hyp3lib.getParameter import getParameter -from hyp3lib.get_orb import downloadSentinelOrbitFile from hyp3lib.makeAsfBrowse import makeAsfBrowse from hyp3lib.make_cogs import cogify_dir from hyp3lib.raster_boundary2shape import raster_boundary2shape from hyp3lib.rtc2color import rtc2color from hyp3lib.system import gamma_version from osgeo import gdal, gdalconst, ogr +from s1_orbits import fetch_for_scene, OrbitNotFoundError import hyp3_gamma from hyp3_gamma.dem import get_geometry_from_kml, prepare_dem_geotiff @@ -316,9 +316,9 @@ def rtc_sentinel_gamma(safe_dir: str, resolution: float = 30.0, radiometry: str try: log.info(f'Downloading orbit file for {granule}') - orbit_file, provider = downloadSentinelOrbitFile(granule, esa_credentials=esa_credentials) - log.info(f'Got orbit file {orbit_file} from provider {provider}') - except OrbitDownloadError as e: + orbit_file = str(fetch_for_scene(granule)) + log.info(f'Got orbit file {orbit_file} from s1-orbits.') + except OrbitNotFoundError as e: log.warning(e) log.warning(f'Proceeding using original predicted orbit data included with {granule}') orbit_file = None