예제 #1
0
 def initialise_algorithm(self, input_data: TestDataLoader) -> None:
     self.cnf = ConfigurationFile(flag_cal1_corrections_cnf=True)
     self.cst = ConstantsFile()
     self.chd = CharacterisationFile(
         self.cst,
         N_ku_pulses_burst_chd=input_data['N_ku_pulses_burst_chd'],
         N_samples_sar_chd=input_data['N_samples_sar_chd'])
     self.cal1_algorithm = CAL1Algorithm(self.chd, self.cst, self.cnf)
 def initialise_algotithm(self, input_data):
     self.cnf = ConfigurationFile(
         zp_fact_range_cnf=input_data["zp_fact_range_cnf"],
         N_looks_stack_cnf=input_data["n_looks_stack_cnf"])
     self.cst = ConstantsFile()
     self.chd = CharacterisationFile(
         self.cst, N_samples_sar_chd=input_data['n_samples_sar_chd'])
     self.range_compression_algorithm = RangeCompressionAlgorithm(
         self.chd, self.cst, self.cnf)
예제 #3
0
    def setUp(self):
        self.chd = CharacterisationFile(self.cst_file, self.chd_file)
        self.cnf = ConfigurationFile(self.cnf_file)
        self.cst = ConstantsFile(self.cst_file)

        self.writer = L1BWriter(self.chd, self.cnf, self.cst,
                                self._output_name)
        self.writer.create_all_dimensions()
        self.writer.create_all_variables()
예제 #4
0
 def initialise_algorithm(self, input_data):
     self.cnf = ConfigurationFile(
         N_looks_stack_cnf=input_data["n_looks_stack_cnf"])
     self.cst = ConstantsFile(pi_cst=input_data['pi_cst'])
     self.chd = CharacterisationFile(
         self.cst,
         N_samples_sar_chd=input_data['n_samples_sar_chd'],
         N_ku_pulses_burst_chd=input_data['n_ku_pulses_burst_chd'])
     self.stacking_algorithm = StackGatheringAlgorithm(
         self.chd, self.cst, self.cnf)
예제 #5
0
 def initialise_algorithm(self, input_data):
     self.cnf = ConfigurationFile()
     self.cst = ConstantsFile(c_cst=input_data['c_cst'],
                              pi_cst=input_data['pi_cst'])
     self.chd = CharacterisationFile(
         self.cst,
         freq_ku_chd=input_data['freq_ku_chd'],
         N_ku_pulses_burst_chd=input_data['n_ku_pulses_burst_chd'],
         prf_sar_chd=1. / input_data['pri_sar_pre_dat'])
     self.beam_angles_algorithm = BeamAnglesAlgorithm(
         self.chd, self.cst, self.cnf)
 def initilise_algorithm(self, input_data):
     self.cnf = ConfigurationFile(
         zp_fact_range_cnf=input_data["zp_fact_range_cnf"],
         N_looks_stack_cnf=input_data["n_looks_stack_cnf"],
         flag_remove_doppler_ambiguities_cnf=input_data["flag_remove_doppler_ambiguities_cnf"],
         flag_stack_masking_cnf=input_data["flag_stack_masking_cnf"]
     )
     self.cst = ConstantsFile()
     self.chd = CharacterisationFile(
         self.cst,
         N_samples_sar_chd=input_data['n_samples_sar_chd'],
         i_sample_start_chd=input_data['i_sample_start_chd']
     )
     self.stack_masking_algorithm = StackMaskingAlgorithm(self.chd, self.cst, self.cnf)
 def initialise_algorithm(self, input_data):
     self.cnf = ConfigurationFile(
         zp_fact_range_cnf=input_data['zp_fact_range_cnf'],
         flag_avoid_zeros_in_multilooking=input_data[
             'flag_avoid_zeros_in_multilooking'],
         N_looks_stack_cnf=input_data['n_looks_stack_cnf'],
         flag_antenna_weighting_cnf=
         False  # TODO: add tests for this ( will need to add field to input file )
     )
     self.cst = ConstantsFile(pi_cst=input_data['pi_cst'])
     self.chd = CharacterisationFile(
         self.cst, N_samples_sar_chd=input_data['n_samples_sar_chd'])
     self.multilooking_algorithm =\
         MultilookingAlgorithm(self.chd, self.cst, self.cnf)
 def initialise_algorithm(self, input_data):
     self.cnf = ConfigurationFile()
     self.cst = ConstantsFile(
         c_cst=input_data['c_cst'],
         pi_cst=input_data['pi_cst'],
         semi_major_axis_cst=input_data['semi_major_axis_cst'],
         flat_coeff_cst=input_data['flat_coeff_cst'],
         semi_minor_axis_cst=input_data['semi_minor_axis_cst'],
         sec_in_day_cst=60*60*24
     )
     self.chd = CharacterisationFile(
         self.cst,
         freq_ku_chd=input_data['freq_ku_chd'],
         N_ku_pulses_burst_chd=input_data['n_ku_pulses_burst_chd'],
         pri_sar_pre_dat=input_data['pri_sar_pre_dat']
     )
     self.surface_location_algorithm = SurfaceLocationAlgorithm(self.chd, self.cst, self.cnf)
