Beispiel #1
0
    def get_mds_parser(self):

        self.timestamp = Struct("utc_timestamp", SBInt32("day"),
                                UBInt32("sec"), UBInt32("msec"))

        self.time_orbit = Struct(
            "time_orbit", self.timestamp, SBInt8("quality_indicator"),
            Padding(3), MicroDeg(SBInt32("latitude")),
            MicroDeg(SBInt32("longitude")), UBInt32("source_packet_counter"),
            UBInt32("instrument_mode_id"),
            BitStruct("measurement_confidence_data", Array(32, Bit("flag"))),
            MilliMeter(UBInt32("altitude")),
            Array(20, MilliMeter(SBInt16("18hz_altitude_differences"))),
            MilliMeter(SBInt16("instantaneous_altitude_rate")), Padding(50))

        self.range_information = Struct(
            "range_information",
            Array(20, MilliMeter(UBInt32("18hz_tracker_range_no_doppler_ku"))),
            Array(20, MilliMeter(UBInt32("18hz_tracker_range_no_doppler_s"))),
            UBInt32("map_valid_points_tracker_ku"), Padding(4),
            MilliMeter(UBInt32("ocean_range_ku")),
            MilliMeter(UBInt32("band_ocean_range_s")),
            Array(20, MilliMeter(UBInt32("18hz_ocean_range_ku"))),
            Array(20, MilliMeter(UBInt32("18hz_ocean_range_s"))),
            MilliMeter(UBInt16("sd_18hz_ocean_range_ku")),
            MilliMeter(UBInt16("sd_18hz_ocean_range_s")),
            UBInt16("18hz_n_valid_ocean_ku"), UBInt16("18hz_n_valid_ocean_s"),
            BitStruct("18hz_valid_points_ocean_ku", Array(32, Bit("flag"))),
            BitStruct("18hz_valid_points_ocean_s", Array(32, Bit("flag"))),
            Array(20, MilliMeter(UBInt32("18Hz_ice1_range_ku"))),
            Array(20, MilliMeter(UBInt32("18Hz_ice1_range_s"))),
            Array(20, MilliMeter(UBInt32("18Hz_ice2_range_ku"))),
            Array(20, MilliMeter(UBInt32("18Hz_ice2_range_s"))),
            Array(20, MilliMeter(UBInt32("18Hz_sea_ice_range_ku"))),
            Array(20, TenMicroDeg(SBInt16("18hz_latitude_differences"))),
            Array(20, TenMicroDeg(SBInt16("18hz_longitude_differences"))))

        self.range_correction = Struct(
            "range_correction",
            Array(20, MilliMeter(SBInt16("18Hz_ku_range_instrumental"))),
            Array(20, MilliMeter(SBInt16("18Hz_s_range_instrumental"))),
            Array(20, MilliMeter(SBInt16("18Hz_ku_range_doppler"))),
            Array(20, MilliMeter(SBInt16("18Hz_s_range_doppler"))),
            Array(20, MilliMeter(SBInt16("18Hz_ku_range_doppler_slope"))),
            Array(20, MilliMeter(SBInt16("18Hz_s_range_doppler_slope"))),
            MilliMeter(SBInt16("dry_troposphere")),
            MilliMeter(SBInt16("inverse_barometric")),
            MilliMeter(SBInt16("wet_troposphere_model")),
            MilliMeter(SBInt16("wet_troposphere_mwr")),
            MilliMeter(SBInt16("ra2_ionosphere_ku")),
            MilliMeter(SBInt16("ra2_ionosphere_s")),
            MilliMeter(SBInt16("doris_ionosphere_ku")),
            MilliMeter(SBInt16("doris_ionosphere_s")),
            MilliMeter(SBInt16("model_ionosphere_ku")),
            MilliMeter(SBInt16("model_ionosphere_s")),
            MilliMeter(SBInt16("sea_state_bias_ku")),
            MilliMeter(SBInt16("sea_state_bias_s")),
            MilliMeter(SBInt16("dib_hf")), Padding(10))

        self.significant_wave_height = Struct(
            "significant_wave_height", MilliMeter(SBInt32("swh_square_ku")),
            MilliMeter(SBInt32("swh_square_s")), MilliMeter(SBInt16("swh_ku")),
            MilliMeter(SBInt16("swh_s")),
            MilliMeter(SBInt16("swh_sd_18hz_ku")),
            MilliMeter(SBInt16("swh_sd_18hz_s")),
            UBInt16("shw_18hz_n_valid_ku"), UBInt16("shw_18hz_n_valid_s"),
            BitStruct("slope_model_present", Array(32, Bit("flag"))),
            Centimeter(SBInt32("1hz_elevation_echo_point")),
            Array(20, Centimeter(SBInt16("18hz_elevation_difference"))),
            Array(20, TenMicroDeg(SBInt16("18hz_slope_latitude_diff"))),
            Array(20, TenMicroDeg(SBInt16("18hz_slope_longitude_diff"))),
            Array(20, MilliMeter(SBInt16("18hz_ice2_leading_edge_width_ku"))),
            Array(20, MilliMeter(SBInt16("18hz_ice2_leading_edge_width_s"))),
            Padding(40))

        self.backscatter = Struct(
            "backscatter",
            Array(20, OneHundredthDecibel(SBInt16("18hz_ku_k_cal_ku"))),
            Array(20, OneHundredthDecibel(SBInt16("18hz_s_k_cal_s"))),
            BitStruct("map_valid_k_cal_ku", Array(32, Bit("flag"))),
            Padding(4), OneHundredthDecibel(SBInt16("ocean_sigma_corr_ku")),
            OneHundredthDecibel(SBInt16("ocean_sigma_corr_s")),
            OneHundredthDecibel(SBInt16("sd_18hz_ocean_sigma_ku")),
            OneHundredthDecibel(SBInt16("sd_18hz_ocean_sigma_s")),
            UBInt16("n_valid_18hz_ocean_sigma_ku"),
            UBInt16("n_valid_18hz_ocean_sigma_s"),
            Array(20, OneHundredthDecibel(SBInt16("18hz_ice1_sigma_ku"))),
            Array(20, OneHundredthDecibel(SBInt16("18hz_ice1_sigma_s"))),
            Array(20, OneHundredthDecibel(SBInt16("18hz_ice2_le_sigma_ku"))),
            Array(20, OneHundredthDecibel(SBInt16("18hz_ice2_le_sigma_s"))),
            Array(20, OneHundredthDecibel(SBInt16("18hz_ice2_sigma_ku"))),
            Array(20, OneHundredthDecibel(SBInt16("18hz_ice2_sigma_s"))),
            Array(20, OneHundredthDecibel(SBInt16("18hz_sea_ice_sigma_ku"))),
            Padding(40))

        self.backscatter_correction = Struct(
            "backscatter_correction",
            OneHundredthDecibel(SBInt16("agc_net_instrumental_ku")),
            OneHundredthDecibel(SBInt16("agc_net_instrumental_s")),
            OneHundredthDecibel(SBInt16("atmospheric_attenuation_ku")),
            OneHundredthDecibel(SBInt16("atmospheric_attenuation_s")),
            OneHundredthDecibel(SBInt32("rain_attenuation_ku")))

        self.off_nadir_information = Struct(
            "off_nadir_angle",
            TenThousands(SBInt16("square_angle_from_platform_data")),
            TenThousands(SBInt16("square_angle_from_waveform_data")),
            Array(20, SBInt32("slope_ice2_first_trailing_edge_ku")),
            Array(20, SBInt32("slope_ice2_first_trailing_edge_s")),
            Array(20, SBInt32("slope_ice2_second_trailing_edge_ku")),
            Array(20, SBInt32("slope_ice2_second_trailing_edge_s")),
            Padding(40))

        self.geophysical_information = Struct(
            "geophysical_information",
            MilliMeter(SBInt32("mean_sea_surface_height")),
            MilliMeter(SBInt32("geoid_height")),
            MilliMeter(SBInt32("ocean_depth_land_elevation")),
            MilliMeter(SBInt16("total_geocentric_ocean_tide_1")),
            MilliMeter(SBInt16("total_geocentric_ocean_tide_2")),
            MilliMeter(SBInt16("ocean_tide_long_period")),
            MilliMeter(SBInt16("ocean_loading_tide_2")),
            MilliMeter(SBInt16("solid_earth_tide")),
            MilliMeter(SBInt16("geocentric_polar_tide")),
            TenPascal(SBInt16("model_surface_atmospheric_pressure")),
            OneHundredth(SBInt16("mwr_water_vapour_content")),
            OneHundredth(SBInt16("mwr_liquid_water_content")),
            OneTenths(SBInt16("ra2_total_electron_content")),
            MilliMeter(SBInt16("ra2_wind_speed")),
            MilliMeter(SBInt16("model_wind_vector_u")),
            MilliMeter(SBInt16("model_wind_vector_v")),
            MilliMeter(SBInt16("ocean_loading_tide_1")), Padding(8))

        self.mwr_information = Struct(
            "mwr_information",
            OneHundredth(SBInt16("mwr_brightness_temp_23_8ghz")),
            OneHundredth(SBInt16("mwr_brightness_temp_36_5ghz")),
            OneHundredth(SBInt16("mwr_sd_brightness_temp_23_8ghz")),
            OneHundredth(SBInt16("mwr_sd_brightness_temp_36_5ghz")),
            Padding(2))

        self.flags = Struct(
            "flag", UBInt16("average_ku_chirp_band"),
            BitStruct("ku_chirp_band_id", Array(64, Bit("flag"))),
            BitStruct("error_chirp_band_id", Array(32, Bit("flag"))),
            BitStruct("instrument", Array(32, Bit("flag"))),
            BitStruct("fault_identifier", Array(64, Bit("flag"))), Padding(8),
            BitStruct("waveform_fault_identifier", Array(64, Bit("flag"))),
            BitStruct("instrument_mode_id", Array(96, Bit("flag"))),
            UBInt16("n_measures_flight_calibration_s"),
            UBInt16("n_measures_flight_calibration_ku"),
            BitStruct("mwr_instrument_quality", Array(16, Bit("flag"))),
            Padding(6), Padding(8), Padding(8),
            BitStruct("ocean_retracking_quality_ku", Array(32, Bit("flag"))),
            BitStruct("ocean_retracking_quality_s", Array(32, Bit("flag"))),
            BitStruct("ice1_retracking_quality_ku", Array(32, Bit("flag"))),
            BitStruct("ice1_retracking_quality_s", Array(32, Bit("flag"))),
            BitStruct("ice2_retracking_quality_ku", Array(32, Bit("flag"))),
            BitStruct("ice2_retracking_quality_s", Array(32, Bit("flag"))),
            BitStruct("sea_ice_retracking_quality_ku", Array(32, Bit("flag"))),
            OneThousands(UBInt16("1hz_pulse_peakiness_ku")),
            OneThousands(UBInt16("1hz_pulse_peakiness_s")),
            UBInt16("altimeter_surface_type"),
            UBInt16("radiometer_land_ocean"),
            UBInt16("mwr_quality_interpolation"), UBInt16("altimeter_rain"),
            UBInt16("interpolation"), UBInt8("sea_ice"),
            BitStruct("membership_01", Array(8, Bit("flag"))),
            BitStruct("membership_02", Array(8, Bit("flag"))),
            BitStruct("membership_03", Array(8, Bit("flag"))),
            BitStruct("membership_04", Array(8, Bit("flag"))), Padding(1))

        self.mds_record = Struct("mds_record", self.time_orbit,
                                 self.range_information, self.range_correction,
                                 self.significant_wave_height,
                                 self.backscatter, self.backscatter_correction,
                                 self.off_nadir_information,
                                 self.geophysical_information,
                                 self.mwr_information, self.flags)

        self.mds = Array(self.n_records, self.mds_record)

        return self.mds
