Skip to content

Instantly share code, notes, and snippets.

@jpv001
Created November 29, 2022 16:11
Show Gist options
  • Save jpv001/d40cbfddb3f3086d0c82c62cdabcd2e5 to your computer and use it in GitHub Desktop.
Save jpv001/d40cbfddb3f3086d0c82c62cdabcd2e5 to your computer and use it in GitHub Desktop.
Inspect NEXRAD Level II file on AWS
import boto3
import botocore
from botocore.client import Config
import matplotlib.pyplot as plt
from metpy.io import Level2File
from metpy.plots import add_timestamp, ctables
from mpl_toolkits.axes_grid1 import make_axes_locatable
import numpy as np
s3 = boto3.resource('s3', config=Config(signature_version=botocore.UNSIGNED,
user_agent_extra='Resource'))
bucket = s3.Bucket('noaa-nexrad-level2')
for obj in bucket.objects.filter(Prefix='2019/06/26/KVWX/KVWX20190626_221105_V06'):
print(obj.key)
# Use MetPy to read the file
f = Level2File(obj.get()['Body'])
print(f.sweeps[0][0])
print(f.sweeps[4][0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment