diff --git a/.gitignore b/.gitignore index 40f482e3..0ca7c0bf 100644 --- a/.gitignore +++ b/.gitignore @@ -128,3 +128,6 @@ tests/**/*.json # Use geojson zip file for ARIA s1 frame data !isce2_topsapp/data/s1_gunw_frame_footprints.geojson.zip !isce2_topsapp/data/s1_frames_latitude_aligned.geojson.zip + +# Include Natural Earth data inside plugin +!isce2_topsapp/data/ne_10m_land.zip \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b00f57c..8b2fa829 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/) and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.3.2] + +### Changed +* We ensured that ASF is checked for orbits before ESA to improve reliability. Aims to resolve orbit download issues seen [here](https://github.com/ACCESS-Cloud-Based-InSAR/DockerizedTopsApp/issues/169) seen in large processing campaigns and possible errors associated with ESA downloading. +* We include natural earth data in the plugin to exclude hitting the natural earth server and aims to resolve such issues identified [here](https://github.com/ACCESS-Cloud-Based-InSAR/DockerizedTopsApp/issues/170) in large processing campaigns. + ## [0.3.1] ### Added diff --git a/isce2_topsapp/data/ne_10m_land.zip b/isce2_topsapp/data/ne_10m_land.zip new file mode 100644 index 00000000..265f061e Binary files /dev/null and b/isce2_topsapp/data/ne_10m_land.zip differ diff --git a/isce2_topsapp/localize_orbits.py b/isce2_topsapp/localize_orbits.py index 5a1e7e60..7d8e7228 100644 --- a/isce2_topsapp/localize_orbits.py +++ b/isce2_topsapp/localize_orbits.py @@ -29,7 +29,10 @@ def download_orbits( orbit_dir = Path(orbit_directory) orbit_dir.mkdir(exist_ok=True) - orbit_fetcher = _spoof_orbit_download if dry_run else get_orb.downloadSentinelOrbitFile + # This importantly looks at ASF first + def downloadSentinelOrbitFile_partial(scene: str, esa_credentials=None) -> tuple: + return get_orb.downloadSentinelOrbitFile(scene, esa_credentials=esa_credentials, providers=('ASF', 'ESA')) + orbit_fetcher = _spoof_orbit_download if dry_run else downloadSentinelOrbitFile_partial reference_orbits = [] for scene in reference_scenes: diff --git a/isce2_topsapp/localize_slc.py b/isce2_topsapp/localize_slc.py index ad0de520..dee6968a 100644 --- a/isce2_topsapp/localize_slc.py +++ b/isce2_topsapp/localize_slc.py @@ -1,4 +1,3 @@ -import io import netrc from concurrent.futures import ThreadPoolExecutor from functools import lru_cache @@ -7,7 +6,6 @@ import asf_search as asf import geopandas as gpd -import requests from dateparser import parse from shapely.geometry import GeometryCollection, Polygon, shape from shapely.ops import unary_union @@ -125,10 +123,8 @@ def check_track_numbers(slc_properties: list): @lru_cache(maxsize=None) def get_world_df() -> gpd.GeoDataFrame: - natural_earth_url = ('https://www.naturalearthdata.com/' - 'http//www.naturalearthdata.com/download/10m/physical/ne_10m_land.zip') - resp = requests.get(natural_earth_url, headers={"User-Agent": "XY"}) - df_world = gpd.read_file(io.BytesIO(resp.content)) + data_dir = Path(__file__).parent / 'data' + df_world = gpd.read_file(data_dir / 'ne_10m_land.zip') return df_world diff --git a/tests/solid_earth_tides.ipynb b/tests/solid_earth_tides.ipynb index 7fff3fef..d64bc242 100644 --- a/tests/solid_earth_tides.ipynb +++ b/tests/solid_earth_tides.ipynb @@ -124,7 +124,7 @@ ], "source": [ "esa_credentials = (os.environ['ESA_USERNAME'], os.environ['ESA_PASSWORD'])\n", - "orb_file, _ = get_orb.downloadSentinelOrbitFile(slc_id, esa_credentials=esa_credentials)\n", + "orb_file, _ = get_orb.downloadSentinelOrbitFile(slc_id, esa_credentials=esa_credentials, providers=('ASF', 'ESA'))\n", "orb_file" ] },