Beispiel #2
0
    def get_mds_parser(self):

        self.timestamp = Struct("utc_timestamp", SBInt32("day"),
                                UBInt32("sec"), UBInt32("msec"))

        self.time_orbit = Struct(
            "time_orbit", self.timestamp, SBInt8("quality_indicator"),
            Padding(3), MicroDeg(SBInt32("latitude")),
            MicroDeg(SBInt32("longitude")), UBInt32("source_packet_counter"),
            UBInt32("instrument_mode_id"),
            BitStruct("measurement_confidence_data", Array(32, Bit("flag"))),
            MilliMeter(UBInt32("altitude")),
            Array(20, MilliMeter(SBInt16("18hz_altitude_differences"))),
            MilliMeter(SBInt16("instantaneous_altitude_rate")), Padding(50))

        self.range_information = Struct(
            "range_information",
            Array(20, MilliMeter(UBInt32("18hz_tracker_range_no_doppler_ku"))),
            Padding(80), UBInt32("map_valid_points_tracker_ku"), Padding(4),
            MilliMeter(UBInt32("ocean_range_ku")), Padding(580),
            Array(20, TenMicroDeg(SBInt16("18hz_latitude_differences"))),
            Array(20, TenMicroDeg(SBInt16("18hz_longitude_differences"))))

        self.range_correction = Struct(
            "range_correction",
            Array(20, MilliMeter(SBInt16("18Hz_ku_range_instrumental"))),
            Padding(40), Array(20,
                               MilliMeter(SBInt16("18Hz_ku_range_doppler"))),
            Padding(40),
            Array(20, MilliMeter(SBInt16("18Hz_ku_range_doppler_slope"))),
            Padding(40), MilliMeter(SBInt16("dry_troposphere")),
            MilliMeter(SBInt16("inverse_barometric")),
            MilliMeter(SBInt16("wet_troposphere_model")),
            MilliMeter(SBInt16("wet_troposphere_mwr")),
            MilliMeter(SBInt16("ra2_ionosphere_ku")), Padding(2),
            MilliMeter(SBInt16("doris_ionosphere_ku")), Padding(2),
            MilliMeter(SBInt16("model_ionosphere_ku")), Padding(2),
            MilliMeter(SBInt16("sea_state_bias_ku")), Padding(2),
            MilliMeter(SBInt16("dib_hf")), Padding(10))

        self.significant_wave_height = Padding(268)

        self.backscatter = Struct(
            "backscatter", Padding(340),
            Array(20, OneHundredthDecibel(SBInt16("18hz_sea_ice_sigma_ku"))),
            Padding(40))

        self.backscatter_correction = Padding(12)

        self.off_nadir_information = Padding(364)

        self.geophysical_information = Struct(
            "geophysical_information",
            MilliMeter(SBInt32("mean_sea_surface_height")),
            MilliMeter(SBInt32("geoid_height")),
            MilliMeter(SBInt32("ocean_depth_land_elevation")),
            MilliMeter(SBInt16("total_geocentric_ocean_tide_1")),
            MilliMeter(SBInt16("total_geocentric_ocean_tide_2")),
            MilliMeter(SBInt16("ocean_tide_long_period")),
            MilliMeter(SBInt16("ocean_loading_tide_2")),
            MilliMeter(SBInt16("solid_earth_tide")),
            MilliMeter(SBInt16("geocentric_polar_tide")),
            TenPascal(SBInt16("model_surface_atmospheric_pressure")),
            OneHundredth(SBInt16("mwr_water_vapour_content")),
            OneHundredth(SBInt16("mwr_liquid_water_content")),
            OneTenths(SBInt16("ra2_total_electron_content")),
            MilliMeter(SBInt16("ra2_wind_speed")),
            MilliMeter(SBInt16("model_wind_vector_u")),
            MilliMeter(SBInt16("model_wind_vector_v")),
            MilliMeter(SBInt16("ocean_loading_tide_1")), Padding(8))

        self.mwr_information = Padding(10)

        self.flags = Struct("flag", UBInt16("average_ku_chirp_band"),
                            Padding(112), UBInt16("altimeter_surface_type"),
                            UBInt16("radiometer_land_ocean"), Padding(6),
                            UBInt8("sea_ice"), Padding(5))

        self.mds_record = Struct("mds_record", self.time_orbit,
                                 self.range_information, self.range_correction,
                                 self.significant_wave_height,
                                 self.backscatter, self.backscatter_correction,
                                 self.off_nadir_information,
                                 self.geophysical_information,
                                 self.mwr_information, self.flags)

        self.mds = Array(self.n_records, self.mds_record)

        return self.mds
