Skip to content

Commit

Permalink
[snap.geocode] raise RuntimeError if the sensor is not S1A or S1B
Browse files Browse the repository at this point in the history
The recent workflow modifications require reading the image geometry
from the source product. Reading this attribute is currently only
supported for Sentinel-1 via the drivers.SAFE class
  • Loading branch information
johntruckenbrodt committed Feb 27, 2019
1 parent 0148c3d commit cd15dcf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyroSAR/snap/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ def geocode(infile, outdir, t_srs=4326, tr=20, polarizations='all', shapefile=No

############################################
# Multilook node configuration
if id.sensor not in ['S1A', 'S1B']:
raise RuntimeError('This function is currently limited to Sentinel-1')

ml_az = int(math.floor(tr / id.spacing[1]))
if id.meta['image_geometry'] == 'Ground Range':
ml_rg = ml_az
Expand All @@ -207,9 +210,6 @@ def geocode(infile, outdir, t_srs=4326, tr=20, polarizations='all', shapefile=No
ml_rg = int(math.floor(tr / spacing_gr))

if ml_az > 1 or ml_rg > 1:
if id.sensor not in ['S1A', 'S1B']:
raise RuntimeError('This workflow requires multilooking, '
'which is currently only supported for Sentinel-1')
insert_node(workflow, parse_node('Multilook'), after=tf.attrib['id'])
ml = workflow.find('.//node[@id="Multilook"]')
ml.find('.//parameters/sourceBands').text = bands_beta
Expand Down

0 comments on commit cd15dcf

Please sign in to comment.