pysiral.cryosat2.functions ========================== .. py:module:: pysiral.cryosat2.functions .. autoapi-nested-parse:: Created on Tue Jul 14 14:48:01 2015 @author: Stefan Classes ------- .. autoapisummary:: pysiral.cryosat2.functions.L1PWaveformResampleSIN pysiral.cryosat2.functions.L1PWaveformPadLRM pysiral.cryosat2.functions.L1PCryoSat2Sigma0 Functions --------- .. autoapisummary:: pysiral.cryosat2.functions.get_cryosat2_wfm_power pysiral.cryosat2.functions.get_cryosat2_wfm_range pysiral.cryosat2.functions.get_cryosat2_wfm_range_userhandbook pysiral.cryosat2.functions.get_tai_datetime_from_timestamp pysiral.cryosat2.functions.parse_cryosat_l1b_filename pysiral.cryosat2.functions.parse_cryosat_l1b_xml_header pysiral.cryosat2.functions.get_footprint_lrm pysiral.cryosat2.functions.get_footprint_sar pysiral.cryosat2.functions.cryosat2_sigma0_lrm Module Contents --------------- .. py:class:: L1PWaveformResampleSIN(**cfg) Bases: :py:obj:`pysiral.l1preproc.procitems.L1PProcItem` A post-processing class for CryoSat-2 l1p data that resamples the SIN waveform group to the same size as SAR waveform group .. py:method:: apply(l1: pysiral.l1data.Level1bData) -> None API class for the Level-1 pre-processor. Functionality is reduce the size of the waveform power and range arrays for SIN data to the one for SAR data. :param l1: A Level-1 data instance :return: None, Level-1 object is change in place .. py:class:: L1PWaveformPadLRM(**cfg) Bases: :py:obj:`pysiral.l1preproc.procitems.L1PProcItem` A post-processing class for CryoSat-2 l1p data that resamples the SIN waveform group to the same size as SAR waveform group .. py:method:: apply(l1: pysiral.l1data.Level1bData) -> None API class for the Level-1 pre-processor. Functionality is to reduce the size of the waveform power and range arrays for SIN data to the one for SAR data. :param l1: A Level-1 data instance :return: None, Level-1 object is change in place .. py:class:: L1PCryoSat2Sigma0(**cfg) Bases: :py:obj:`pysiral.l1preproc.procitems.L1PProcItem` Class to compute radar backscatter coefficient (sigma0) directly from waveform data. .. py:method:: apply(l1: pysiral.l1data.Level1bData) Compute the radar backscatter coefficient across all CryoSat-2 radar modes. This method first gets the variables needed for sigma0 computation of all radar modes and the leave the specifics to the respective sub_methods. Finally, two variables (sigma0 and peak_power) are added to the classifier container of the Level-1 data container. :param l1: The Level-1 data container :return: None, Level-1 data container is changed in place .. py:method:: _get_sigma0_sar_sin(l1: pysiral.l1data.Level1bData, sar_sin_idxs: numpy.typing.NDArray, rx_power: numpy.typing.NDArray, tx_power: numpy.typing.NDArray, rng: numpy.typing.NDArray) -> numpy.typing.NDArray Compute sigma0 for SAR/SARin :param l1: The Level-1 data container :param rx_power: :param tx_power: :return: .. py:method:: _get_sigma0_lrm(l1: pysiral.l1data.Level1bData, lrm_idxs: numpy.typing.NDArray, rx_power: numpy.typing.NDArray, tx_power: numpy.typing.NDArray, rng: numpy.typing.NDArray) -> numpy.typing.NDArray :staticmethod: Compute sigma0 for LRM :param l1: The Level-1 data container :param rx_power: :param tx_power: :return: .. py:method:: _get_orbit_velocity_from_l1(l1: pysiral.l1data.Level1bData) -> numpy.typing.NDArray :staticmethod: Computes total orbital velocity :param l1: :return: velocity .. py:function:: get_cryosat2_wfm_power(counts, linear_scale, power_scale) Converts the Cryosat-2 waveform counts into a physical unit (Watts) Applicable Documents -------------------- - CryoSat-2 User Handbook, L1B Parameters Arguments --------- counts (int list) unscaled echo waveform (typically: ``l1b.waveform.wfm``) linear_scale (int) linear scale factor (typically: ``l1b.waveform.linear_scale``) power_scale (int) power scale factor (typically: ``l1b.waveform.power_scale``) Returns ------- float list with echo power in Watts .. py:function:: get_cryosat2_wfm_range(window_delay, n_range_bins) Calculates the range value of each range bin in the waveform Applicable Documents -------------------- - CryoSat-2 User Handbook, Range Window and Window Delay Arguments --------- window_delay (float) two-way delay time in seconds from the CryoSat-2 data L1b file n_range_bins (int) Number of range bins (the length of the waveform list) Returns ------- wfm_range range value in meterfrom the satellite to each range bin in the waveform Notes ----- - It is assumed that the two way delay time (window delay) already contains instrument related range corrections - No other range corrections are applied here - The bandwidth of CryoSat-2 (320Mhz) is hard-coded here .. py:function:: get_cryosat2_wfm_range_userhandbook(window_delay, n_range_bins) .. py:function:: get_tai_datetime_from_timestamp(mdsr_timestamp) Converts the TAI MDSR timestamp into a datetime object Background ---------- The timestamp in the CryoSat-2 data files is given as days since January 1, 2000, seconds of the day and microseconds of the day. Arguments --------- mdsr_timestamp (object or object list) any class object with attributes day, sec, msec (attributes must be of type int) Return ------ datetime object with date and time in TAI .. py:function:: parse_cryosat_l1b_filename(filename) Returns the information in the CryoSat-2 l1b filename .. py:function:: parse_cryosat_l1b_xml_header(filename) Reads the XML header file of a CryoSat-2 L1b Data set and returns the contents as an OrderedDict .. py:function:: get_footprint_lrm(r: float, band_width: float = 320000000.0) -> float Compute the CryoSat-2 LRM footprint for variable range to the surface. Applicable Documents: Michele Scagliola, CryoSat Footprints ESA/Aresys, v1.2 ESA document ref: XCRY-GSEG-EOPG-TN-13-0013 :param r: range from satellite center of mass to surface reflection point (to be appoximated by satellite altitude if no retracker range available) :param band_width: CryoSat-2 pulse bandwidth in Hz :return sigma_0: Radar backscatter coefficient .. py:function:: get_footprint_sar(r: float, v_s: float, ptr_width: float = 2.819e-09, tau_b: float = 0.00352, lambda_0: float = 0.022084, wf: float = 1.0, r_mean: float = 6371000.0) -> float Compute the CryoSat-2 SAR footprint for variable range to the surface. Applicable Documents: Michele Scagliola, CryoSat Footprints ESA/Aresys, v1.2 ESA document ref: XCRY-GSEG-EOPG-TN-13-0013 :param r: range from satellite center of mass to surface reflection point (to be appoximated by satellite altitude if no retracker range available) :param r: range from satellite center of mass to surface reflection point (to be appoximated by satellite altitude if no retracker range available) :param v_s: satellite along track velocity in meter/sec :param ptr_width: 3dB range point target response temporal width in seconds (default: 2.819e-09 sec for CryoSat-2 SAR) :param tau_b: burst length in seconds (default: 0.00352 sec for CryoSat-2 SAR) :param lambda_0: radar wavelength in meter (default: 0.022084 m for CryoSat-2 Ku Band altimeter) :param wf: footprint widening factor (1.486 * rv in case of Hamming window application on burst data; rv: unspecified empirical factor) (default: 1 no weighting window application) :param r_mean: mean earth radius in meter :return area_sar: The SAR footprint in square meters .. py:function:: cryosat2_sigma0_lrm(rng: float, p_rx: float, roll_deg: float, pitch_deg: float, p_tx: float = 22.4, sigma_bias: float = 0.0) -> float Compute LRM backscatter with optional mispointing and bias correction. The code was supplied by David Brockley . :param rng: range to the surface :param p_rx: rx power :param roll_deg: :param pitch_deg: :param p_tx: tx power :param sigma_bias: sigma0 bias (default: 0.0) :raises None: :return: