Other Processes

Processes for other indicators

class finch.processes.virtual.other.AveragePolygonProcess

Bases: FinchProcess

average_polygon Average over one or more polygons (v0.1)

Return the average of the data within each polygons, taking into account partial overlaps and holes, for each input dataset as well as the time range selected.

Parameters:
  • resource (application/x-netcdf, application/x-ogc-dods) – NetCDF files, can be OPEnDAP urls.

  • shape (application/geo+json, application/x-zipped-shp) – Polygon contour, as a geojson string or as a zipped ShapeFile.

  • tolerance (float, optional) – The polygon tolerance in degrees.High-resolution polygons are simplified to this tolerance in order to speed up the averaging. Put 0 to disable that simplification.

  • start_date (string, optional) – Initial date for temporal subsetting. Can be expressed as year (%Y), year-month (%Y-%m) or year-month-day(%Y-%m-%d). Defaults to first day in file.

  • end_date (string, optional) – Final date for temporal subsetting. Can be expressed as year (%Y), year-month (%Y-%m) or year-month-day(%Y-%m-%d). Defaults to last day in file.

  • variable ({'None'}, optional) – Name of the variable in the input files.

Returns:

  • output (application/x-netcdf) – netCDF output

  • ref (application/metalink+xml; version=4.0) – Metalink file storing all references to output files.

class finch.processes.virtual.other.EmpiricalQuantileMappingProcess

Bases: FinchProcess

empirical_quantile_mapping Empirical Quantile Mapping bias-adjustment (v0.1)

Adjustment factors are computed between the quantiles of ref and sim.Values of sim are matched to the corresponding quantiles of hist and corrected accordingly.

Parameters:
  • ref (application/x-netcdf, application/x-ogc-dods) – Reference netCDF resource, typically observations or reanalyses.

  • hist (application/x-netcdf, application/x-ogc-dods) – Historical simulation netCDF resource overlapping the reference dataset.

  • sim (application/x-netcdf, application/x-ogc-dods) – Simulation netCDF resource whose bias will be corrected

  • group (string, optional) – The usual grouping name as xarray understands it. Ex: time.month or time.

  • window (integer, optional) – If larger than 1, a centered rolling window along the main dimension is created when grouping data.Units are the sampling frequency of the data along the main dimension.

  • interp ({'nearest', 'linear', 'cubic'}, optional) – Interpolation method to determine the quantile correction factor to apply.

  • extrapolation ({'constant', 'nan'}, optional) – Method used to extrapolate quantile adjustment factors beyond the computed quantiles.

  • variable ({'None'}, optional) – Name of the variable in the input files.

  • nquantiles (integer, optional) – The number of quantiles to use. Two endpoints at 1e-6 and 1 - 1e-6 will be added.

  • kind ({'+', '*'}, optional) – Use * for multiplicative adjustment, or + for additive adjustement.

  • output_name (string, optional) – Filename of the output (no extension).

Returns:

  • output (application/x-netcdf) – netCDF output

  • output_log (text/plain) – Collected logs during process run.

  • ref (application/metalink+xml; version=4.0) – Metalink file storing all references to output files.

class finch.processes.virtual.other.GeoseriesToNetcdfProcess

Bases: FinchProcess

geoseries_to_netcdf Convert a geospatial series to a CF-compliant netCDF. (v0.1)

Reshapes a geospatial series with a features dimensions and converts into the netCDf format, following CF convetions.

Parameters:
  • resource (application/geo+json) – Series of geographical features, or an url which requests such a series (ex: OGC-API)

  • index_dim (string) – Name of the column in the data to be converted into the index dimension.

  • feat_dim (string, optional) – Name of a column in the data to be used as the coordinate and of the ‘feature’ dimension. Each geometry must be different along and only along this dimension.

  • squeeze (boolean, optional) – Squeeze variables that are replicated along one of the dimensions.

  • output_name (string, optional) – Filename of the output (no extension).

Returns:

  • output (application/x-netcdf) – The geospatial series as a 2 dimension netCDF.

  • output_log (text/plain) – Collected logs during process run.

class finch.processes.virtual.other.HourlyToDailyProcess

Bases: FinchProcess

hourly_to_daily Resample from hourly frequency to daily frequency. (v0.1)

Take the mean, sum, minimum or maximum of hourly data over each day to compute daily values.

