Core Functions

Main processing functions for downloading and processing ERA5 data.

varunayan.era5ify_geojson(request_id: str, variables: List[str], start_date: str, end_date: str, json_file: str, dist_features: List[str] | None = None, dataset_type: str = 'single', pressure_levels: List[str] | None = None, frequency: str = 'hourly', resolution: float = 0.25, verbosity: int = 0, save_raw: bool = True) DataFrame[source]

Public function for querying data for a GeoJSON.

Parameters:
  • request_id (str) – Unique identifier for the request.

  • variables (List[str]) – List of variables to download.

  • start_date (str) – Start date of the data in ‘YYYY-M-D’ or ‘YYYY-MM-DD’ format.

  • end_date (str) – End date of the data in ‘YYYY-M-D’ or ‘YYYY-MM-DD’ format.

  • json_file (str) – Path to the GeoJSON file.

  • dist_features (List[str] | None, optional) – List of feature properties to distinguish different areas in the GeoJSON. Defaults to None.

  • dataset_type (str, optional) – Type of dataset. Either ‘single’ (single level) or ‘pressure’ (pressure level). Defaults to ‘single’.

  • pressure_levels (List[str] | None, optional) – List of pressure levels to download (e.g., [“1000”, “925”, “850”]). Defaults to None.

  • frequency (str, optional) – Frequency of the data (‘hourly’, ‘daily’, ‘weekly’, ‘monthly’, ‘yearly’). Defaults to ‘hourly’.

  • resolution (float, optional) – Spatial resolution in degrees (0.25, 0.1, 0.5, etc.). Defaults to 0.25, minimum is 0.1.

  • verbosity (int, optional) – Verbosity level (0 for no output, 1 for info output, 2 for debug/complete output). Defaults to 0.

  • save_raw (bool, optional) – Whether to save the raw data. Defaults to True.

Returns:

A DataFrame containing the processed data for the region described by GeoJSON.

Return type:

DataFrame

varunayan.era5ify_bbox(request_id: str, variables: List[str], start_date: str, end_date: str, north: float, south: float, east: float, west: float, dataset_type: str = 'single', pressure_levels: List[str] | None = None, frequency: str = 'hourly', resolution: float = 0.25, verbosity: int = 0, save_raw: bool = True) DataFrame[source]

Public function for querying data for a defined bounding box (north, south, east, west bounds).

Parameters:
  • request_id (str) – Unique identifier for the request.

  • variables (List[str]) – List of variables to download.

  • start_date (str) – Start date of the data in ‘YYYY-M-D’ or ‘YYYY-MM-DD’ format.

  • end_date (str) – End date of the data in ‘YYYY-M-D’ or ‘YYYY-MM-DD’ format.

  • north (float) – Northern bound of the bounding box.

  • south (float) – Southern bound of the bounding box.

  • east (float) – Eastern bound of the bounding box.

  • west (float) – Western bound of the bounding box.

  • dataset_type (str, optional) – Type of dataset. Either ‘single’ (single level) or ‘pressure’ (pressure level). Defaults to ‘single’.

  • pressure_levels (List[str] | None, optional) – List of pressure levels to download (e.g., [“1000”, “925”, “850”]). Defaults to None.

  • frequency (str, optional) – Frequency of the data (‘hourly’, ‘daily’, ‘weekly’, ‘monthly’, ‘yearly’). Defaults to ‘hourly’.

  • resolution (float, optional) – Spatial resolution in degrees (0.25, 0.1, 0.5, etc.). Defaults to 0.25, minimum is 0.1.

  • verbosity (int, optional) – Verbosity level (0 for no output, 1 for info output, 2 for debug/complete output). Defaults to 0.

  • save_raw (bool, optional) – Whether to save the raw data. Defaults to True.

Returns:

A DataFrame containing the processed data for the specified bbox.

Return type:

DataFrame

varunayan.era5ify_point(request_id: str, variables: List[str], start_date: str, end_date: str, latitude: float, longitude: float, dataset_type: str = 'single', pressure_levels: List[str] | None = None, frequency: str = 'hourly', verbosity: int = 0, save_raw: bool = True) DataFrame[source]

Public function for querying data for a single geographical point (latitude, longitude).

Parameters:
  • request_id (str) – Unique identifier for the request.

  • variables (List[str]) – List of variables to download.

  • start_date (str) – Start date of the data in ‘YYYY-M-D’ or ‘YYYY-MM-DD’ format.

  • end_date (str) – End date of the data in ‘YYYY-M-D’ or ‘YYYY-MM-DD’ format.

  • latitude (float) – Latitude of the point of interest.

  • longitude (float) – Longitude of the point of interest.

  • dataset_type (str, optional) – Type of dataset. Either ‘single’ (single level) or ‘pressure’ (pressure level). Defaults to ‘single’.

  • pressure_levels (List[str] | None, optional) – List of pressure levels to download (e.g., [“1000”, “925”, “850”]). Defaults to None.

  • frequency (str, optional) – Frequency of the data (‘hourly’, ‘daily’, ‘weekly’, ‘monthly’, ‘yearly’). Defaults to ‘hourly’.

  • verbosity (int, optional) – Verbosity level (0 for no output, 1 for info output, 2 for debug/complete output). Defaults to 0.

  • save_raw (bool, optional) – Whether to save the raw data. Defaults to True.

Returns:

A DataFrame containing the processed data for the specified point.

Return type:

DataFrame