Skip to content

Commit 6ec06e6

Browse files
committed
raise error when frequency B is given for split_main_band
1 parent 2dca198 commit 6ec06e6

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

python/packages/nisar/workflows/insar_runconfig.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,18 +209,18 @@ def yaml_check(self):
209209
err_str = f"polarzations {iono_pol} for ionosphere estimation are requested, but not found"
210210
error_channel.log(err_str)
211211
raise FileNotFoundError(err_str)
212-
212+
213213
# If common polarization found, but input polarizations are not given,
214214
# then assign the common polarization for split_main_band
215215
if (common_pol_refsec_freqA) and (not iono_freq_pol['A']):
216216
# Co-polarizations are found, split_main_band will be used for co-pols
217217
common_copol_ref_sec = [pol for pol in common_pol_refsec_freqA
218218
if pol in ['VV', 'HH']]
219-
iono_freq_pol = {'A': common_copol_ref_sec}
219+
iono_freq_pol['A'] = common_copol_ref_sec
220220

221221
# If common co-pols not found, cross-pol will be alternatively used.
222222
if not common_copol_ref_sec:
223-
iono_freq_pol = {'A': common_pol_refsec_freqA}
223+
iono_freq_pol['A'] = common_pol_refsec_freqA
224224

225225
warning_str = f"{iono_freq_pol} will be used for {iono_method}"
226226
warning_channel.log(warning_str)
@@ -245,6 +245,14 @@ def yaml_check(self):
245245
"It is automatically set by 1/3 of range bandwidth of frequencyA"
246246
warning_channel.log(info_str)
247247

248+
# If polarzations for frequency B are requested
249+
# for split_main_band method, then throw error
250+
if iono_freq_pol['B']:
251+
err_str = f"Incorrect polarzations {iono_freq_pol['B']} for frequency B are requested. "\
252+
f"{iono_method} should not have polarizations in frequency B."
253+
error_channel.log(err_str)
254+
raise FileNotFoundError(err_str)
255+
248256
# methods that use side band
249257
if iono_method in ['main_side_band', 'main_diff_main_side_band']:
250258
# extract the polarizations from reference and secondary hdf5

python/packages/nisar/workflows/split_spectrum.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ def run(cfg: dict):
104104

105105
common_parent_path = 'science/LSAR'
106106
freq = 'A'
107-
print('test', iono_freq_pol)
108107
pol_list = iono_freq_pol[freq]
109108
info_channel.log(f'Split the main band {pol_list} of the signal')
110109

python/packages/nisar/workflows/split_spectrum_runconfig.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,22 +93,33 @@ def yaml_check(self):
9393
for iono_pol in iono_freq_pol['A']:
9494
if (iono_pol not in ref_pols_freqA) or \
9595
(iono_pol not in sec_pols_freqA):
96-
err_str = f"polarzations {iono_pol} for ionosphere estimation are given, but not found"
96+
err_str = f"polarizations {iono_pol} for ionosphere estimation are given, but not found"
9797
error_channel.log(err_str)
9898
raise FileNotFoundError(err_str)
9999

100+
# If polarizations for frequency B are requested
101+
# for split_main_band method, then throw error
102+
if iono_freq_pol['B']:
103+
err_str = f"Incorrect polarzations {iono_freq_pol['B']} for frequency B are requested. "\
104+
f"{iono_method} should not have polarizations in frequency B."
105+
error_channel.log(err_str)
106+
raise FileNotFoundError(err_str)
107+
100108
# If common polarization found, but input polarizations are not given,
101109
# then assign the common polarization for split_main_band
102110
if (common_pol_refsec_freqA) and (not iono_freq_pol['A']):
103111
# Co-polarizations are found, split_main_band will be used for co-pols
104112
common_copol_ref_sec = [pol for pol in common_pol_refsec_freqA
105113
if pol in ['VV', 'HH']]
106114
iono_freq_pol['A'] = common_copol_ref_sec
115+
iono_freq_pol['B'] = None
107116

108117
# If common co-pols not found, cross-pol will be alternatively used.
109118
if not common_copol_ref_sec:
110119
iono_freq_pol['A'] = common_pol_refsec_freqA
111-
info_str = f"{iono_freq_pol} will be used for split_main_band"
120+
iono_freq_pol['B'] = None
121+
122+
info_str = f"{iono_freq_pol['A']} will be used for split_main_band"
112123
info_channel.log(info_str)
113124
self.cfg['processing'][
114125
'ionosphere_phase_correction'][

0 commit comments

Comments
 (0)