Parameters:
  • resource (application/x-netcdf, application/x-ogc-dods) – NetCDF file with time series at hourly frequency.

  • reducer ({'mean', 'sum', 'min', 'max'}) – Operation applied to hourly data to compute unique daily value.

  • check_missing ({'any', 'wmo', 'pct', 'at_least_n', 'skip', 'from_context'}, optional) – Method used to determine which aggregations should be considered missing.

  • missing_options (application/json, optional) – JSON representation of dictionary of missing method parameters.

  • variable ({'None'}, optional) – Name of the variable in the input files.

  • output_name (string, optional) – Filename of the output (no extension).

Returns:

  • output (application/x-netcdf) – The daily statistic computed from hourly data.

  • output_log (text/plain) – Collected logs during process run.

class finch.processes.virtual.other.SubsetBboxDatasetProcess

Bases: FinchProcess

subset_bbox_dataset Subset of a dataset, using a bounding box (v0.1)

For the given dataset, return the data for which grid cells intersect the bounding box for each input dataset as well as the time range selected.

Parameters:
  • dataset ({'candcs-u5', 'bccaqv2', 'candcs-u6', 'humidex-daily'}, optional) – Name of the dataset from which to get netcdf files for inputs.

  • scenario ({'rcp26', 'rcp45', 'ssp245', 'ssp126', 'ssp585', 'rcp85'}, optional) – Emission scenario (RCPs or SSPs, depending on the dataset)

  • models ({'all', 'EC-Earth3', 'pcic12', 'bcc-csm1-1', 'MPI-ESM1-2-HR', 'MPI-ESM1-2-LR', 'KIOST-ESM', 'GFDL-ESM2M', 'NorESM2-LM', 'FGOALS-g2', ...}, optional) – When calculating the ensemble, include only these models. Allowed values depend on the dataset chosen. By default, all models are used (‘all’), taking the first realization of each. Special sub-lists are also available :candcs-u5: [‘24models’, ‘pcic12’], bccaqv2: [‘24models’, ‘pcic12’], candcs-u6: [‘26models’], humidex-daily: [‘humidex_models’]

  • variable ({'pr', 'tasmax', 'HXmax', 'tasmin'}, optional) – Name of the variable in the NetCDF file. Allowed values depend on the dataset.

  • lon0 (float, optional) – Minimum longitude.

  • lon1 (float, optional) – Maximum longitude.

  • lat0 (float, optional) – Minimum latitude.

  • lat1 (float, optional) – Maximum latitude.

  • start_date (string, optional) – Initial date for temporal subsetting. Can be expressed as year (%Y), year-month (%Y-%m) or year-month-day(%Y-%m-%d). Defaults to first day in file.

  • end_date (string, optional) – Final date for temporal subsetting. Can be expressed as year (%Y), year-month (%Y-%m) or year-month-day(%Y-%m-%d). Defaults to last day in file.

  • output_format ({'netcdf', 'csv'}, optional) – Choose in which format you want to receive the result. CSV actually means a zip file of two csv files.

Returns:

output – The format depends on the ‘output_format’ input parameter.

Return type:

application/x-netcdf, text/plain

class finch.processes.virtual.other.SubsetBboxProcess

Bases: FinchProcess

subset_bbox Subset with bounding box (v0.1)

Return the data for which grid cells intersect the bounding box for each input dataset as well as the time range selected.

Parameters:
  • resource (application/x-netcdf, application/x-ogc-dods) – NetCDF files, can be OPEnDAP urls.

  • lon0 (float, optional) – Minimum longitude.

  • lon1 (float, optional) – Maximum longitude.

  • lat0 (float, optional) – Minimum latitude.

  • lat1 (float, optional) – Maximum latitude.

  • start_date (string, optional) – Initial date for temporal subsetting. Can be expressed as year (%Y), year-month (%Y-%m) or year-month-day(%Y-%m-%d). Defaults to first day in file.

  • end_date (string, optional) – Final date for temporal subsetting. Can be expressed as year (%Y), year-month (%Y-%m) or year-month-day(%Y-%m-%d). Defaults to last day in file.

  • variable ({'None'}, optional) – Name of the variable in the input files.

Returns:

  • output (application/x-netcdf) – netCDF output

  • ref (application/metalink+xml; version=4.0) – Metalink file storing all references to output files.

class finch.processes.virtual.other.SubsetGridPointDatasetProcess

Bases: FinchProcess

subset_grid_point_dataset Subset of grid cells from a dataset, using a list of coordinates (v0.1)

For the the given dataset, return the closest grid cell for each provided coordinates pair, for the time range selected.

