hydroflows.methods.rainfall.get_ERA5_rainfall#

Get ERA5 rainfall timeseries data for a region center point.

class hydroflows.methods.rainfall.get_ERA5_rainfall.GetERA5Rainfall(region: Path, output_dir: Path = 'data/input', **params)[source]#

Method for downloading ERA5 rainfall data at the centroid of a region.

Parameters:
  • region (Path) – The file path to the geometry file for which we want to download ERA5 rainfall time series at its centroid.

  • output_dir (Path, optional) – The root folder where the data is stored, by default “data/input”.

  • **params – Additional parameters to pass to the GetERA5Rainfall instance.

pydantic model hydroflows.methods.rainfall.get_ERA5_rainfall.Input[source]#

Input parameters for the GetERA5Rainfall method.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Fields:
field region: Path [Required]#

The file path to the geometry file for which we want to download ERA5 rainfall time series at its centroid. An example of such a file could be the SFINCS region GeoJSON.

model_post_init(context: Any, /) None#

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

pydantic model hydroflows.methods.rainfall.get_ERA5_rainfall.Output[source]#

Output parameters for the GetERA5Rainfall method.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Fields:
field precip_nc: Path [Required]#

The path to the NetCDF file with the derived ERA5 rainfall timeseries.

model_post_init(context: Any, /) None#

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

pydantic model hydroflows.methods.rainfall.get_ERA5_rainfall.Params[source]#

Parameters for the GetERA5Rainfall.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Fields:
field end_date: datetime = datetime.datetime(2023, 12, 31, 0, 0)#

The end date for downloading the ERA5 precipitation time series.

field filename: str = 'era5_precip.nc'#

The filename for the ERA5 precipitation time series.

field output_dir: Annotated[Path, AfterValidator(func=outputdirpath_validator)] = PosixPath('data/input')#

The root folder where the data is stored.

field start_date: datetime = datetime.datetime(1990, 1, 1, 0, 0)#

The start date for downloading the ERA5 precipitation time series.

model_post_init(context: Any, /) None#

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.