Skip to content

Commit 00faad9

Browse files
committed
mitigate_az_fmrate_mismatch removed
1 parent a043f1b commit 00faad9

File tree

1 file changed

+26
-44
lines changed

1 file changed

+26
-44
lines changed

src/s1reader/s1_reader.py

Lines changed: 26 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,7 @@ def get_track_burst_num(track_burst_num_file: str = esa_track_burst_id_file):
472472

473473
def burst_from_xml(annotation_path: str, orbit_path: str, tiff_path: str,
474474
iw2_annotation_path: str, open_method=open,
475-
flag_apply_eap: bool=True,
476-
mitigate_az_fmrate_mismatch: bool=True):
475+
flag_apply_eap: bool=True):
477476
'''Parse bursts in Sentinel-1 annotation XML.
478477
479478
Parameters:
@@ -491,9 +490,7 @@ def burst_from_xml(annotation_path: str, orbit_path: str, tiff_path: str,
491490
Function used to open annotation file.
492491
flag_apply_eqp: bool
493492
Flag to turn on/off EAP related functionality
494-
mitigate_az_fmrate_mismatch:
495-
Turn on/off the features related to azimuth FM rate mismatch mitigation
496-
493+
497494
Returns:
498495
--------
499496
bursts : list
@@ -648,10 +645,11 @@ def burst_from_xml(annotation_path: str, orbit_path: str, tiff_path: str,
648645
azimuth_time_interval)
649646
doppler = Doppler(poly1d, lut2d)
650647

648+
sensing_duration = datetime.timedelta(
649+
seconds=n_lines * azimuth_time_interval)
651650
if len(osv_list) > 0:
652651
# get orbit from state vector list/element tree
653-
sensing_duration = datetime.timedelta(
654-
seconds=n_lines * azimuth_time_interval)
652+
655653
orbit = get_burst_orbit(sensing_start, sensing_start + sensing_duration,
656654
osv_list)
657655
else:
@@ -676,12 +674,15 @@ def burst_from_xml(annotation_path: str, orbit_path: str, tiff_path: str,
676674
burst_calibration = None
677675
else:
678676
burst_calibration = BurstCalibration.from_calibration_annotation(calibration_annotation,
679-
sensing_start)
677+
sensing_start)
680678
if noise_annotation is None:
681679
burst_noise = None
682680
else:
683-
burst_noise = BurstNoise.from_noise_annotation(noise_annotation, sensing_start,
684-
i*n_lines, (i+1)*n_lines-1, ipf_version)
681+
burst_noise = BurstNoise.from_noise_annotation(noise_annotation,
682+
sensing_start,
683+
i*n_lines,
684+
(i+1)*n_lines-1,
685+
ipf_version)
685686
if aux_cal_subswath is None:
686687
# Not applying EAP correction; (IPF high enough or user turned that off)
687688
# No need to fill in `burst_aux_cal`
@@ -692,15 +693,11 @@ def burst_from_xml(annotation_path: str, orbit_path: str, tiff_path: str,
692693
sensing_start)
693694

694695
# Extended FM and DC coefficient information
695-
if mitigate_az_fmrate_mismatch:
696-
extended_coeffs = \
697-
BurstExtendedCoeffs.from_polynomial_lists(az_fm_rate_list,
698-
doppler_list,
699-
sensing_start,
700-
sensing_start + sensing_duration)
701-
else:
702-
extended_coeffs = None
703-
696+
extended_coeffs = BurstExtendedCoeffs.from_polynomial_lists(az_fm_rate_list,
697+
doppler_list,
698+
sensing_start,
699+
sensing_start + sensing_duration)
700+
704701
bursts[i] = Sentinel1BurstSlc(ipf_version, sensing_start, radar_freq, wavelength,
705702
azimuth_steer_rate, azimuth_time_interval,
706703
slant_range_time, starting_range, iw2_mid_range,
@@ -743,8 +740,7 @@ def _is_zip_annotation_xml(path: str, id_str: str) -> bool:
743740

744741
def load_bursts(path: str, orbit_path: str, swath_num: int, pol: str = 'vv',
745742
burst_ids: list[Union[str, S1BurstId]] = None,
746-
flag_apply_eap: bool = True,
747-
mitigate_az_fmrate_mismatch = True):
743+
flag_apply_eap: bool = True):
748744
'''Find bursts in a Sentinel-1 zip file or a SAFE structured directory.
749745
750746
Parameters:
@@ -764,10 +760,7 @@ def load_bursts(path: str, orbit_path: str, swath_num: int, pol: str = 'vv',
764760
returned (empty list if none are found).
765761
flag_apply_eap: bool
766762
Turn on/off EAP related features (AUX_CAL loader)
767-
mitigate_az_fmrate_mismatch:
768-
Turn on/off the features related to azimuth FM rate mismatch mitigation
769-
770-
763+
771764
Returns:
772765
--------
773766
bursts : list
@@ -795,12 +788,10 @@ def load_bursts(path: str, orbit_path: str, swath_num: int, pol: str = 'vv',
795788
raise FileNotFoundError(f'{path} not found')
796789
elif os.path.isdir(path):
797790
bursts = _burst_from_safe_dir(path, id_str, orbit_path,
798-
flag_apply_eap,
799-
mitigate_az_fmrate_mismatch)
791+
flag_apply_eap)
800792
elif os.path.isfile(path):
801793
bursts = _burst_from_zip(path, id_str, orbit_path,
802-
flag_apply_eap,
803-
mitigate_az_fmrate_mismatch)
794+
flag_apply_eap)
804795
else:
805796
raise ValueError(f'{path} is unsupported')
806797

