Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions pyroSAR/gamma/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from ..drivers import ID, identify_many
from . import ISPPar, Namespace, par2hdr
from ..ancillary import multilook_factors, hasarg, groupby, Lock
from pyroSAR.examine import ExamineSnap
from pyroSAR.examine import ExamineSnap, ExamineGamma
from .auxil import do_execute

import logging
Expand Down Expand Up @@ -336,11 +336,15 @@ def convert2gamma(id, directory, S1_tnr=True, S1_bnr=True,

product = match.group('product')

# specify noise calibration file
# L1 GRD product: thermal noise already subtracted, specify xml_noise to add back thermal noise
# SLC products: specify noise file to remove noise
# xml_noise = '-': noise file not specified
if (S1_tnr and product == 'slc') or (not S1_tnr and product == 'grd'):
# In versions released before July 2015, it was assumed that noise was already
# removed in GRDs and specifying the XML file meant adding it back to the data.
version = ExamineGamma().version
if version < '20150701':
c = (S1_tnr and product == 'slc') or (not S1_tnr and product == 'grd')
else:
c = S1_tnr

if c:
xml_noise = os.path.join(id.scene, 'annotation', 'calibration', 'noise-' + base)
else:
xml_noise = '-'
Expand Down
Loading