esa_cci_sm package

Submodules

esa_cci_sm.grid module

esa_cci_sm.grid.CCICellGrid()[source]
esa_cci_sm.grid.CCILandGrid()[source]

esa_cci_sm.interface module

class esa_cci_sm.interface.CCITs(ts_path, grid_path=None, **kwargs)[source]

Bases: GriddedNcOrthoMultiTs

class esa_cci_sm.interface.CCI_SM_025Ds(data_path, parameter=None, subgrid=None, array_1D=False, freq_h=24)[source]

Bases: MultiTemporalImageBase

Class for reading ESA CCI SM images in nc format.

Parameters:
  • data_path (string) – Path to the nc image files

  • parameter (string or list, optional (default: 'sm')) – One or list of parameters to read, see ESA CCI SM documentation for more information

  • array_1D (boolean, optional (default: False)) – If set then the data is read into 1D arrays. Needed for some legacy code.

tstamps_for_daterange(start_date, end_date)[source]

Return timestamps for the passed date range,

Parameters:
  • start_date (datetime) – start of date range

  • end_date (datetime) – end of date range

  • freq (int) – Temporal sampling rate in hours

Returns:

timestamps – list of datetime objects of each available image between start_date and end_date

Return type:

list

class esa_cci_sm.interface.CCI_SM_025Img(filename, mode='r', parameter=None, subgrid=None, array_1D=False)[source]

Bases: ImageBase

Class for reading one ESA CCI SM netcdf image file on a 0.25 DEG grid.

Parameters:
  • filename (str) – Filename of the ESA CCI SM netcdf file

  • mode (str, optional (default: 'r')) – Mode of opening the file, only ‘r’ is implemented at the moment

  • parameter (str or list[str,...], optional (default: 'sm')) – One or list of parameters to read, see ESA CCI documentation for more information

  • array_1D (boolean, optional (default: False)) – If set then the data is read into 1D arrays. Where the first element refers to the lower left data point in the 2d image.

close()[source]

Close file.

flush()[source]

Flush data.

read(timestamp=None)[source]

Read data from loaded netcdf file.

Parameters:

timestamp (datetime) – Time stamp for this image.

Returns:

img – Image object as implemented in pygeobase

Return type:

Image

write(data)[source]

Write data to an image file.

Parameters:

image (object) – pygeobase.object_base.Image object

esa_cci_sm.reshuffle module

Module for a command line interface to convert the ESACCI data into a time series format using the repurpose package

esa_cci_sm.reshuffle.main(args)[source]
esa_cci_sm.reshuffle.mkdate(datestring)[source]
esa_cci_sm.reshuffle.parse_args(args)[source]

Parse command line parameters for conversion from image to timeseries

Parameters:

args (list) – command line parameters as list of strings

Returns:

params – Command line parameters

Return type:

argparse.Namespace

esa_cci_sm.reshuffle.parse_filename(data_dir, template='{product}-SOILMOISTURE-L3S-{data_type}-{sensor_type}-{datetime}000000-fv{version}.{sub_version}.nc')[source]

Take the first file in the passed directory and use its file name to retrieve the product type, version number and variables in the file.

Parameters:
  • inroot (str) – Input root directory

  • template (str, optional) – Template to use for parsing

Returns:

  • file_args (dict) – Parsed arguments from file name

  • file_vars (list) – Names of parameters in the first detected file

esa_cci_sm.reshuffle.read_metadata(sensortype, version, varnames)[source]

Read metadata dictionaries from the according ini file

Parameters:
  • sensortype (str) – product type: active, passive, combined

  • version (int) – ESA CCI SM main version (eg. 2 or 3 or 4)

  • varnames (list) – List of variables to read metadata for.

Returns:

  • glob_meta (dict) – Global file metadata

  • var_meta (dict) – Variable meta dicts

esa_cci_sm.reshuffle.reshuffle(input_root, outputpath, startdate, enddate, parameters=None, land_points=True, ignore_meta=True, template='{product}-SOILMOISTURE-L3S-{data_type}-{sensor_type}-{datetime}000000-fv{version}.{sub_version}.nc', imgbuffer=200)[source]

Reshuffle method applied to ESA CCI SM images.

Parameters:
  • input_root (string) – input path where era interim data was downloaded

  • outputpath (string) – Output path.

  • startdate (datetime) – Start date.

  • enddate (datetime) – End date.

  • parameters (list, optional (default: None)) – parameters to read and convert If none are passed, we read an image in the root path and use vars from the image.

  • land_points (bool, optional (default: True)) – Use the land grid to calculate time series on. Leads to faster processing and smaller files.

  • imgbuffer (int, optional) – How many images to read at once before writing time series.

esa_cci_sm.reshuffle.run()[source]
esa_cci_sm.reshuffle.str2bool(val)[source]

Module contents