Skip to content

Commit

Permalink
Merge pull request #171 from ACCESS-Cloud-Based-InSAR/transient-orbit…
Browse files Browse the repository at this point in the history
…-and-ne-fixes

Check ASF orbits first and include Natural Earth Data
  • Loading branch information
cmarshak authored Feb 16, 2024
2 parents e25acd6 + 5f326e2 commit f3ff599
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file added isce2_topsapp/data/ne_10m_land.zip
Binary file not shown.
5 changes: 4 additions & 1 deletion isce2_topsapp/localize_orbits.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 2 additions & 6 deletions isce2_topsapp/localize_slc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import io
import netrc
from concurrent.futures import ThreadPoolExecutor
from functools import lru_cache
Expand All @@ -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
Expand Down Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion tests/solid_earth_tides.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
Expand Down

0 comments on commit f3ff599

Please sign in to comment.