-
Notifications
You must be signed in to change notification settings - Fork 422
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Add client for NOAA/CIRA MLWP archive
- Loading branch information
1 parent
69e7e8a
commit 57abab6
Showing
4 changed files
with
341 additions
and
1 deletion.
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,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.remote import MLWPArchive | ||
from metpy.plots import MapPanel, PanelContainer, RasterPlot | ||
|
||
################### | ||
# Access the GraphCast forecast closest to the desired date/time | ||
dt = datetime(2025, 2, 15, 18) | ||
ds = MLWPArchive().get_product('graphcast', dt).parse() | ||
|
||
################### | ||
# 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 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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