src.dynamic_boundary_conditions.rainfall.hirds_rainfall_data_to_db

Store the rainfall data for all the sites within the catchment area in the database.

Attributes

log

Functions

db_rain_table_name(→ str)

Return the relevant rainfall data table name used in the database.

get_site_ids_in_catchment(→ List[str])

Get the rainfall site IDs within the catchment area.

get_site_ids_not_in_db(→ List[str])

Get the list of rainfall site IDs that are within the catchment area but not in the database.

add_rainfall_data_to_db(→ None)

Store the rainfall data for a specific site in the database.

add_each_site_rainfall_data(→ None)

Add rainfall data for each site in the site_ids_list to the database.

rainfall_data_to_db(→ None)

Store rainfall data of all the sites within the catchment area in the database.

Module Contents

src.dynamic_boundary_conditions.rainfall.hirds_rainfall_data_to_db.log
src.dynamic_boundary_conditions.rainfall.hirds_rainfall_data_to_db.db_rain_table_name(idf: bool) str

Return the relevant rainfall data table name used in the database.

Parameters:

idf (bool) – Set to False for rainfall depth data, and True for rainfall intensity data.

Returns:

The relevant rainfall data table name.

Return type:

str

src.dynamic_boundary_conditions.rainfall.hirds_rainfall_data_to_db.get_site_ids_in_catchment(sites_in_catchment: geopandas.GeoDataFrame) List[str]

Get the rainfall site IDs within the catchment area.

Parameters:

sites_in_catchment (gpd.GeoDataFrame) – Rainfall sites coverage areas (Thiessen polygons) that intersect or are within the catchment area.

Returns:

The rainfall site IDs within the catchment area.

Return type:

List[str]

src.dynamic_boundary_conditions.rainfall.hirds_rainfall_data_to_db.get_site_ids_not_in_db(engine: sqlalchemy.engine.Engine, site_ids_in_catchment: List[str], idf: bool) List[str]

Get the list of rainfall site IDs that are within the catchment area but not in the database.

Parameters:
  • engine (Engine) – The engine used to connect to the database.

  • site_ids_in_catchment (List[str]) – Rainfall site IDs within the catchment area.

  • idf (bool) – Set to False for rainfall depth data, and True for rainfall intensity data.

Returns:

The rainfall site IDs within the catchment area but not present in the database.

Return type:

List[str]

src.dynamic_boundary_conditions.rainfall.hirds_rainfall_data_to_db.add_rainfall_data_to_db(engine: sqlalchemy.engine.Engine, site_id: str, idf: bool) None

Store the rainfall data for a specific site in the database.

Parameters:
  • engine (Engine) – The engine used to connect to the database.

  • site_id (str) – HIRDS rainfall site ID.

  • idf (bool) – Set to False for rainfall depth data, and True for rainfall intensity data.

Returns:

This function does not return any value.

Return type:

None

src.dynamic_boundary_conditions.rainfall.hirds_rainfall_data_to_db.add_each_site_rainfall_data(engine: sqlalchemy.engine.Engine, site_ids_list: List[str], idf: bool) None

Add rainfall data for each site in the site_ids_list to the database.

Parameters:
  • engine (Engine) – The engine used to connect to the database.

  • site_ids_list (List[str]) – List of rainfall sites’ IDs.

  • idf (bool) – Set to False for rainfall depth data, and True for rainfall intensity data.

Returns:

This function does not return any value.

Return type:

None

src.dynamic_boundary_conditions.rainfall.hirds_rainfall_data_to_db.rainfall_data_to_db(engine: sqlalchemy.engine.Engine, sites_in_catchment: geopandas.GeoDataFrame, idf: bool = False) None

Store rainfall data of all the sites within the catchment area in the database.

Parameters:
  • engine (Engine) – The engine used to connect to the database.

  • sites_in_catchment (gpd.GeoDataFrame) – Rainfall sites coverage areas (Thiessen polygons) that intersect or are within the catchment area.

  • idf (bool = False) – Set to False for rainfall depth data, and True for rainfall intensity data.

Returns:

This function does not return any value.

Return type:

None