diff --git a/pygmtsar/pygmtsar/Stack_align.py b/pygmtsar/pygmtsar/Stack_align.py index 8f521f9..ca51949 100644 --- a/pygmtsar/pygmtsar/Stack_align.py +++ b/pygmtsar/pygmtsar/Stack_align.py @@ -116,7 +116,7 @@ def _align_ref_subswath(self, subswath, debug=False): #print (reference_line) # for reference scene - prefix = self.multistem_stem(subswath) + prefix = self.get_subswath_prefix(subswath) path_prefix = os.path.join(self.basedir, prefix) # generate PRM, LED, SLC @@ -156,7 +156,7 @@ def _align_rep_subswath(self, subswath, date=None, degrees=12.0/3600, debug=Fals # temporary filenames to be removed cleanup = [] - ref_prefix = self.multistem_stem(subswath) + ref_prefix = self.get_subswath_prefix(subswath) # define reference image parameters earth_radius = self.PRM(subswath=subswath).get('earth_radius') @@ -166,7 +166,7 @@ def _align_rep_subswath(self, subswath, date=None, degrees=12.0/3600, debug=Fals topo_llt = self._get_topo_llt(subswath, degrees=degrees) #topo_llt.shape - rep_prefix = self.multistem_stem(subswath, date) + rep_prefix = self.get_subswath_prefix(subswath, date) # define relative filenames for PRM rep_prm = os.path.join(self.basedir, rep_prefix + '.PRM') @@ -310,7 +310,7 @@ def baseline_table(self, n_jobs=-1, debug=False): dates = self.df[self.df.subswath==subswath].date def get_filename(date): - stem = self.multistem_stem(subswath, date) + stem = self.get_subswath_prefix(subswath, date) filename = os.path.join(self.basedir, f'{stem}.PRM') return filename diff --git a/pygmtsar/pygmtsar/Stack_base.py b/pygmtsar/pygmtsar/Stack_base.py index 7b39214..c388502 100644 --- a/pygmtsar/pygmtsar/Stack_base.py +++ b/pygmtsar/pygmtsar/Stack_base.py @@ -31,7 +31,7 @@ def to_dataframe(self): """ return self.df - def multistem_stem(self, subswath, date=None): + def get_subswath_prefix(self, subswath, date=None): """ Define stem and multistem using date """ @@ -41,10 +41,9 @@ def multistem_stem(self, subswath, date=None): if date is None: date = self.reference - assert len(date)==10, 'ERROR: multistem_stem date format is not yyyy-mm-dd' + assert len(date)==10, 'ERROR: date format is not yyyy-mm-dd' - prefix = f'{date}_F{subswath}' - return prefix + return f'{date}_F{subswath}' def set_reference(self, reference): """ diff --git a/pygmtsar/pygmtsar/Stack_prm.py b/pygmtsar/pygmtsar/Stack_prm.py index 6cf45ee..0a00bcd 100644 --- a/pygmtsar/pygmtsar/Stack_prm.py +++ b/pygmtsar/pygmtsar/Stack_prm.py @@ -39,7 +39,7 @@ def PRM(self, date=None, subswath=None): if date is None: date == self.reference - prefix = self.multistem_stem(subswath, date) + prefix = self.get_subswath_prefix(subswath, date) filename = os.path.join(self.basedir, f'{prefix}.PRM') return PRM.from_file(filename) diff --git a/pygmtsar/pygmtsar/Stack_reframe.py b/pygmtsar/pygmtsar/Stack_reframe.py index 23aa993..652c838 100644 --- a/pygmtsar/pygmtsar/Stack_reframe.py +++ b/pygmtsar/pygmtsar/Stack_reframe.py @@ -75,7 +75,7 @@ def _reframe_subswath(self, subswath, date, geometry, debug=False): df = self.get_repeat(subswath, date) if debug: print('DEBUG: reframe scenes: ', len(df)) - prefix = self.multistem_stem(subswath, date) + prefix = self.get_subswath_prefix(subswath, date) if debug: print ('DEBUG: ','prefix', prefix) diff --git a/pygmtsar/pygmtsar/Stack_reframe_gmtsar.py b/pygmtsar/pygmtsar/Stack_reframe_gmtsar.py index dee08e7..f9dd7e3 100644 --- a/pygmtsar/pygmtsar/Stack_reframe_gmtsar.py +++ b/pygmtsar/pygmtsar/Stack_reframe_gmtsar.py @@ -43,7 +43,7 @@ def _ext_orb_s1a(self, subswath, date=None, debug=False): orbit = os.path.relpath(df['orbitpath'].iloc[0], self.basedir) - prefix = self.multistem_stem(subswath, date) + prefix = self.get_subswath_prefix(subswath, date) argv = ['ext_orb_s1a', f'{prefix}.PRM', orbit, prefix] if debug: @@ -108,7 +108,7 @@ def _make_s1a_tops(self, subswath, date=None, mode=0, rshift_fromfile=None, ashi # TODO: use subswath xmlfile = os.path.relpath(df['metapath'].iloc[0], self.basedir) datafile = os.path.relpath(df['datapath'].iloc[0], self.basedir) - prefix = self.multistem_stem(subswath, date) + prefix = self.get_subswath_prefix(subswath, date) argv = ['make_s1a_tops', xmlfile, datafile, prefix, str(mode)] if rshift_fromfile is not None: @@ -173,7 +173,7 @@ def _assemble_tops(self, subswath, date, azi_1, azi_2, debug=False): else: datapaths = [os.path.relpath(path, self.basedir)[:-5] for path in df['datapath']] #print ('datapaths', datapaths) - prefix = self.multistem_stem(subswath, date) + prefix = self.get_subswath_prefix(subswath, date) # round values and convert to strings azi_1 = np.round(azi_1).astype(int).astype(str)