### Go Web Server Example Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/_sources/user_guide/notebooks/DEMO_rgb_Color-IR_Overlay.ipynb.txt A basic Go web server setup. This snippet is useful for understanding HTTP request handling and response generation in Go. It requires the `net/http` package. ```go package main import ( "fmt" "net/http" ) func handler(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello from Go Web Server!") } func main() { http.HandleFunc("/", handler) fmt.Println("Server starting on port 8080...") http.ListenAndServe(":8080", nil) } ``` -------------------------------- ### Install GOES-2-Go with Pip Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/index.html Install the latest published version of the goes2go package using pip. ```bash pip install goes2go ``` -------------------------------- ### Install GOES-2-Go from Git Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/index.html Install the most recent changes of the goes2go package directly from its GitHub repository using pip. ```bash pip install git+https://github.com/blaylockbk/goes2go.git ``` -------------------------------- ### Install goes2go with Pip Source: https://github.com/blaylockbk/goes2go/blob/main/README.md Install the latest published version or the most recent changes from GitHub using pip. Ensure Python 3.8+ and other dependencies like Cartopy and MetPy are installed first. ```bash # Latest published version pip install goes2go # ~~ or~~ # Most recent changes pip install git+https://github.com/blaylockbk/goes2go.git ``` -------------------------------- ### Install goes2go with Pip Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/_sources/index.rst.txt Installs the goes2go package using pip. Ensure Python 3.8+ and other dependencies like Cartopy and MetPy are installed first. ```bash # Latest published version pip install goes2go # ~~ or ~~ # Most recent changes pip install git+https://github.com/blaylockbk/goes2go.git ``` -------------------------------- ### Import Required Libraries Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/doctrees/nbsphinx/user_guide/notebooks/mapping_GOES16_TrueColor_Cartopy.ipynb Initial setup importing libraries for data manipulation, projection, and visualization. ```python import numpy as np from datetime import datetime, timedelta from pyproj import Proj import xarray import matplotlib.pyplot as plt import cartopy.crs as ccrs import cartopy.feature as cfeature import os import sys ``` -------------------------------- ### Install goes2go with Conda Source: https://github.com/blaylockbk/goes2go/blob/main/README.md Install the goes2go package and its dependencies using Conda from the conda-forge channel. ```bash conda install -c conda-forge goes2go ``` -------------------------------- ### Install GOES-2-Go with Mamba Source: https://github.com/blaylockbk/goes2go/blob/main/docs/index.md Install the goes2go package using the mamba package manager from the conda-forge channel. ```bash mamba install -c conda-forge goes2go ``` -------------------------------- ### Retrieve GOES Data Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/_sources/user_guide/notebooks/Solar_Data.ipynb.txt Example demonstrating how to fetch GOES satellite data using the library. ```python 6mR5tFitzHfF6TRp3F5QwavahH77Klw5sM/tpFf3o1YvKDy3LnbroXNFyGpEu1+i90TtSQNhd27GhkrqeRMlduXDhIL5hk8EGZNXCGsS7yY0BjOO8wL+jiadkktl8d8RD0KpiMYyZvUex0ubUgTUgVxj0pf1uZExqIzLM3wk0n0Z00iukpUdwc5nx61iXkUfIpK3rb4eZ+HBwdtYjrsnQ5wTYtAV+DCBi/ThmDnhMkPu1WGmKDeJ2E6sFysptHjo5YwAU3ikbEkDw5nWB+uoSNgMZiXWRPzYzgOeWGyWG5lVJrgwpo4aSlLo89D3rZoC3ho8Mlc0ODjBxcmeNfqHn5wvI6ganNlk5/lgTjPTeRp87tIthFpEl142G8NcDwrMVSQubRJ4exwHXGPyoq4yiFjlKmSxVlRH0VhcU1zEJ/wIEnw0oRDq8/gaEZmqKDw2SUqty7vw684dPgNorpLJbS+1suCQIGMCWuiBSK6yfp4hvdd18OirglGe0O8sK2JmzYeZ0nI4fImwRWNBl0hk/fNz+AIiU1rh6htyPHW5jzXt9lkLLevtSBgcOFZA7z8YhOTQ0G0sGAw76NvMsqOix5CPnYMSiXUq1Zw8L3PITo6TutN0uImIppF2pRIlBzOC8zHlEoUyeHX6vBpcbx6HI8SxrIzFI2xGZGy0Ax10+QcBGb1Rq66xF3unZZ51Mo+VO6dzkp/zGY/J2/wqkvap8uG3MpF7pTxhj/EhDhzkHEct1/3euyRRx5h8eLFdH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PA8bk1a7gwbdS3+2SMJQqGnK4SxaNOe+8i8fRO0IIR5/md6tXp452kpMt2jyFTmUdmvfDw7KHMlo7M1P0BJQWBQ0ubRjiI98aBCPIhgr6vzLP8U5MB3i/qEsdR5B0ZYJaS4Ny78cD7I+WI8qS9zXJ+jQahhyEljC4YIGH6tiAg86tR6JiC6za0ri5gUldidkRgsO17XYlGxBo09mrAiv5idQkIh7VZYF4kR0hVVaO3sTJd41T+Gug22cV+vKGR9MGeyf1ghrgqMZGU2G+UHYWCu4wr8cgOPGFM8kx1Flif3ZFBviFuviQV4x+hnKw48HJxjI2tgOHLD60GWZZ4wXXZDBtMy+lMwjoxlG8g4baj3kLcFU0SbrGGRMh7Sc4ZVUFq8ic26dj7iuE/fKvJqArqDFfSdgbczhUFrFsOGj82r4SFsTz4/Wsbklxfp4lphus20MvApcuqGfrqDNBxcWAVgTLZI3NC5vtPngQocPdxoEVPB+4kJC8yy+t62LI9MSY3mHKUPlYEpQ4xGsiE0zmPdxUb3JxniR61sLNHotUqbEcEHluckgu6YknhwPMZnxYzoS24+0cl7XID9e+zSpkk7Aa3BsOkTgHQuwDHdId+glP4G7PkTygSnkl14+rY9IES8tC6dp9RkENQkhwCMFKYjpir/kjDFsx0BV/BWEZXm+pexnJ3OYneyHZR2nsmS0YU7y3KYb5hxXza1WDh5ln4RyeU6rgHyqYdUnk+W+ISZee1hTCIl9+/ZVRjDWr1/PnXfeOecyr2ec4/cd09PTQ11dHR/84AdZs2YNt99+O7ncXMb6arvrrru4/fbb+elPf8pPf/pTPvzhD/P1r3+d8847j5/85Cdv0H+Ma/4f ``` -------------------------------- ### Go Goroutine and Channel Example Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/_sources/user_guide/notebooks/DEMO_rgb_Color-IR_Overlay.ipynb.txt Demonstrates the use of goroutines and channels for concurrent programming in Go. This pattern is essential for building scalable and efficient applications. ```go package main import ( "fmt" "time" ) func worker(id int, jobs <-chan int, results chan<- string) { for j := range jobs { fmt.Printf("Worker %d started job %d\n", id, j) time.Sleep(time.Second) // Simulate work fmt.Printf("Worker %d finished job %d\n", id, j) results <- fmt.Sprintf("Job %d done by worker %d", j, id) } } func main() { numJobs := 5 jobs := make(chan int, numJobs) results := make(chan string, numJobs) // Start 3 workers for w := 1; w <= 3; w++ { go worker(w, jobs, results) } // Send jobs for j := 1; j <= numJobs; j++ { jobs <- j } close(jobs) // Collect results for a := 1; a <= numJobs; a++ { fmt.Println(<-results) } } ``` -------------------------------- ### Go Struct and Method Example Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/_sources/user_guide/notebooks/DEMO_rgb_Color-IR_Overlay.ipynb.txt Illustrates defining a struct and associated methods in Go. This is fundamental for object-oriented-like programming in Go. ```go package main import "fmt" type Rectangle struct { Width float64 Height float64 } func (r Rectangle) Area() float64 { return r.Width * r.Height } func main() { rect := Rectangle{Width: 10, Height: 5} fmt.Printf("Rectangle Area: %.2f\n", rect.Area()) } ``` -------------------------------- ### Check Cartopy version Source: https://github.com/blaylockbk/goes2go/blob/main/working_on_new_GOES_class.ipynb Import cartopy and verify the installed version. ```python import cartopy ``` ```python cartopy.__version__ ``` -------------------------------- ### Get Latest GOES G17 ABI Data Source: https://github.com/blaylockbk/goes2go/blob/main/docs/user_guide/notebooks/field-of-view_ABI.ipynb Use this function to fetch the most recent ABI data for the GOES-17 satellite. Ensure you have the necessary libraries installed. ```python g17 = goes_latest(satellite="G17", product="ABI") ``` -------------------------------- ### Get Latest GOES Satellite Data Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/doctrees/nbsphinx/user_guide/notebooks/field-of-view_ABI.ipynb Use this function to retrieve the latest available data for a specified GOES satellite and product. Ensure you have the necessary libraries installed. ```python g17 = goes_latest(satellite='G17', product='ABI') ``` -------------------------------- ### Initializing Color Products Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/doctrees/nbsphinx/user_guide/notebooks/DEMO_rgb_recipes.ipynb Creates TrueColor and NaturalColor objects from the downloaded GOES data. ```python # Original TrueColor tc = TrueColor(g, night_IR=False) # Rick Kohrs's Natural Color nc = NaturalColor(g, night_IR=False) ``` -------------------------------- ### Plot GLM FOV on Rectangular Grid Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/user_guide/notebooks/field-of-view_GLM_Edges.ipynb This code plots the GLM field-of-view on a rectangular grid, similar to the previous example but specifically for a rectangular projection. It uses `common_features` for map setup. ```python ax = common_features(crs=pc, figsize=[10,10], dark=True, OCEAN=True) ax.add_geometries([glm.FOV.full_disk], crs=glm.FOV.crs, facecolor='tab:green', edgecolor='k', alpha=0.3, linewidth=3) ax.add_geometries([glm.FOV.full_disk], crs=glm.FOV.crs, facecolor='none', edgecolor='tab:green', alpha=1, linewidth=3) thin=10 ax.scatter(g.G16_fov_lon.thin(thin), g.G16_fov_lat.thin(thin), color='w', label='G16', **kwargs) ``` -------------------------------- ### Plot winds on a PlateCarree map Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/user_guide/notebooks/DEMO_derived_motion_winds.html Plots the derived motion winds on a PlateCarree map projection. Uses common_features for map setup and barbs for wind plotting. Ensure Cartopy is installed for map projections. ```python # Plot winds on a PlateCarree map ax = common_features("10m", dark=True, figsize=[15, 10], STATES=True) ax.barbs( gwnd.lon, gwnd.lat, ``` -------------------------------- ### List GOES ABI-L2-MCMIPM Files Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/user_guide/notebooks/issues/issue5.html Lists files for the GOES ABI-L2-MCMIPM product for a specific date and hour. Ensure the 'fs' object is initialized and the satellite, product, and date variables are correctly set. ```python 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110930571_e20212110931034_c20212110931127.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110931571_e20212110932039_c20212110932109.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110932571_e20212110933028_c20212110933117.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110933571_e20212110934028_c20212110934115.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110934571_e20212110935034_c20212110935115.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110935571_e20212110936034_c20212110936118.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110936571_e20212110937034_c20212110937119.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110937571_e20212110938034_c20212110938115.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110938571_e20212110939028_c20212110939124.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110939571_e20212110940029_c20212110940279.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110940571_e20212110941034_c20212110941128.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110941571_e20212110942034_c20212110942122.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110942571_e20212110943034_c20212110943118.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110943571_e20212110944034_c20212110944115.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110944571_e20212110945028_c20212110945114.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110945571_e20212110946028_c20212110946116.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110946571_e20212110947039_c20212110947118.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110947571_e20212110948034_c20212110948115.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110948571_e20212110949034_c20212110949125.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110949571_e20212110950034_c20212110950279.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110950571_e20212110951028_c20212110951127.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110951571_e20212110952039_c20212110952107.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110952571_e20212110953028_c20212110953116.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110953571_e20212110954034_c20212110954114.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110954571_e20212110955039_c20212110955115.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110955571_e20212110956034_c20212110956116.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110956571_e20212110957034_c20212110957118.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110957571_e20212110958034_c20212110958112.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110958571_e20212110959028_c20212110959121.nc', 'noaa-goes16/ABI-L2-MCMIPM/2021/211/09/OR_ABI-L2-MCMIPM2-M6_G16_s20212110959571_e20212111000029_c20212111000280.nc' ``` -------------------------------- ### Get GOES Data for a Time Range Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/goes2go.html Downloads GOES data within a specified time range (start and end datetimes) or a recent period. Supports various GOES satellites, products, and domains. Data can be returned as an xarray.Dataset or a file list. Local download is optional. ```python goes2go.data.goes_timerange(start=None, end=None, recent=None, _*_, satellite='goes17', product='GLM', domain='C', return_as='xarray', download=True, overwrite=False, download_dir=PosixPath('/p/home/blaylock/data'), max_cpus=None, keep_vars=[], drop_vars=[], verbose=True) ``` -------------------------------- ### Initialize RGB Recipes Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/user_guide/notebooks/DEMO_rgb_recipies copy 2.html Create RGB composite objects from the retrieved GOES dataset. ```python tc = TrueColor(g, night_IR=False) nc = NaturalColor(g, night_IR=False) ``` ```python RGB = RocketPlume(g, night=False) ``` -------------------------------- ### Import Dependencies Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/doctrees/nbsphinx/user_guide/notebooks/field-of-view_GLM_Edges.ipynb Initializes the environment with necessary libraries for data handling and visualization. ```python import xarray as xr import matplotlib.pyplot as plt import cartopy.crs as ccrs from BB_maps.add_to_cartopy import common_features, pc # this just needed to display facecolor as transparent in this notebook... import matplotlib as mpl mpl.rcParams['figure.facecolor'] = 'w' %config InlineBackend.print_figure_kwargs={'facecolor' : 'none'} ``` -------------------------------- ### Download GOES Data for a Time Range Source: https://github.com/blaylockbk/goes2go/blob/main/README.md Download GOES ABI Level 1b data for a specified start and end time. Initializes GOES with default settings. ```python G.timerange(start='2022-06-01 00:00', end='2022-06-01 01:00') ``` -------------------------------- ### Initialize GOES Object for ABI Product Source: https://github.com/blaylockbk/goes2go/blob/main/README.md Create a GOES object to specify the satellite, data product (ABI-L2-MCMIP), and domain (CONUS) for downloading data. ```python from goes2go import GOES # ABI Multi-Channel Cloud Moisture Imagry Product G = GOES(satellite=16, product="ABI-L2-MCMIP", domain='C') ``` -------------------------------- ### Importing Libraries Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/user_guide/notebooks/sandbox.html Initial imports required for data handling and RGB product generation. ```python import xarray as xr ``` ```python from goes2go.data import goes_latest from goes2go.rgb import * import goes2go.accessors ``` -------------------------------- ### Define Start and End Times for Data Retrieval Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/user_guide/notebooks/sandbox.html Specifies the start and end times for the desired data range. These strings are used to query the GOES satellite data. ```python start = '2021-01-01 00:30' end = '2021-01-01 01:30' ``` -------------------------------- ### Iterate Through RGB Products Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/doctrees/nbsphinx/user_guide/notebooks/DEMO_rgb_recipes.ipynb List available RGB products from a GOES dataset and initialize a figure for each. ```python rgb_products = [i for i in dir(G16.rgb) if i[0].isupper()] for product in rgb_products: fig = plt.figure(figsize=(15, 12)) ``` -------------------------------- ### Check Xarray Version Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/user_guide/notebooks/sandbox.html Verify the installed version of the xarray library. ```python import xarray xarray.__version__ ``` -------------------------------- ### Initialize GOES Object Source: https://github.com/blaylockbk/goes2go/blob/main/working_on_new_GOES_class.ipynb Displays the GOES class reference and initializes a specific satellite configuration. ```python GOES ``` ```python G = GOES(satellite=17, product="ABI-L2-CMIP", domain="F", bands=[13]) G ``` -------------------------------- ### Create Conda Environment for goes2go Source: https://github.com/blaylockbk/goes2go/blob/main/README.md Download the environment.yml file, create a Conda environment, and activate it to use goes2go. ```bash # Download environment file wget https://github.com/blaylockbk/goes2go/raw/main/environment.yml # Modify that file if you wish. # Create the environment conda env create -f environment.yml # Activate the environment conda activate goes2go ``` -------------------------------- ### Cartopy Style Warning Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/user_guide/notebooks/DEMO_rgb_recipes.html Example of a UserWarning encountered when using cartopy with matplotlib. ```python /p/home/blaylock/anaconda3/envs/goes2go/lib/python3.8/site-packages/cartopy/mpl/style.py:90: UserWarning: facecolor will have no effect as it has been defined as "never". warnings.warn('facecolor will have no effect as it has been ') ``` -------------------------------- ### Example Figure Size Output Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/doctrees/nbsphinx/user_guide/notebooks/DEMO_total-precipitable-water.ipynb Indicates the resulting figure size after plotting. ```text Result:
``` -------------------------------- ### GET /goes2go/metrics Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/user_guide/notebooks/DEMO_download_goes_latest.html Retrieves statistical reflectance metrics for GOES-R imager bands. ```APIDOC ## GET /goes2go/metrics ### Description Retrieves calculated statistical metrics for GOES-R imager bands, including reflectance factors and outlier counts. ### Method GET ### Endpoint /goes2go/metrics ### Response #### Success Response (200) - **mean_reflectance_factor_C05** (float32) - Mean reflectance factor value of band 5 pixels. - **std_dev_reflectance_factor_C05** (float32) - Standard deviation of reflectance factor values of band 5 pixels. - **outlier_pixel_count_C06** (float64) - Number of band 6 cloud and moisture imagery pixels outside valid range. - **min_reflectance_factor_C06** (float32) - Minimum reflectance factor value of band 6 pixels. - **max_reflectance_factor_C06** (float32) - Maximum reflectance factor value of band 6 pixels. - **mean_reflectance_factor_C06** (float32) - Mean reflectance factor value of band 6 pixels. - **std_dev_reflectance_factor_C06** (float32) - Standard deviation of reflectance factor values of band 6 pixels. #### Response Example { "mean_reflectance_factor_C05": 0.000156, "std_dev_reflectance_factor_C05": 0.000324, "outlier_pixel_count_C06": 0.0, "min_reflectance_factor_C06": 0.0, "max_reflectance_factor_C06": 0.038119, "mean_reflectance_factor_C06": 8.81e-05 } ``` -------------------------------- ### Get Lat/Lon Coordinates Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/reference_guide/index.html Retrieves the latitude and longitude of all points within the dataset. ```python get_latlon() ``` -------------------------------- ### List GOES ABI-L2-MCMIPF Files Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/user_guide/notebooks/issues/issue5.html Lists files for the GOES ABI-L2-MCMIPF product for a specific date and hour. This function is similar to the MCMIPM listing but targets a different product. ```python 'noaa-goes16/ABI-L2-MCMIPF/2021/211/09/OR_ABI-L2-MCMIPF-M6_G16_s20212110900227_e20212110909535_c20212110910039.nc', 'noaa-goes16/ABI-L2-MCMIPF/2021/211/09/OR_ABI-L2-MCMIPF-M6_G16_s20212110910227_e20212110919546_c20212110920040.nc', 'noaa-goes16/ABI-L2-MCMIPF/2021/211/09/OR_ABI-L2-MCMIPF-M6_G16_s20212110920227_e20212110929546_c20212110930039.nc', 'noaa-goes16/ABI-L2-MCMIPF/2021/211/09/OR_ABI-L2-MCMIPF-M6_G16_s20212110930227_e20212110939540_c20212110940039.nc', 'noaa-goes16/ABI-L2-MCMIPF/2021/211/09/OR_ABI-L2-MCMIPF-M6_G16_s20212110940227_e20212110949546_c20212110950041.nc', 'noaa-goes16/ABI-L2-MCMIPF/2021/211/09/OR_ABI-L2-MCMIPF-M6_G16_s20212110950227_e20212110959535_c20212111000039.nc' ``` -------------------------------- ### Visualize Data with Matplotlib Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/user_guide/notebooks/issues/issue7.ipynb Setup and plot a mesh grid using Matplotlib. ```python import matplotlib.pyplot as plt import numpy as np ``` ```python x, y = np.meshgrid(G.x, G.y) plt.pcolormesh(x, y, x*y) ``` -------------------------------- ### GOES Class Initialization Source: https://github.com/blaylockbk/goes2go/blob/main/docs/reference_guide/index.md Initializes a GOES object for a desired satellite and product, setting up parameters for data retrieval. ```APIDOC ## GOES Class Initialization ### Description Initialize a GOES object for a desired satellite and product. ### Method __init__ ### Endpoint N/A (Class constructor) ### Parameters #### Path Parameters N/A #### Query Parameters - **satellite** (int or str) - The satellite number (16, 17, 18) or its alias ('G16', 'G17', 'EAST', 'WEST'). Defaults to 'noaa-goes19'. - **product** (str) - The product to acquire (e.g., 'ABI', 'GLM'). A full list is available in the product table. Defaults to 'ABI-L2-MCMIP'. - **domain** (str or None) - The ABI scan region ('F', 'C', 'M', 'M1', 'M2'). Only needed for ABI products. Defaults to 'C'. - **bands** (int, list, or None) - Specify ABI channels to retrieve. Only used if the product has unique bands. Defaults to None. - **channel** (int, list, or None) - Alias for the 'bands' argument. If provided, 'bands' is ignored. Defaults to None. ### Request Example ```python from goes2go.NEW import GOES goes_object = GOES( satellite=16, product='GLM', domain=None ) ``` ### Response #### Success Response (200) - **GOES object** - An initialized GOES object with specified parameters. ``` -------------------------------- ### Initialize Geostationary Projection Source: https://github.com/blaylockbk/goes2go/blob/main/docs/user_guide/notebooks/field-of-view_GLM.ipynb Sets up the coordinate reference system for the GOES satellite at a specific longitude and height. ```python from shapely.geometry import Point, Polygon sat_h = 35786023 nadir_lon = -89.5 nadir_lat = 0 resolution = 60 crs_central = ccrs.Geostationary(central_longitude=nadir_lon, satellite_height=sat_h) ``` -------------------------------- ### Handle Variable Lookup Errors Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/user_guide/notebooks/issues/issue7.html Example of a KeyError occurring during variable dictionary access. ```python 172 else: --> 173 ref_var = variables[ref_name] 174 175 if var_name is None: KeyError: 'CMI_C01' ``` -------------------------------- ### GET /reflectance_statistics Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/user_guide/notebooks/issues/discussion10.html Retrieves statistical reflectance data for specific GOES imagery bands. ```APIDOC ## GET /reflectance_statistics ### Description Retrieves calculated statistical metrics for GOES imagery bands, including reflectance factor bounds and distribution statistics. ### Method GET ### Endpoint /reflectance_statistics ### Response #### Success Response (200) - **min_reflectance_factor_C01** (float64) - Minimum reflectance factor value of band 1 pixels. - **max_reflectance_factor_C01** (float64) - Maximum reflectance factor value of band 1 pixels. - **mean_reflectance_factor_C01** (float64) - Mean reflectance factor value of band 1 pixels. - **std_dev_reflectance_factor_C01** (float64) - Standard deviation of reflectance factor values of band 1 pixels. - **outlier_pixel_count_C02** (float64) - Number of band 2 pixels outside valid measurement range. - **min_reflectance_factor_C02** (float64) - Minimum reflectance factor value of band 2 pixels. - **max_reflectance_factor_C02** (float64) - Maximum reflectance factor value of band 2 pixels. #### Response Example { "min_reflectance_factor_C01": 0.0000784, "max_reflectance_factor_C01": 0.9992, "mean_reflectance_factor_C01": 0.2592, "std_dev_reflectance_factor_C01": 0.1666, "outlier_pixel_count_C02": 0.0, "min_reflectance_factor_C02": 0.0, "max_reflectance_factor_C02": 0.9938 } ``` -------------------------------- ### List GOES Files by Date Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/_sources/user_guide/notebooks/issues/issue5.ipynb.txt Lists files in the specified satellite and product directory for a given datetime. Requires a pre-configured filesystem object 'fs'. ```python DATE = pd.to_datetime('2021-07-30 9:00') fs.ls(f"{satellite}/{product}/{DATE:%Y/%j/%H/}") ``` ```python fs.ls(f"{satellite}/{product}/{DATE:%Y/%j/%H/}", refresh=True) ``` -------------------------------- ### Initialize GOES Object for ABI Level 1b Data Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/index.html Create a GOES object to specify the satellite, data product (ABI Level 1b Radiance), and domain (Full Disk). ```python G = GOES(satellite=17, product="ABI-L1b-Rad", domain='F') ``` -------------------------------- ### GET /satellite/metrics Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/user_guide/notebooks/issues/discussion10.html Retrieves statistical brightness temperature metrics for GOES satellite bands. ```APIDOC ## GET /satellite/metrics ### Description Retrieves statistical metrics such as min, max, mean, and standard deviation for top of atmosphere brightness temperatures for specific bands. ### Method GET ### Endpoint /satellite/metrics ### Response #### Success Response (200) - **min_brightness_temperature_C08** (float32) - Minimum brightness temperature for band 8 (K) - **max_brightness_temperature_C08** (float32) - Maximum brightness temperature for band 8 (K) - **mean_brightness_temperature_C08** (float32) - Mean brightness temperature for band 8 (K) - **std_dev_brightness_temperature_C08** (float32) - Standard deviation of brightness temperature for band 8 (K) - **outlier_pixel_count_C09** (float64) - Count of pixels outside valid range for band 9 - **min_brightness_temperature_C09** (float32) - Minimum brightness temperature for band 9 (K) - **max_brightness_temperature_C09** (float32) - Maximum brightness temperature for band 9 (K) - **mean_brightness_temperature_C09** (float32) - Mean brightness temperature for band 9 (K) #### Response Example { "min_brightness_temperature_C08": 189.52, "max_brightness_temperature_C08": 266.03, "mean_brightness_temperature_C08": 236.33, "std_dev_brightness_temperature_C08": 8.13, "outlier_pixel_count_C09": 0.0, "min_brightness_temperature_C09": 187.90, "max_brightness_temperature_C09": 281.75 } ``` -------------------------------- ### Initialize GOES Object for Data Download Source: https://github.com/blaylockbk/goes2go/blob/main/docs/index.md Create a GOES object to specify the satellite, data product, and domain for downloading NetCDF files. Ensure the correct satellite, product, and domain are selected for your needs. ```python from goes2go import GOES # ABI Multi-Channel Cloud Moisture Imagry Product G = GOES(satellite=16, product="ABI-L2-MCMIP", domain='C') ``` ```python # Geostationary Lightning Mapper G = GOES(satellite=17, product="GLM-L2-LCFA", domain='C') ``` ```python # ABI Level 1b Data G = GOES(satellite=17, product="ABI-L1b-Rad", domain='F') ``` -------------------------------- ### Get Y Coordinate Property Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/reference_guide/index.html Retrieves the y sweep in CRS units (meters), calculated as y * sat_height. ```python y ``` -------------------------------- ### Get coordinate reference system Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/doctrees/nbsphinx/user_guide/notebooks/DEMO_total-precipitable-water.ipynb Extract the projection and coordinate arrays for the TPW variable. ```python crs, x, y = abi_crs(ds, 'TPW') ``` -------------------------------- ### Iterating and Plotting All RGB Recipes Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/user_guide/notebooks/DEMO_rgb_recipes.html Dynamically discover and plot all available RGB products for GOES datasets. ```python rgb_products = [i for i in dir(G16.rgb) if i[0].isupper()] for product in rgb_products: fig = plt.figure(figsize=(15, 12)) ax17 = fig.add_subplot(1, 2, 1, projection=G17.rgb.crs) ax16 = fig.add_subplot(1, 2, 2, projection=G16.rgb.crs) for ax, G in zip([ax17, ax16], [G17, G16]): RGB = getattr(G.rgb, product)() common_features('50m', STATES=True, ax=ax) ax.imshow(RGB, **G.rgb.imshow_kwargs) ax.set_title(f"{G.orbital_slot} {product}", loc='left', fontweight='bold') ax.set_title(f"{G.t.dt.strftime('%H:%M UTC %d-%b-%Y').item()}", loc="right") plt.subplots_adjust(wspace=0.01) plt.savefig(f'../docs/_static/{product}', bbox_inches='tight') ``` -------------------------------- ### Handle Attribute Errors Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/user_guide/notebooks/issues/issue7.ipynb Examples of failed attribute access on DataArray or MetPy accessor objects. ```python _.x ``` ```python G.metpy.cartopy_crs ``` -------------------------------- ### Show File System Structure Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/doctrees/nbsphinx/user_guide/notebooks/DEMO_download_goes_latest.ipynb Use the `tree` command in bash to visualize the directory structure of the downloaded data on your home drive. This helps in locating and managing downloaded files. ```bash tree ~/data ``` -------------------------------- ### Locate configuration file Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/_sources/user_guide/defaults.md.txt The configuration file is automatically created upon the first import of the library. ```bash ~/.config/goes2go/config.confg ``` -------------------------------- ### Get imshow arguments Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/html/reference_guide.html Determines the correct plt.imshow arguments including image extent limits. ```python goes2go.rgb.get_imshow_kwargs(ds) ``` ```python >>> r = TrueColor(G) >>> ax = common_features(r.crs) >>> ax.imshow(r.TrueColor, **get_imshow_kwargs(r)) ``` -------------------------------- ### Retrieving ABI CRS details Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/doctrees/nbsphinx/user_guide/notebooks/issues/issue7.ipynb Getting the full CRS and coordinate arrays for the ABI dataset. ```python abi_crs(G) ``` -------------------------------- ### List Available RGB Products Source: https://github.com/blaylockbk/goes2go/blob/main/docs/user_guide/notebooks/DEMO_rgb_recipes_docs.ipynb Identify available RGB product methods by inspecting the attributes of the GOES RGB object. ```python rgb_products = [i for i in dir(G16.rgb) if i[0].isupper()] rgb_products ``` -------------------------------- ### Initialize GOES Data Access and Load Latest Data Source: https://github.com/blaylockbk/goes2go/blob/main/docs/user_guide/notebooks/GOES-19.ipynb Initialize the GOES object for a specific satellite and product, then load the latest available dataset. This is useful for obtaining near real-time satellite imagery. ```python G = GOES(satellite=19, product="ABI-L2-MCMIP", domain="C") ds = G.latest() ds ``` -------------------------------- ### List GOES Files Source: https://github.com/blaylockbk/goes2go/blob/main/docs/_build/doctrees/nbsphinx/user_guide/notebooks/issues/issue5.ipynb Lists files for a specific satellite and product using a formatted date string. ```python fs.ls(f"{satellite}/{product}/{DATE:%Y/%j/%H/}", refresh=True) ```