-
Notifications
You must be signed in to change notification settings - Fork 416
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Add clients for accessing AWS data
- Loading branch information
1 parent
d9bcf95
commit 88329d3
Showing
3 changed files
with
646 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright (c) 2023 MetPy Developers. | ||
# Distributed under the terms of the BSD 3-Clause License. | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
""" | ||
================== | ||
Remote Data Access | ||
================== | ||
Use MetPy to access data hosted in known AWS S3 buckets | ||
""" | ||
from datetime import datetime, timedelta | ||
|
||
from metpy.remote import NEXRADLevel2Archive, NEXRADLevel3Archive, GOESArchive | ||
|
||
################### | ||
# NEXRAD Level 2 | ||
|
||
# Get the nearest product to a time | ||
prod = NEXRADLevel2Archive().get_product('KTLX', datetime(2013, 5, 22, 21, 53)) | ||
|
||
# Open using MetPy's Level2File class | ||
l2 = prod.parse() | ||
|
||
################### | ||
# NEXRAD Level 3 | ||
start = datetime(2022, 10, 30, 15) | ||
end = start + timedelta(hours=2) | ||
products = NEXRADLevel3Archive().get_range('FTG', 'N0B', start, end) | ||
|
||
# Get all the file names--could also get a file-like object or open with MetPy Level3File | ||
print([prod.name for prod in products]) | ||
|
||
################ | ||
# GOES Archives | ||
prod = GOESArchive(16).get_product('ABI-L1b-RadC', band=2) | ||
|
||
# Retrieve using xarray + netcdf-c's S3 support | ||
nc = prod.parse() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Copyright (c) 2023 MetPy Developers. | ||
# Distributed under the terms of the BSD 3-Clause License. | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
"""Provide tools for accessing data from remote sources. | ||
This currently includes clients for searching and downloading data from public cloud buckets. | ||
""" | ||
|
||
from .aws import * # noqa: F403 | ||
from ..package_tools import set_module | ||
|
||
__all__ = aws.__all__[:] # pylint: disable=undefined-variable | ||
|
||
set_module(globals()) |
Oops, something went wrong.