@@ -527,45 +527,15 @@ def as_dict(self):
527
527
self_as_dict [key ] = val
528
528
return self_as_dict
529
529
530
+ def _steps_to_vecs (self , range_step : float , az_step : float ):
531
+ """Convert range_step (meters) and az_step (sec) into aranges to generate LUT2ds."""
532
+ radargrid = self .as_isce3_radargrid (az_step = az_step , rg_step = range_step )
533
+ n_az , n_range = radargrid .shape
530
534
531
- def _steps_to_vecs (self , range_step , az_step ):
532
- ''' convert range_step (meters) and az_step (seconds) into aranges to
533
- generate LUT2ds
534
- '''
535
- step_errs = []
536
- if range_step <= 0 :
537
- step_errs .append ('range' )
538
- if az_step <= 0 :
539
- step_errs .append ('azimuth' )
540
- if step_errs :
541
- step_errs = ', ' .join (step_errs )
542
- err_str = f'Following step size(s) <=0: { step_errs } '
543
- raise ValueError (err_str )
544
-
545
- # container to store names of axis vectors that are invalid: i.e. size 0
546
- vec_errs = []
547
-
548
- # compute range vector
549
- n_range = np .ceil (self .width * self .range_pixel_spacing / range_step ).astype (int )
550
535
range_vec = self .starting_range + np .arange (0 , n_range ) * range_step
551
- if range_vec .size == 0 :
552
- vec_errs .append ('range' )
553
-
554
- # compute azimuth vector
555
- n_az = np .ceil (self .length * self .azimuth_time_interval / az_step ).astype (int )
556
- rdrgrid = self .as_isce3_radargrid ()
557
- az_vec = rdrgrid .sensing_start + np .arange (0 , n_az ) * az_step
558
- if az_vec .size == 0 :
559
- vec_errs .append ('azimuth' )
560
-
561
- if vec_errs :
562
- vec_errs = ', ' .join (vec_errs )
563
- err_str = f'Cannot build aranges from following step(s): { vec_errs } '
564
- raise ValueError (err_str )
565
-
536
+ az_vec = radargrid .sensing_start + np .arange (0 , n_az ) * az_step
566
537
return range_vec , az_vec
567
538
568
-
569
539
def bistatic_delay (self , range_step = 1 , az_step = 1 ):
570
540
'''Computes the bistatic delay correction in azimuth direction
571
541
due to the movement of the platform between pulse transmission and echo reception
@@ -752,8 +722,7 @@ def az_fm_rate_mismatch_mitigation(self,
752
722
range_step = None ,
753
723
az_step = None ,
754
724
threshold_rdr2geo = 1e-8 ,
755
- numiter_rdr2geo = 25 ,
756
- custom_radargrid = None ):
725
+ numiter_rdr2geo = 25 ):
757
726
'''
758
727
- Calculate Lon / Lat / Hgt in radar grid, to be used for the
759
728
actual computation of az fm mismatch rate
@@ -776,9 +745,6 @@ def az_fm_rate_mismatch_mitigation(self,
776
745
Threshold of the iteration for rdr2geo
777
746
numiter_rdr2geo: int
778
747
Maximum number of iteration for rdr2geo
779
- custom_radargrid: isce3.product.RadarGridParameters
780
- ISCE3 radar grid to define the correction grid.
781
- If None, the full resolution radargrid of the burst will be used.
782
748
783
749
Return:
784
750
-------
@@ -801,29 +767,7 @@ def az_fm_rate_mismatch_mitigation(self,
801
767
os .makedirs (path_scratch , exist_ok = True )
802
768
803
769
# define the radar grid to calculate az fm mismatch rate
804
- correction_radargrid = self .as_isce3_radargrid ()
805
- if custom_radargrid is not None :
806
- correction_radargrid = custom_radargrid
807
-
808
- # Override the radargrid definition if `rg_step` and `az_step` is defined
809
- if range_step and az_step :
810
- if custom_radargrid is not None :
811
- warnings .warn ('range_step and az_step assigned. '
812
- 'Overriding the custom radargrid definition.' )
813
-
814
- width_radargrid , length_radargrid = \
815
- [vec .size for vec in self ._steps_to_vecs (range_step , az_step )]
816
- sensing_start_radargrid = self .as_isce3_radargrid ().sensing_start
817
- correction_radargrid = isce3 .product .RadarGridParameters (
818
- sensing_start_radargrid ,
819
- self .wavelength ,
820
- 1 / az_step ,
821
- self .starting_range ,
822
- range_step ,
823
- isce3 .core .LookSide .Right ,
824
- length_radargrid ,
825
- width_radargrid ,
826
- self .as_isce3_radargrid ().ref_epoch )
770
+ correction_radargrid = self .as_isce3_radargrid (az_step = az_step , rg_step = range_step )
827
771
828
772
# Run topo on scratch directory
829
773
if not os .path .isfile (path_dem ):
0 commit comments