Data are accessible via an object store system, which enables easy, scalable web access!
Imports¶
import fsspec
import urllib.request
from pathlib import Path
import xradar as xd
import pyart
## You are using the Python ARM Radar Toolkit (Py-ART), an open source
## library for working with weather radar data. Py-ART is partly
## supported by the U.S. Department of Energy as part of the Atmospheric
## Radiation Measurement (ARM) Climate Research Facility, an Office of
## Science user facility.
##
## If you use this software to prepare a publication, please cite:
##
## JJ Helmus and SM Collis, JORS 2016, doi: 10.5334/jors.119
Find Data in the Bucket¶
It is stored on the jetstream cloud bucket, under the /pythia/radar/ams2025
space.
# Set the URL and path for the cloud
URL = "https://js2.jetstream-cloud.org:8001/"
path = f"pythia/radar/ams2025"
fs = fsspec.filesystem("s3",
anon=True,
client_kwargs=dict(endpoint_url=URL))
fs.glob(f"{path}/*")
['pythia/radar/ams2025/CalgaryHailStorm2024',
'pythia/radar/ams2025/OntarioDerecho2022']
Find Data to Stream¶
We can easily stream the data with xradar
files = fs.glob("pythia/radar/ams2025/OntarioDerecho2022/*")[:1]
files
[]
local_files = [
fsspec.open_local(
f"simplecache::{URL}{i}", s3={"anon": True}, filecache={"cache_storage": "."}
)
for i in files
]
dt = xd.io.open_odim_datatree(local_files[0])
radar = dt.pyart.to_radar()
radar
Loading...
Download the Data Locally¶
We can also use the url of the data to download the data locally if neccessary!
for file in files:
urllib.request.urlretrieve(f"{URL}{file}", Path(file).name)