Beispiel #3
0
    def get_mds_parser(self):

        self.mdsr_timestamp = Struct(
            "tai_timestamp",
            SBInt32("day"),
            UBInt32("sec"),
            UBInt32("msec"))

        self.time_orbit_group = Struct(
            "time_orbit",
            self.mdsr_timestamp,
            UBInt16("uso_corr"),
            UBInt32("mode_id"),
            UBInt16("source_sequence_counter"),
            UBInt32("instrument_configuration"),
            UBInt32("burst_counter"),
            OneTenthMicroDeg(SBInt32("latitude")),
            OneTenthMicroDeg(SBInt32("longitude")),
            MilliMeter(SBInt32("altitude")),
            MilliMeter(SBInt32("altitude_rate")),
            Array(3, MilliMeter(SBInt32("satellite_velocity"))),
            Array(3, Micrometer(SBInt32("real_beam"))),
            Array(3, Micrometer(SBInt32("interferometry_baseline"))),
            UBInt16("star_tracker_usage"),
            OneTenthMicroDeg(SBInt32("antenna_roll")),
            OneTenthMicroDeg(SBInt32("antenna_pitch")),
            OneTenthMicroDeg(SBInt32("antenna_yaw")),
            UBInt32("fbr_confidence_flag"),
            Padding(4))

        self.measurement_group = Struct(
            "measurement",
            PicoSecond(SBInt64("window_delay")),
            SBInt32("h0"),
            SBInt32("cor2"),
            SBInt32("lai"),
            SBInt32("fai"),
            OneHundredthDecibel(SBInt32("agc_1")),
            OneHundredthDecibel(SBInt32("agc_2")),
            OneHundredthDecibel(SBInt32("fixed_gain_1")),
            OneHundredthDecibel(SBInt32("fixed_gain_2")),
            MicroWatts(SBInt32("tx_power")),
            MilliMeter(SBInt32("doppler_range_correction")),
            MilliMeter(SBInt32("instrument_range_correction_txrx")),
            MilliMeter(SBInt32("instrument_range_correction_rx")),
            OneHundredthDecibel(SBInt32("instrument_gain_correction_txrx")),
            OneHundredthDecibel(SBInt32("instrument_gain_correction_rx")),
            MicroRadians(SBInt32("phase_correction_internal")),
            MicroRadians(SBInt32("phase_correction_external")),
            OneHundredthDecibel(SBInt32("noise_power")),
            MicroRadians(SBInt32("phase_slope_correction")),
            Padding(4))

        self.corrections_group = Struct(
            "corrections",
            MilliMeter(SBInt32("dry_troposphere")),
            MilliMeter(SBInt32("wet_troposphere")),
            MilliMeter(SBInt32("inverse_barometric")),
            MilliMeter(SBInt32("dynamic_atmosphere")),
            MilliMeter(SBInt32("ionospheric_gim")),
            MilliMeter(SBInt32("ionospheric_mod")),
            MilliMeter(SBInt32("ocean_tide_elastic")),
            MilliMeter(SBInt32("ocean_tide_long_period")),
            MilliMeter(SBInt32("ocean_loading_tide")),
            MilliMeter(SBInt32("solid_earth_tide")),
            MilliMeter(SBInt32("geocentric_polar_tide")),
            UBInt32("surface_type"),
            Padding(4),
            UBInt32("correction_status"),
            UBInt32("correction_error"),
            Padding(4))

