satpy.readers.sar_c_safe module

SAFE SAR-C reader.

This module implements a reader for Sentinel 1 SAR-C GRD (level1) SAFE format as provided by ESA. The format is comprised of a directory containing multiple files, most notably two measurement files in geotiff and a few xml files for calibration, noise and metadata.

References

class satpy.readers.sar_c_safe.AzimuthNoiseReader(root, shape)[source]

Bases: object

Class to parse and read azimuth-noise data.

The azimuth noise vector is provided as a series of blocks, each comprised of a column of data to fill the block and a start and finish column number, and a start and finish line. For example, we can see here a (fake) azimuth noise array:

[[ 1.  1.  1. nan nan nan nan nan nan nan]
 [ 1.  1.  1. nan nan nan nan nan nan nan]
 [ 2.  2.  3.  3.  3.  4.  4.  4.  4. nan]
 [ 2.  2.  3.  3.  3.  4.  4.  4.  4. nan]
 [ 2.  2.  3.  3.  3.  4.  4.  4.  4. nan]
 [ 2.  2.  5.  5.  5.  5.  6.  6.  6.  6.]
 [ 2.  2.  5.  5.  5.  5.  6.  6.  6.  6.]
 [ 2.  2.  5.  5.  5.  5.  6.  6.  6.  6.]
 [ 2.  2.  7.  7.  7.  7.  7.  8.  8.  8.]
 [ 2.  2.  7.  7.  7.  7.  7.  8.  8.  8.]]

As is shown here, the blocks may not cover the full array, and hence it has to be gap-filled with NaNs.

Set up the azimuth noise reader.

read_azimuth_noise_array(chunks=4096)[source]

Read the azimuth noise vectors.

class satpy.readers.sar_c_safe.SAFEGRD(filename, filename_info, filetype_info, calfh, noisefh, annotationfh)[source]

Bases: BaseFileHandler

Measurement file reader.

The measurement files are in geotiff format and read using rasterio. For performance reasons, the reading adapts the chunk size to match the file’s block size.

Init the grd filehandler.

property end_time

Get the end time.

get_dataset(key, info)[source]

Load a dataset.

get_gcps()[source]

Read GCP from the GDAL band.

Parameters
  • band (gdal band) – Measurement band which comes with GCP’s

  • coordinates (tuple) – A tuple with longitude and latitude arrays

Returns

Pixel and Line indices 1d arrays gcp_coords (tuple): longitude and latitude 1d arrays

Return type

points (tuple)

property start_time

Get the start time.

class satpy.readers.sar_c_safe.SAFEXML(filename, filename_info, filetype_info, header_file=None)[source]

Bases: BaseFileHandler

XML file reader for the SAFE format.

Init the xml filehandler.

property end_time

Get the end time.

get_metadata()[source]

Convert the xml metadata to dict.

property start_time

Get the start time.

class satpy.readers.sar_c_safe.SAFEXMLAnnotation(filename, filename_info, filetype_info, header_file=None)[source]

Bases: SAFEXML

XML file reader for the SAFE format, Annotation file.

Init the XML annotation reader.

get_dataset(key, info, chunks=None)[source]

Load a dataset.

class satpy.readers.sar_c_safe.SAFEXMLCalibration(filename, filename_info, filetype_info, header_file=None)[source]

Bases: SAFEXML

XML file reader for the SAFE format, Calibration file.

Init the XML calibration reader.

get_calibration_constant()[source]

Load the calibration constant.

get_dataset(key, info, chunks=None)[source]

Load a dataset.

class satpy.readers.sar_c_safe.SAFEXMLNoise(filename, filename_info, filetype_info, header_file=None)[source]

Bases: SAFEXML

XML file reader for the SAFE format, Noise file.

Init the xml filehandler.

get_dataset(key, info, chunks=None)[source]

Load a dataset.

read_legacy_noise(chunks)[source]

Read noise for legacy GRD data.

read_range_noise_array(chunks)[source]

Read the range-noise array.

class satpy.readers.sar_c_safe.XMLArray(root, list_tag, element_tag)[source]

Bases: object

A proxy for getting xml data as an array.

Set up the XML array.

expand(shape, chunks=None)[source]

Generate the full-blown array.

get_data_items()[source]

Get the data items for this array.

interpolate_xml_array(shape, chunks)[source]

Interpolate arbitrary size dataset to a full sized grid.

satpy.readers.sar_c_safe.dictify(r)[source]

Convert an ElementTree into a dict.

satpy.readers.sar_c_safe.interpolate_slice(slice_rows, slice_cols, interpolator)[source]

Interpolate the given slice of the larger array.

satpy.readers.sar_c_safe.interpolate_xarray(xpoints, ypoints, values, shape, kind='cubic', blocksize=4096)[source]

Interpolate, generating a dask array.

satpy.readers.sar_c_safe.interpolate_xarray_linear(xpoints, ypoints, values, shape, chunks=4096)[source]

Interpolate linearly, generating a dask array.

satpy.readers.sar_c_safe.intp(grid_x, grid_y, interpolator)[source]

Interpolate.