geodata.cutout.Cutout#

class geodata.cutout.Cutout(module: Literal['era5', 'merra2'], weather_data_config: str, years: slice, name: str | None = None, cutout_dir: str | pathlib.Path = config.cutout_dir, bounds: collections.abc.Iterable | None = None, months: slice | None = None, xs: slice | None = None, ys: slice | None = None)#

Cutout class to handle a subset of a Dataset.

Parameters:
  • module (Literal["era5", "merra2"]) – name of the dataset module to use.

  • weather_data_config (str) – name of the weather data config to use. the name will be automatically generated.

  • years (slice) – years of the cutout.

  • name (Optional[str]) – name of the cutout. Optional. If not specified,

  • cutout_dir (str) – path to the cutout directory. Defaults to config.cutout_dir.

  • bounds (Optional[Iterable]) – bounds of the cutout. Optional. If not specified, the bounds will be automatically generated.

  • months (Optional[slice]) – months of the cutout. Optional. If not specified, the months will be automatically generated.

  • xs (Optional[slice]) – longitude coordinates of the cutout. Optional. If not specified, the x coordinates will be automatically generated.

  • ys (Optional[slice]) – latitude coordinates of the cutout. Optional. If not specified, the y coordinates will be automatically generated.

name#
cutout_dir#
prepared = False#
empty = False#
meta_append = 0#
config#
meta = None#
merged_mask = None#
shape_mask = None#
area = None#
params_dict#
property meta_data_config#
Metadata configuration for the Cutout
property weather_data_config#
The weather data configuration for the Cutout.
property variables#
The variables contained in the Cutout.
property info#
Summary information about the Cutout.
property projection#
The projection of the Cutout.
property coords#
The coordinates covered by the Cutout.
property meta_clean#
property shape#
The shape of the Cutout by (y, x).
property extent#
The extent of the Cutout by (x_min, x_max, y_min, y_max).
property years#
Cutout's covered years as slice object.
property months#
Cutout's covered months as slice object.
get_meta#
get_meta_view#
prepare#
produce_specific_dataseries#

Methods#

datasetfn(*args)

Return path to dataset xarray files related to this Cutout.

grid_coordinates()

Return grid coordinates of the Cutout.

grid_cells()

Return grid cells of the Cutout.

add_mask(name[, merged_mask, shape_mask])

Add mask attribute to the cutout, from a previously saved mask objects.

add_grid_area([axis, adjust_coord])

Add attribute 'area' to the cutout containing area for each grid cell

mask(dataset[, true_area, merged_mask, shape_mask])

Mask a converted xarray.Dataset from cutout with previously added mask attribute

heat_demand([threshold, a, constant, hour_shift])

Convert outside temperature into daily heat demand using the

temperature(**convert_params)

Convert temperature in Cutout to outside temperature.

soil_temperature(**convert_params)

Return soil temperature (useful for e.g. heat pump T-dependent

solar_thermal([orientation, trigon_model, ...])

Convert downward short-wave radiation flux and outside temperature

wind(turbine[, smooth])

Generate wind generation time-series

windspd(**params)

Generate wind speed time-series

windwpd(**params)

Generate wind power density time-series

pv(panel, orientation[, clearsky_model])

Convert downward-shortwave, upward-shortwave radiation flux and

pm25(**params)

Generate PM2.5 time series [ug / m3]