
This notebook is developed during the pythia cook-off at NCAR Mesa-Lab Boulder Colorado, June 12-14, 2024
Participants in the workshop event have the chance to practice collaborative problem-solving and hands-on learning in the field of Python programming.
This notebook is part of the Breakout Topic: Geostationary on AWS, lead by Jorge Humberto Bravo Mendez jbravo2@stevens.edu, from Stevens Institute of Technology
Advance Meteorological Imager (AMI) data with Satpy¶
Using Satpy to read and Advanced Baseline Imager (ABI) data from GOES-R satellites. Here’s a step-by-step guide:
Imports¶
import warnings
warnings.filterwarnings('ignore')
warnings.simplefilter('ignore', SyntaxWarning)
from satpy.scene import Scene
from satpy.utils import debug_on
from datetime import datetime
from glob import glob
Starting to create satpy scenes¶
sat_files = glob("input/GK2A_AMI_L1B_LA/*")
sat_files
['input/GK2A_AMI_L1B_LA/gk2a_ami_le1b_ir105_la020ge_202308090034.nc',
'input/GK2A_AMI_L1B_LA/gk2a_ami_le1b_ir133_la020ge_202308090034.nc',
'input/GK2A_AMI_L1B_LA/gk2a_ami_le1b_ir087_la020ge_202308090034.nc',
'input/GK2A_AMI_L1B_LA/gk2a_ami_le1b_sw038_la020ge_202308090034.nc',
'input/GK2A_AMI_L1B_LA/gk2a_ami_le1b_ir096_la020ge_202308090034.nc',
'input/GK2A_AMI_L1B_LA/gk2a_ami_le1b_wv069_la020ge_202308090034.nc',
'input/GK2A_AMI_L1B_LA/gk2a_ami_le1b_wv063_la020ge_202308090034.nc',
'input/GK2A_AMI_L1B_LA/gk2a_ami_le1b_ir112_la020ge_202308090034.nc',
'input/GK2A_AMI_L1B_LA/gk2a_ami_le1b_ir123_la020ge_202308090034.nc',
'input/GK2A_AMI_L1B_LA/gk2a_ami_le1b_wv073_la020ge_202308090034.nc',
'input/GK2A_AMI_L1B_LA/gk2a_ami_le1b_vi005_la010ge_202308090034.nc',
'input/GK2A_AMI_L1B_LA/gk2a_ami_le1b_vi006_la005ge_202308090034.nc',
'input/GK2A_AMI_L1B_LA/gk2a_ami_le1b_nr013_la020ge_202308090034.nc',
'input/GK2A_AMI_L1B_LA/gk2a_ami_le1b_vi008_la010ge_202308090034.nc',
'input/GK2A_AMI_L1B_LA/gk2a_ami_le1b_nr016_la020ge_202308090034.nc',
'input/GK2A_AMI_L1B_LA/gk2a_ami_le1b_vi004_la010ge_202308090034.nc']
scn = Scene(filenames = sat_files, reader='ami_l1b')
dataset_names = scn.all_dataset_names()
print(dataset_names)
['IR087', 'IR096', 'IR105', 'IR112', 'IR123', 'IR133', 'NR013', 'NR016', 'SW038', 'VI004', 'VI005', 'VI006', 'VI008', 'WV063', 'WV069', 'WV073']
scn.load(dataset_names)
print(scn.available_composite_names())
['airmass', 'ash', 'cloud_phase_distinction', 'cloud_phase_distinction_raw', 'convection', 'day_microphysics_eum', 'green', 'green_nocorr', 'green_raw', 'hybrid_green', 'hybrid_green_nocorr', 'hybrid_green_raw', 'ir_cloud_day', 'mid_vapor', 'natural_color', 'natural_color_nocorr', 'natural_color_raw', 'ndvi_hybrid_green', 'ndvi_hybrid_green_raw', 'night_ir_alpha', 'night_ir_with_background', 'night_ir_with_background_hires', 'overview', 'rocket_plume_day', 'rocket_plume_night', 'true_color', 'true_color_nocorr', 'true_color_raw', 'true_color_reproduction', 'true_color_reproduction_corr', 'true_color_reproduction_uncorr', 'true_color_with_night_ir', 'true_color_with_night_ir_hires', 'water_vapors1', 'water_vapors2']
rgb_im = 'airmass'
scn.load([rgb_im])
### Uncomment to show it
#scn.show(rgb_im)
result = scn[rgb_im]
result
Loading...
keys = scn.keys()
keys
[DataID(name='IR087', wavelength=WavelengthRange(min=8.415, central=8.59, max=8.765, unit='µm'), resolution=2000, calibration=<2>, modifiers=()),
DataID(name='IR096', wavelength=WavelengthRange(min=9.43, central=9.62, max=9.81, unit='µm'), resolution=2000, calibration=<2>, modifiers=()),
DataID(name='IR105', wavelength=WavelengthRange(min=10.115, central=10.35, max=10.585, unit='µm'), resolution=2000, calibration=<2>, modifiers=()),
DataID(name='IR112', wavelength=WavelengthRange(min=10.9, central=11.23, max=11.56, unit='µm'), resolution=2000, calibration=<2>, modifiers=()),
DataID(name='IR123', wavelength=WavelengthRange(min=11.805, central=12.36, max=12.915, unit='µm'), resolution=2000, calibration=<2>, modifiers=()),
DataID(name='IR133', wavelength=WavelengthRange(min=13.005, central=13.29, max=13.575, unit='µm'), resolution=2000, calibration=<2>, modifiers=()),
DataID(name='NR013', wavelength=WavelengthRange(min=1.363, central=1.37, max=1.377, unit='µm'), resolution=2000, calibration=<1>, modifiers=()),
DataID(name='NR016', wavelength=WavelengthRange(min=1.59, central=1.61, max=1.63, unit='µm'), resolution=2000, calibration=<1>, modifiers=()),
DataID(name='SW038', wavelength=WavelengthRange(min=3.74, central=3.83, max=3.92, unit='µm'), resolution=2000, calibration=<2>, modifiers=()),
DataID(name='VI004', wavelength=WavelengthRange(min=0.45, central=0.47, max=0.49, unit='µm'), resolution=1000, calibration=<1>, modifiers=()),
DataID(name='VI005', wavelength=WavelengthRange(min=0.495, central=0.509, max=0.523, unit='µm'), resolution=1000, calibration=<1>, modifiers=()),
DataID(name='VI006', wavelength=WavelengthRange(min=0.599, central=0.639, max=0.679, unit='µm'), resolution=500, calibration=<1>, modifiers=()),
DataID(name='VI008', wavelength=WavelengthRange(min=0.846, central=0.863, max=0.88, unit='µm'), resolution=1000, calibration=<1>, modifiers=()),
DataID(name='WV063', wavelength=WavelengthRange(min=5.79, central=6.21, max=6.63, unit='µm'), resolution=2000, calibration=<2>, modifiers=()),
DataID(name='WV069', wavelength=WavelengthRange(min=6.74, central=6.94, max=7.14, unit='µm'), resolution=2000, calibration=<2>, modifiers=()),
DataID(name='WV073', wavelength=WavelengthRange(min=7.24, central=7.33, max=7.42, unit='µm'), resolution=2000, calibration=<2>, modifiers=()),
DataID(name='airmass', resolution=2000)]
area_info = scn['IR133'].area
area_info
Loading...
scn.load(["natural_color"])
The following datasets were not created and may require resampling to be generated: DataID(name='natural_color')
rs = scn['IR133'].area
lscn = scn.resample(rs)
lscn.load(["natural_color"])
### Uncomment to show it
#lscn.show("natural_color")
lscn.load(['true_color'])
### Uncomment to show it
#lscn.show('true_color')
0%| | 0/52 [00:00<?, ?kB/s]
100%|██████████| 52/52 [00:00<00:00, 1450.09kB/s]
No rsr file /home/runner/.local/share/pyspectral/rsr_ami_GEO-KOMPSAT-2A.h5 on disk
0%| | 0/5 [00:00<?, ?kB/s]
6kB [00:00, 1349.45kB/s]