Weather

The vibe_core.data.weather data module defines data types related to weather information and forecasts. It provides classes for representing weather data and Global Forecast System (GFS) forecasts, making it easier to work with weather-related data in various agricultural and environmental analysis scenarios.

Hierarchy

classDiagram class BaseVibe { } class DataVibe { } class Raster { } class GfsForecast { } class Grib { } class WeatherVibe { } DataVibe --|> BaseVibe Raster --|> DataVibe GfsForecast --|> DataVibe Grib --|> Raster WeatherVibe --|> DataVibe

Documentation

class vibe_core.data.weather.GfsForecast(id, time_range, geometry, assets, publish_time)

Bases: DataVibe

Represents a Global Forecast System (GFS) forecast.

publish_time: str

The publication time of the forecast in ISO format.

class vibe_core.data.weather.Grib(id, time_range, geometry, assets, bands, meta=<factory>)

Bases: Raster

Represents a Grib file

meta: Dict[str, str]

metadata as key-value pair. For example, lead-time.

class vibe_core.data.weather.WeatherVibe(id, time_range, geometry, assets)

Bases: DataVibe

Represents weather data.

assets: List[AssetVibe]

A list of AssetVibe objects of the assets associated with the data object.

bbox: Tuple[float, float, float, float]

A BBox representing the bounding box of the data object. This field is calculated from the geometry property using the shapely.geometry library.

geometry: Dict[str, Any]

A dictionary representing the geometry of the data object.

id: str

A string representing the unique identifier of the data object.

time_range: Tuple[datetime, datetime]

A TimeRange representing the timestamps of to the beginning and end of sample.

vibe_core.data.weather.gen_forecast_time_hash_id(name, geometry, publish_time, time_range)

Generates a SHA-256 hash ID for a forecast time, based on the input parameters.

Parameters:
  • name (str) – The name of the forecast.

  • geometry (Dict[str, Any]) – The geometry associated with the forecast, as a dictionary.

  • publish_time (Union[str, datetime]) – The time when the forecast was published, as a string or a datetime object.

  • time_range (Tuple[datetime, datetime]) – The time range of the forecast, as a tuple of two datetime objects.

Returns:

The SHA-256 hash ID of the forecast time.