Note
Go to the end to download the full example code.
Remote Data Access#
Use MetPy to access data hosted in known AWS S3 buckets
['FTG_N0B_2022_10_30_15_00_36', 'FTG_N0B_2022_10_30_15_07_35', 'FTG_N0B_2022_10_30_15_14_35', 'FTG_N0B_2022_10_30_15_21_35', 'FTG_N0B_2022_10_30_15_28_35', 'FTG_N0B_2022_10_30_15_35_35', 'FTG_N0B_2022_10_30_15_42_35', 'FTG_N0B_2022_10_30_15_49_36', 'FTG_N0B_2022_10_30_15_56_36', 'FTG_N0B_2022_10_30_16_03_35', 'FTG_N0B_2022_10_30_16_10_35', 'FTG_N0B_2022_10_30_16_17_34', 'FTG_N0B_2022_10_30_16_24_34', 'FTG_N0B_2022_10_30_16_31_34', 'FTG_N0B_2022_10_30_16_39_44', 'FTG_N0B_2022_10_30_16_46_43', 'FTG_N0B_2022_10_30_16_53_42']
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()
Total running time of the script: (0 minutes 8.345 seconds)