Mosaicing and Subsecting RGB’s Sectors From GNC-A

GOES-16 RGB cut.gif

This is a follow up to the previous post on GNC-A RGB’s.

The script below will join all the eight sectors received on the GOES-R-RGB-Composites and extract only the selected extent.


# Required libraries
from osgeo import gdal, osr, ogr  # Import GDAL
import os                         # Miscellaneous operating system interfaces
import sys                        # Import the "system specific parameters and functions" module

# Desired Extent
extent = [float(sys.argv[2]), float(sys.argv[3]), float(sys.argv[4]), float(sys.argv[5])]

# Define KM_PER_DEGREE
KM_PER_DEGREE = 111.32

# Calculate the total number of degrees in lat and lon
deg_lon = extent[2] - extent[0]
deg_lat = extent[3] - extent[1]

# Calculate the number of pixels
resolution = 2
width = (KM_PER_DEGREE * deg_lon) /  resolution
height = (KM_PER_DEGREE * deg_lat) /  resolution

# Path to the GOES-16 RGB file (Sector 07 is the last sector received)
path_S07 = sys.argv[1]
path_FDK = sys.argv[1].replace("S07", "FDK")
path_S01 = sys.argv[1].replace("S07", "S01")
path_S02 = sys.argv[1].replace("S07", "S02")
path_S03 = sys.argv[1].replace("S07", "S03")
path_S04 = sys.argv[1].replace("S07", "S04")
path_S05 = sys.argv[1].replace("S07", "S05")
path_S06 = sys.argv[1].replace("S07", "S06")

# File output name
path_out = sys.argv[1].replace("S07", "RGB")

# Create the mosaic and cut
grid = gdal.Warp(path_out,[path_FDK, path_S01, path_S02, path_S03, path_S04, path_S05, path_S06, path_S07],options=gdal.WarpOptions(outputBounds = [extent[0], extent[1], extent[2], extent[3]]))
grid = None

The RGB’s may be found on the new GOES-R-RGB-Composites GNC-A ingestion folder:

Folder.png

GNC_GOES-r.png