Skip to content

Commit

Permalink
call correct function when using -BURST
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewPlayer3 committed Jan 28, 2025
1 parent faa6fe9 commit 69d8cf8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
7 changes: 5 additions & 2 deletions src/hyp3_autorift/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,11 @@ def process(
platform = get_platform(reference)

if platform == 'S1':
from hyp3_autorift.s1_isce3 import process_sentinel1_with_isce3_slc
netcdf_file = process_sentinel1_with_isce3_slc(reference, secondary)
from hyp3_autorift.s1_isce3 import process_sentinel1_with_isce3_slc, process_burst_sentinel1_with_isce3
if reference.endswith('-BURST'):
netcdf_file = process_burst_sentinel1_with_isce3(reference, secondary)
else:
netcdf_file = process_sentinel1_with_isce3_slc(reference, secondary)
elif platform == 'GS1':
from hyp3_autorift.s1_isce3 import process_burst_sentinel1_with_isce3_radar
netcdf_file = process_burst_sentinel1_with_isce3_radar(reference, secondary)
Expand Down
15 changes: 8 additions & 7 deletions src/hyp3_autorift/s1_isce3.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,12 @@ def process_sentinel1_with_isce3_slc(slc_ref, slc_sec):
esa_username, esa_password = get_esa_credentials()
esa_credentials = (esa_username, esa_password)

safe_ref = download_burst(slc_ref)
safe_sec = download_burst(slc_ref)
for scene in [slc_ref, slc_sec]:
scene_url = get_download_url(scene)
download_file(scene_url, chunk_size=5242880)

safe_ref = sorted(glob.glob('./*.zip'))[0]
safe_sec = sorted(glob.glob('./*.zip'))[1]

lon1min, lat1min, lon1max, lat1max = get_bounds_dem(safe_ref)
lon2min, lat2min, lon2max, lat2max = get_bounds_dem(safe_sec)
Expand All @@ -163,11 +167,8 @@ def process_sentinel1_with_isce3_slc(slc_ref, slc_sec):
bounds = [lon_min, lat_min, lon_max, lat_max]
download_dem(bounds)

orbit_file, prov = downloadSentinelOrbitFile(slc_ref, esa_credentials=esa_credentials)
orbit_file_ref = orbit_file

orbit_file, prov = downloadSentinelOrbitFile(slc_sec, esa_credentials=esa_credentials)
orbit_file_sec = orbit_file
orbit_file_ref, _ = downloadSentinelOrbitFile(slc_ref, esa_credentials=esa_credentials)
orbit_file_sec, _ = downloadSentinelOrbitFile(slc_sec, esa_credentials=esa_credentials)

burst_ids_ref = get_burst_ids(safe_ref, orbit_file_ref)
burst_ids_sec = get_burst_ids(safe_sec, orbit_file_sec)
Expand Down

0 comments on commit 69d8cf8

Please sign in to comment.