예제 #9
0
 def initialise_algorithm(self, input_data):
     self.cnf = ConfigurationFile(
         zp_fact_range_cnf=input_data["zp_fact_range_cnf"])
     self.cst = ConstantsFile(
         pi_cst=input_data['pi_cst'],
         earth_radius_cst=input_data['earth_radius_cst'],
         c_cst=input_data['c_cst'])
     self.chd = CharacterisationFile(
         self.cst,
         N_ku_pulses_burst_chd=input_data['n_ku_pulses_burst_chd'],
         N_samples_sar_chd=input_data['n_samples_sar_chd'],
         wv_length_ku_chd=input_data['wv_length_ku'],
         chirp_slope_ku_chd=input_data['chirp_slope_ku'],
         pulse_length_chd=input_data['pulse_length_chd'],
         power_tx_ant_ku_chd=input_data['power_tx_ant_ku_chd'],
         antenna_gain_ku_chd=input_data['antenna_gain_ku_chd'])
     self.sigma0_algorithm =\
         Sigma0ScalingFactorAlgorithm(self.chd, self.cst, self.cnf)
 def initialize_algorithm(self, input_data):
     self.cnf = ConfigurationFile(
         N_looks_stack_cnf=input_data["n_looks_stack_cnf"],
         flag_doppler_range_correction_cnf=input_data["flag_doppler_range_correction_cnf"],
         flag_slant_range_correction_cnf=input_data["flag_slant_range_correction_cnf"]
     )
     self.cst = ConstantsFile(
         c_cst=input_data['c_cst'],
         pi_cst=input_data['pi_cst']
     )
     self.chd = CharacterisationFile(
         self.cst,
         N_samples_sar_chd=input_data['n_samples_sar_chd'],
         pulse_length_chd=input_data['pulse_length_chd'],
         bw_ku_chd=input_data['bw_ku_chd'],
         wv_length_ku_chd=input_data['wv_length_ku']
     )
     self.geometry_corrections_algorithm =\
         GeometryCorrectionsAlgorithm(self.chd, self.cst, self.cnf)
    def initialise_algorithm(self, input_data):
        """
        :param input_data: the input data

        create cst and chd objects from input_data, then initialise
        an instance of the azimuth processing algorithm
        """
        self.cnf = ConfigurationFile(
            flag_azimuth_windowing_method_cnf=AzimuthWindowingMethod.disabled,
            azimuth_window_width_cnf=64
        )
        self.cst = ConstantsFile(
            pi_cst=input_data['pi_cst']
        )
        self.chd = CharacterisationFile(
            self.cst,
            N_ku_pulses_burst_chd=input_data['n_ku_pulses_burst_chd'],
            N_samples_sar_chd=input_data['n_samples_sar_chd']
        )
        self.azimuth_processing_algorithm = AzimuthProcessingAlgorithm(self.chd, self.cst, self.cnf)
예제 #12
0
 def initialise_algorithm(self, input_data: TestDataLoader):
     self.cnf = ConfigurationFile(
         flag_surface_focusing_cnf=input_data["flag_surface_focusing_cnf"],
         surface_focusing_lat_cnf=input_data.get("surface_focusing_lat_cnf"),
         surface_focusing_lon_cnf=input_data.get("surface_focusing_lon_cnf"),
         surface_focusing_alt_cnf=input_data.get("surface_focusing_alt_cnf")
     )
     self.cst = ConstantsFile(
         c_cst=input_data['c_cst'],
         pi_cst=input_data['pi_cst'],
         semi_major_axis_cst=input_data['semi_major_axis_cst'],
         flat_coeff_cst=input_data['flat_coeff_cst'],
         semi_minor_axis_cst=input_data['semi_minor_axis_cst'],
         sec_in_day_cst=60*60*24
     )
     self.chd = CharacterisationFile(
         self.cst,
         freq_ku_chd=input_data['freq_ku_chd'],
         N_ku_pulses_burst_chd=input_data['n_ku_pulses_burst_chd'],
         pri_sar_pre_dat=input_data['pri_sar_pre_dat']
     )
     self.surface_location_algorithm = SurfaceLocationAlgorithm(self.chd, self.cst, self.cnf)
예제 #13
0
 def setUp(self):
     self.expected = TestDataLoader(self._expected_file)
     self.actual = ConfigurationFile(self._input_file)
예제 #14
0
    def __init__(self,
                 name: str,
                 cnf_file: str,
                 cst_file: str,
                 chd_file: str,
                 out_path: str,
                 skip_l1bs: bool = True):
        """
        initialise the processor
        """
        if not name:
            raise ValueError('name must be given')
        if not cnf_file:
            raise ValueError('cnf_file must be given')
        if not cst_file:
            raise ValueError('cst_file must be given')
        if not chd_file:
            raise ValueError('chd_file must be given')
        if out_path is None:
            raise ValueError('out_path must be given')

        # store conf objects
        self.cst = ConstantsFile(cst_file)
        self.chd = CharacterisationFile(self.cst, chd_file)
        self.cnf = ConfigurationFile(cnf_file)

        self.skip_l1bs = skip_l1bs
        self.out_path = out_path
        self.name = name
        self.l1a_file = None

        # init. surface & packets arrays
        self._surfaces = []
        self._packets = []
        self.surfaces_count = 0
        self.min_surfs = 64 + 16  # 16 elem. margin

        # set defaults for beam angles
        self.beam_angles_list_size_prev = -1
        self.beam_angles_trend_prev = -1

        # initialise the algorithm classes
        self.surface_locations_algorithm = \
            SurfaceLocationAlgorithm(self.chd, self.cst, self.cnf)
        self.beam_angles_algorithm = \
            BeamAnglesAlgorithm(self.chd, self.cst, self.cnf)
        self.azimuth_processing_algorithm = \
            AzimuthProcessingAlgorithm(self.chd, self.cst, self.cnf)
        self.stack_gathering_algorithm = \
            StackGatheringAlgorithm(self.chd, self.cst, self.cnf)
        self.geometry_corrections_algorithm = \
            GeometryCorrectionsAlgorithm(self.chd, self.cst, self.cnf)
        self.range_compression_algorithm = \
            RangeCompressionAlgorithm(self.chd, self.cst, self.cnf)
        self.stack_masking_algorithm = \
            StackMaskingAlgorithm(self.chd, self.cst, self.cnf)
        self.multilooking_algorithm = \
            MultilookingAlgorithm(self.chd, self.cst, self.cnf)
        self.sigma_zero_algorithm = \
            Sigma0ScalingFactorAlgorithm(self.chd, self.cst, self.cnf)

        # set threshold for gaps
        self.gap_threshold = self.chd.bri_sar * 1.5