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
Find Data in the Bucket¶
It is stored on the jetstream cloud bucket, under the /pythia/radar/erad2024
space.
# Set the URL and path for the cloud
URL = "https://js2.jetstream-cloud.org:8001/"
path = f"pythia/radar/erad2024"
fs = fsspec.filesystem("s3", anon=True, client_kwargs=dict(endpoint_url=URL))
fs.glob(f"{path}/*")
Find Data to Stream¶
We can easily stream the data with xradar
files = fs.glob("pythia/radar/erad2024/dda_data/*")[: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_cfradial1_datatree(local_files[0])
radar = pyart.io.read_cfradial(local_files[0])
dt
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)