Ejemplo n.º 1
0
 def radar_modes(self):
     radar_modes = RadarModes()
     radar_mode_flag_list = np.unique(self.waveform.radar_mode)
     radar_mode_list = []
     for radar_mode_flag in radar_mode_flag_list:
         radar_mode_list.append(radar_modes.name(radar_mode_flag))
     return ";".join(radar_mode_list)
Ejemplo n.º 2
0
    def update_waveform_statistics(self):
        """ Compute waveform metadata attributes """

        # waveform property infos (lrm, sar, sarin)
        radar_modes = RadarModes()
        radar_mode = self.waveform.radar_mode

        # Check if radar mode is none
        # (e.g. if only header information is parsed at this stage)
        if radar_mode is None:
            return

        # Compute the percentage of each radar mode in the l1b object
        nrecs_fl = float(self.n_records)
        for flag in range(radar_modes.num):
            is_this_radar_mode = np.where(radar_mode == flag)[0]
            radar_mode_percent = 100.*float(len(is_this_radar_mode))/nrecs_fl
            attribute_name = "%s_mode_percent" % radar_modes.name(flag)
            self.info.set_attribute(attribute_name, radar_mode_percent)