lair.hrrr.get_value#
- lair.hrrr.get_value(s3, zarr_id, chunk_id, nearest_point)[source]#
Get an array of values from am s3 zarr chunk.
- Parameters:
- Returns:
np.array – array of values
See also
retrieve_objectGets the chunk’s bytes.
decompress_chunkTurns them into an array.
get_nearest_pointGives the
chunk_idandnearest_point.
Examples
Windsdoes this for the 10 m u and v. For one hour of u at the nearest point (needs the internet;s3andpointare as inretrieve_object()andget_nearest_point()):>>> import datetime as dt >>> from lair.hrrr import ZarrId, get_value >>> zarr_id = ZarrId( ... dt.datetime(2024, 1, 15, 12), "sfc", "10m_above_ground", "UGRD", "anl" ... ) >>> u = get_value(s3, zarr_id, point.chunk_id.values, point)