Skip to content

Commit d8f3516

Browse files
Merge pull request #360 from johntruckenbrodt/feature/ers_envisat
ERS and Envisat processing
2 parents 7093fd6 + 366b9ae commit d8f3516

File tree

6 files changed

+481
-200
lines changed

6 files changed

+481
-200
lines changed

pyroSAR/ERS/mapping.py

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,34 @@
321321

322322

323323
def get_angles_resolution(sensor, mode, swath_id, date):
324-
string_new = ''
325-
if mode == 'APP' and date > '20090528':
326-
string_new = '-new'
324+
"""
325+
Get acquisition characteristics not contained in the product metadata:
326+
327+
- near range incidence angle
328+
- far range incidence angle
329+
- range resolution
330+
- azimuth resolution
331+
- near range noise equivalent sigma zero (NESZ)
332+
- far range NESZ
333+
334+
Parameters
335+
----------
336+
sensor: {ERS1, ERS2, ASAR}
337+
the satellite sensor
338+
mode: {APP, APS, IMP, IMS, WSM}
339+
the sensor acquisition mode
340+
swath_id: {IS1, IS2, IS3, IS4, IS5, IS6, IS7, WS}
341+
the sensor swath ID
342+
date: str
343+
the acquisition date formatted as YYYYmmdd/YYYYmmddTHHMMSS
344+
345+
Returns
346+
-------
347+
tuple[float]
348+
the attributes listed above
349+
"""
350+
suffix = '-new' if mode == 'APP' and date > '20090528' else ''
327351
data = ANGLES_RESOLUTION[sensor][mode][swath_id]
328-
return (data[f'near{string_new}'], data[f'far{string_new}'],
329-
data[f'range{string_new}'], data['azimuth'],
352+
return (data[f'near{suffix}'], data[f'far{suffix}'],
353+
data[f'range{suffix}'], data['azimuth'],
330354
data['nesz_near'], data['nesz_far'])

pyroSAR/ancillary.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ def groupbyTime(images, function, time):
9797

9898
def multilook_factors(source_rg, source_az, target, geometry, incidence):
9999
"""
100-
compute multi-looking factors to approximate a square pixel with defined target ground range pixel spacing.
100+
Compute multi-looking factors. A square pixel is approximated with
101+
defined target ground range pixel spacing.
101102
102103
Parameters
103104
----------
@@ -126,15 +127,16 @@ def multilook_factors(source_rg, source_az, target, geometry, incidence):
126127
4 1
127128
"""
128129
azlks = int(round(float(target) / source_az))
129-
azlks = azlks if azlks > 0 else 1
130+
azlks = max(1, azlks)
130131
if geometry == 'SLANT_RANGE':
131132
rlks = float(azlks) * source_az * sin(radians(incidence)) / source_rg
132133
elif geometry == 'GROUND_RANGE':
133134
rlks = float(azlks) * source_az / source_rg
134135
else:
135-
raise ValueError("parameter 'geometry' must be either 'SLANT_RANGE' or 'GROUND_RANGE'")
136+
raise ValueError("parameter 'geometry' must be either "
137+
"'SLANT_RANGE' or 'GROUND_RANGE'")
136138

137-
rlks = int(round(rlks))
139+
rlks = max(1, int(round(rlks)))
138140
return rlks, azlks
139141

140142

0 commit comments

Comments
 (0)