@@ -826,8 +817,7 @@ def load_bursts(path: str, orbit_path: str, swath_num: int, pol: str = 'vv',
826817

827818

828819
def _burst_from_zip(zip_path: str, id_str: str, orbit_path: str,
829-
flag_apply_eap: bool,
830-
mitigate_az_fmrate_mismatch: bool):
820+
flag_apply_eap: bool):
831821
'''Find bursts in a Sentinel-1 zip file.
832822
833823
Parameters:
@@ -840,10 +830,7 @@ def _burst_from_zip(zip_path: str, id_str: str, orbit_path: str,
840830
Path the orbit file.
841831
flag_apply_eap: bool
842832
Turn on/off EAP related features (AUX_CAL loader)
843-
mitigate_az_fmrate_mismatch:
844-
Turn on/off the features related to azimuth FM rate mismatch mitigation
845-
846-
833+
847834
Returns:
848835
--------
849836
bursts : list
@@ -871,13 +858,11 @@ def _burst_from_zip(zip_path: str, id_str: str, orbit_path: str,
871858
f_tiff = f'/vsizip/{zip_path}/{f_tiff[0]}' if f_tiff else ''
872859

873860
bursts = burst_from_xml(f_annotation, orbit_path, f_tiff, iw2_f_annotation, z_file.open,
874-
flag_apply_eap=flag_apply_eap,
875-
mitigate_az_fmrate_mismatch=mitigate_az_fmrate_mismatch)
861+
flag_apply_eap=flag_apply_eap)
876862
return bursts
877863

878864
def _burst_from_safe_dir(safe_dir_path: str, id_str: str, orbit_path: str,
879-
flag_apply_eap: bool,
880-
mitigate_az_fmrate_mismatch: bool):
865+
flag_apply_eap: bool):
881866
'''Find bursts in a Sentinel-1 SAFE structured directory.
882867
883868
Parameters:
@@ -890,9 +875,7 @@ def _burst_from_safe_dir(safe_dir_path: str, id_str: str, orbit_path: str,
890875
Path the orbit file.
891876
flag_apply_eap: bool
892877
Turn on/off EAP related features (AUX_CAL loader)
893-
mitigate_az_fmrate_mismatch:
894-
Turn on/off the features related to azimuth FM rate mismatch mitigation
895-
878+
896879
Returns:
897880
--------
898881
bursts : list
@@ -926,6 +909,5 @@ def _burst_from_safe_dir(safe_dir_path: str, id_str: str, orbit_path: str,
926909
f_tiff = ''
927910

928911
bursts = burst_from_xml(f_annotation, orbit_path, f_tiff, iw2_f_annotation,
929-
flag_apply_eap=flag_apply_eap,
930-
mitigate_az_fmrate_mismatch=mitigate_az_fmrate_mismatch)
912+
flag_apply_eap=flag_apply_eap)
931913
return bursts

0 commit comments

Comments
 (0)