Assets¶
AssetRegistry¶
- class climagrid.assets.registry.AssetRegistry(path, asset_type_filter=None)[source]¶
Bases:
objectLoads and validates a utility asset registry from CSV or GeoJSON.
- Parameters:
Example
>>> registry = AssetRegistry("my_coop_assets.csv") >>> registry.assets.head()
- property assets: GeoDataFrame¶
- Type:
GeoDataFrame with one row per asset, CRS=EPSG
AssetEnvironmentJoiner¶
- class climagrid.assets.joiner.AssetEnvironmentJoiner(max_distance_km=100.0)[source]¶
Bases:
objectJoins time-series environmental data to utility asset point locations.
Strategy: nearest-neighbor match in Euclidean lat/lon space (valid for small regions, <500 km extents). For large extents consider haversine.
- Parameters:
max_distance_km (
float) – Reject matches farther than this distance. Points beyond this threshold will have NaN environmental values. Default 100 km.
Example
>>> registry = AssetRegistry("assets.csv") >>> nasa = NasaPowerAdapter() >>> env_df = nasa.fetch(bbox, start_dt, end_dt) >>> joiner = AssetEnvironmentJoiner() >>> result = joiner.join(registry, env_df) >>> result.head()
- join(registry, env_df, time_col='timestamp')[source]¶
Join environmental observations to each asset for every timestamp.
- Parameters:
registry (
AssetRegistry) – AssetRegistry with asset locations.env_df (
DataFrame) – DataFrame returned by any adapter’s fetch() method. Must have ‘lat’, ‘lon’, and at least one timestamp.time_col (
str) – Name of the timestamp column in env_df.
- Returns:
One row per (asset_id, timestamp) with index columns and all environmental columns present in env_df.
- Return type: