lair.hrrr.get_nearest_point#
- lair.hrrr.get_nearest_point(longitude, latitude, chunk_index)[source]#
Get the nearest point to a given latitude and longitude.
- Parameters:
- Returns:
xr.Dataset – nearest point
- Return type:
See also
create_s3_chunk_urlTakes the
chunk_idof the point it returns.WindsCalls it for the point you give.
PROJECTIONThe projection it uses.
Examples
The chunk index is a Zarr dataset in the HRRR archive (needs the internet):
>>> import s3fs >>> import xarray as xr >>> from lair.hrrr import get_nearest_point >>> fs = s3fs.S3FileSystem(anon=True) >>> index = xr.open_zarr( ... s3fs.S3Map("s3://hrrrzarr/grid/HRRR_chunk_index.zarr", s3=fs) ... ) >>> point = get_nearest_point(-111.848, 40.766, index) >>> str(point.chunk_id.values)