cryoswath.l1b module

cryoswath.l1b module

It mainly contains the L1bData class, that allows to process ESA CryoSat-2 SARIn L1b data to point elevation estimate (L2 data).

cryoswath.l1b.append_exclude_mask(cs_l1b_ds: L1bData) L1bData[source]

Adds mask indicating samples below threshold.

Waveform samples that don’t fulfill power and/or coherence requirements are flagged. The thresholds have to be included in the provided dataset. By default, they are assigned on creation.

Parameters:

cs_l1b_ds (l1b_data) – Input data.

Returns:

Data including mask.

Return type:

l1b_data

cryoswath.l1b.append_poca_and_swath_idxs(cs_l1b_ds: L1bData) L1bData[source]

Adds indices for estimated POCA and begin of swath.

Parameters:

cs_l1b_ds (l1b_data) – Input data.

Returns:

Data including mask.

Return type:

l1b_data

cryoswath.l1b.append_smoothed_complex_phase(cs_l1b_ds: L1bData) L1bData[source]
cryoswath.l1b.build_flag_mask(cs_l1b_flag: DataArray, flag_val_list: list) DataArray[source]

Function returns a waveform mask based on flag values.

This function can handle two types of flags: those that take the form of a checklist with multiple allowed ticks, and those that indicate one of more possible selections.

It is designed for CryoSat-2 SARIn L1b Baseline D or E data and relies on an attribute “flag_masks” or “flag_values”. For CRISTAL or if the attributes change, this function needs an update.

Parameters:
  • cs_l1b_flag (xr.DataArray) – L1bData flag variable.

  • flag_val_list (list, optional) – List of flag values to mask.

Returns:

Mask that is True where flag matched provided list.

Return type:

xr.DataArray

cryoswath.l1b.download_files(track_idx: DatetimeIndex | str, stop_event: Event = None)[source]
cryoswath.l1b.download_single_file(track_id: str) str[source]
cryoswath.l1b.download_wrapper(region_of_interest: str | Polygon = None, start_datetime: str | Timestamp = '2010', end_datetime: str | Timestamp = '2035', *, buffer_region_by: float = None, track_idx: DatetimeIndex | str = None, stop_event: Event = None, n_threads: int = 8) int[source]

Download ESA’s L1b product.

Parameters:
  • region_of_interest (str | shapely.Polygon, optional) – Provide a RGI identifier or lon/lat polygon to subset downloaded data. Defaults to None.

  • start_datetime (str | pd.Timestamp, optional) – Defaults to “2010”.

  • end_datetime (str | pd.Timestamp, optional) – Defaults to “2035”.

  • buffer_region_by (float, optional) – Use a buffer in meter around provided region (also RGI identifier). Defaults to None.

  • track_idx (pd.DatetimeIndex | str, optional) – Download only tracks at known times. Defaults to None.

  • stop_event (Event, optional) – Define when to terminate threads. Defaults to None.

  • n_threads (int, optional) – Number of download threads. Defaults to 8.

Returns:

0 on success, 1 on graceful exit after error, and 2 on being aborted.

Return type:

int

cryoswath.l1b.drop_waveform(cs_l1b_ds, time_20_ku_mask)[source]

Use mask along time dim to drop waveforms.

Parameters:

time_20_ku_mask (1-dim bool) – Mask: drop where True.

Returns:

Input dataset without marked waveforms.

Return type:

xr.Dataset or DataArray