-
Notifications
You must be signed in to change notification settings - Fork 445
AWS Data Clients #3000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
AWS Data Clients #3000
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| cartopy==0.24.0 | ||
| dask==2025.2.0 | ||
| shapely==2.0.7 | ||
| boto3==1.35.88 |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -3,3 +3,4 @@ pytest==8.3.5 | |
| pytest-mpl==0.17.0 | ||
| netCDF4==1.7.2 | ||
| coverage==7.8.0 | ||
| vcrpy==7.0.0 | ||
This file contains hidden or 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 GOESArchive, NEXRADLevel2Archive, NEXRADLevel3Archive | ||
|
|
||
| ################### | ||
| # 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.access() | ||
|
|
||
| ################### | ||
| # 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(19).get_product('ABI-L1b-RadC', band=2) | ||
|
|
||
| # Retrieve using xarray + netcdf-c's S3 support | ||
| nc = prod.access() |
This file contains hidden or 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,43 @@ | ||
| # Copyright (c) 2025 MetPy Developers. | ||
| # Distributed under the terms of the BSD 3-Clause License. | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
| """ | ||
| ========================================= | ||
| ML Weather Prediction Access and Plotting | ||
| ========================================= | ||
|
|
||
| Use MetPy to access machine learning weather prediction (MLWP) data in AWS S3 and plot using | ||
| the simplified plotting interface. | ||
| """ | ||
| from datetime import datetime | ||
|
|
||
| from metpy.plots import MapPanel, PanelContainer, RasterPlot | ||
| from metpy.remote import MLWPArchive | ||
|
|
||
| ################### | ||
| # Access the GraphCast forecast closest to the desired date/time | ||
| dt = datetime(2025, 2, 15, 18) | ||
| ds = MLWPArchive().get_product('graphcast', dt).access() | ||
|
|
||
| ################### | ||
| # Plot the data using MetPy's simplified plotting interface. | ||
| raster = RasterPlot() | ||
| raster.data = ds | ||
| raster.field = 't2' | ||
| raster.time = dt | ||
| raster.colorbar = 'horizontal' | ||
| raster.colormap = 'RdBu_r' | ||
|
|
||
| panel = MapPanel() | ||
| panel.area = 'co' | ||
| panel.projection = 'lcc' | ||
| panel.layers = ['coastline', 'borders', 'states'] | ||
| panel.plots = [raster] | ||
| panel.title = f"{ds[raster.field].attrs['long_name']} @ {dt}" | ||
|
|
||
| pc = PanelContainer() | ||
| pc.size = (8, 8) | ||
| pc.panels = [panel] | ||
| pc.draw() | ||
|
|
||
| pc.show() |
This file contains hidden or 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
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.