#        self.onehz_waveform_group = Struct(
#            "avg_waveform",
#            self.mdsr_timestamp,
#            OneTenthMicroDeg(SBInt32("latitude")),
#            OneTenthMicroDeg(SBInt32("longitude")),
#            MilliMeter(SBInt32("altitude")),
#            PicoSecond(UBInt64("window_delay")),
#            Array(512, UBInt16("wfm")),
#            SBInt32("linear_scale"),
#            SBInt32("power_scale"),
#            UBInt16("num_avg_echoes"),
#            UBInt16("flags"))
        self.onehz_waveform_group = Padding(1068)
        # stop

#        self.waveform_flag_group = BitStruct(
#            "flag",
#            Bit("approximate_beam_steering"),
#            Bit("exact_beam_steering"),
#            Bit("doppler_weighting_computed"),
#            Bit("dopple_weighting_applied_before_stack"),
#            Bit("multi_look_incomplete"),
#            Bit("beam_angle_steering_error"),
#            Bit("anti_aliased_power_echoes"),
#            Bit("auto_beam_steering"),
#            Padding(8))

        self.waveform_flag_group = Padding(2)

        self.waveform_beam_group = Struct(
            "beam",
            OneHundredth(UBInt16("stack_standard_deviation")),
            OneHundredth(UBInt16("stack_centre")),
            OneHundredthDecibel(SBInt16("stack_scaled_amplitude")),
            OneHundredth(SBInt16("stack_skewness")),
            OneHundredth(SBInt16("stack_kurtosis")),
            MicroRadians(SBInt16("stack_standard_deviation_boresight")),
            MicroRadians(SBInt16("stack_centre_angle")),
            OneTenthMicroRadians(SBInt32("doppler_angle_start")),
            OneTenthMicroRadians(SBInt32("doppler_angle_stop")),
            OneTenthMicroRadians(SBInt32("look_angle_start")),
            OneTenthMicroRadians(SBInt32("look_angle_stop")),
            UBInt16("n_beams_after_weighing"),
            UBInt16("n_beams_before_weighing"),
            Padding(66))

#        self.waveform_group = Struct(
#            "waveform",
#            Array(1024, UBInt16("wfm")),
#            SBInt32("linear_scale"),
#            SBInt32("power_scale"),
#            UBInt16("num_avg_echoes"),
#            self.waveform_flag_group,
#            self.waveform_beam_group,
#            Array(1024, UBInt16("coherence")),
#            Array(1024, SBInt32("phase_difference")))

        self.waveform_group = Struct(
            "waveform",
            Array(1024, UBInt16("wfm")),
            SBInt32("linear_scale"),
            SBInt32("power_scale"),
            UBInt16("num_avg_echoes"),
            self.waveform_flag_group,
            self.waveform_beam_group,
            Padding(6144))

        self.mds_record = Struct(
            "mds_record",
            Array(self.n_blocks, self.time_orbit_group),
            Array(self.n_blocks, self.measurement_group),
            self.corrections_group,
            self.onehz_waveform_group,
            Array(self.n_blocks, self.waveform_group))

        self.mds = Array(self.n_records, self.mds_record)

        return self.mds