Parameters:
  • dataset ({'candcs-u5', 'bccaqv2', 'candcs-u6', 'humidex-daily'}, optional) – Name of the dataset from which to get netcdf files for inputs.

  • scenario ({'rcp26', 'rcp45', 'ssp245', 'ssp126', 'ssp585', 'rcp85'}, optional) – Emission scenario (RCPs or SSPs, depending on the dataset)

  • models ({'all', 'EC-Earth3', 'pcic12', 'bcc-csm1-1', 'MPI-ESM1-2-HR', 'MPI-ESM1-2-LR', 'KIOST-ESM', 'GFDL-ESM2M', 'NorESM2-LM', 'FGOALS-g2', ...}, optional) – When calculating the ensemble, include only these models. Allowed values depend on the dataset chosen. By default, all models are used (‘all’), taking the first realization of each. Special sub-lists are also available :candcs-u5: [‘24models’, ‘pcic12’], bccaqv2: [‘24models’, ‘pcic12’], candcs-u6: [‘26models’], humidex-daily: [‘humidex_models’]

  • variable ({'pr', 'tasmax', 'HXmax', 'tasmin'}, optional) – Name of the variable in the NetCDF file. Allowed values depend on the dataset.

  • lat (string, optional) – Latitude coordinate. Accepts a comma separated list of floats for multiple grid cells.

  • lon (string, optional) – Longitude coordinate. Accepts a comma separated list of floats for multiple grid cells.

  • lat0 (string, optional) – Latitude (deprecated, use ‘lat’).

  • lon0 (string, optional) – Latitude (deprecated, use ‘lon’).

  • start_date (string, optional) – Initial date for temporal subsetting. Can be expressed as year (%Y), year-month (%Y-%m) or year-month-day(%Y-%m-%d). Defaults to first day in file.

  • end_date (string, optional) – Final date for temporal subsetting. Can be expressed as year (%Y), year-month (%Y-%m) or year-month-day(%Y-%m-%d). Defaults to last day in file.

  • output_format ({'netcdf', 'csv'}, optional) – Choose in which format you want to receive the result. CSV actually means a zip file of two csv files.

  • csv_precision (integer, optional) – Only valid if output_format is CSV. If not set, all decimal places of a 64 bit floating precision number are printed. If negative, rounds before the decimal point.

Returns:

output – The format depends on the ‘output_format’ input parameter.

Return type:

application/x-netcdf, text/plain

class finch.processes.virtual.other.SubsetGridPointProcess

Bases: FinchProcess

subset_gridpoint Subset with a grid point (v0.2)

Return the data for which grid cells includes the point coordinates for each input dataset as well as the time range selected.

Parameters:
  • resource (application/x-netcdf, application/x-ogc-dods) – NetCDF files, can be OPEnDAP urls.

  • lon (string) – Longitude coordinate. Accepts a comma separated list of floats for multiple grid cells.

  • lat (string) – Latitude coordinate. Accepts a comma separated list of floats for multiple grid cells.

  • start_date (string, optional) – Initial date for temporal subsetting. Can be expressed as year (%Y), year-month (%Y-%m) or year-month-day(%Y-%m-%d). Defaults to first day in file.

  • end_date (string, optional) – Final date for temporal subsetting. Can be expressed as year (%Y), year-month (%Y-%m) or year-month-day(%Y-%m-%d). Defaults to last day in file.

  • variable ({'None'}, optional) – Name of the variable in the input files.

Returns:

  • output (application/x-netcdf) – netCDF output

  • ref (application/metalink+xml; version=4.0) – Metalink file storing all references to output files.

class finch.processes.virtual.other.SubsetPolygonProcess

Bases: FinchProcess

subset_polygon Subset with one or more polygons (v0.1)

Return the data for which grid cells center are within the polygon for each input dataset as well as the time range selected.

Parameters:
  • resource (application/x-netcdf, application/x-ogc-dods) – NetCDF files, can be OPEnDAP urls.

  • shape (application/geo+json, application/x-zipped-shp) – Polygon contour, as a geojson string or as a zipped ShapeFile.

  • start_date (string, optional) – Initial date for temporal subsetting. Can be expressed as year (%Y), year-month (%Y-%m) or year-month-day(%Y-%m-%d). Defaults to first day in file.

  • end_date (string, optional) – Final date for temporal subsetting. Can be expressed as year (%Y), year-month (%Y-%m) or year-month-day(%Y-%m-%d). Defaults to last day in file.

  • variable ({'None'}, optional) – Name of the variable in the input files.

Returns:

  • output (application/x-netcdf) – netCDF output

  • ref (application/metalink+xml; version=4.0) – Metalink file storing all references to output files.