CROCUS Lake Breeze (May 7th, 2023)#

  • Lake Breeze are winds that blow off of Lake Michigan on shore due to difference in temperature between the lake and the shoreline.

  • While providing some relief from the heat during the Spring/Summer, these winds also can trap pollutants (in gas and particle form) at the surface creating unsafe air quality conditions.

  • With an unstable atmosphere, these lake breeze circulations can also initiate convection (i.e. vertically building clouds) and produce thunderstorms as was the case on 7 May 2023.

import glob
import os
import tempfile
import warnings
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import cartopy.crs as ccrs
import cartopy.feature as cfeature

from math import atan2 as atan2
from datetime import datetime

from metpy.plots import USCOUNTIES
from metpy.calc import dewpoint_from_relative_humidity
from metpy.units import units
import imageio
import pyart
import nexradaws

import sage_data_client

templocation = tempfile.mkdtemp()

warnings.filterwarnings("ignore")
## You are using the Python ARM Radar Toolkit (Py-ART), an open source
## library for working with weather radar data. Py-ART is partly
## supported by the U.S. Department of Energy as part of the Atmospheric
## Radiation Measurement (ARM) Climate Research Facility, an Office of
## Science user facility.
##
## If you use this software to prepare a publication, please cite:
##
##     JJ Helmus and SM Collis, JORS 2016, doi: 10.5334/jors.119

Define Time and Location of the Event#

DATE = "2023-05-07"
# Times must be in UTC
TIME_START = "16:00:00"
TIME_STOP = "21:00:00"
RADAR_ID = "KLOT"
## convert input date and time to timestamps
START = pd.Timestamp(int(DATE.split('-')[0]), 
                     int(DATE.split('-')[1]), 
                     int(DATE.split('-')[2]), 
                     int(TIME_START.split(':')[0]), 
                     int(TIME_START.split(':')[1]), 
                     int(TIME_START.split(':')[2])).tz_localize(tz="UTC")
STOP = pd.Timestamp(int(DATE.split('-')[0]), 
                    int(DATE.split('-')[1]), 
                    int(DATE.split('-')[2]), 
                    int(TIME_STOP.split(':')[0]), 
                    int(TIME_STOP.split(':')[1]), 
                    int(TIME_STOP.split(':')[2])).tz_localize(tz="UTC")
# Define the domain to display for Chicago
MIN_LON = -89.0
MAX_LON = -87.0
MAX_LAT = 42.5
MIN_LAT = 40.5
BOUNDING_BOX = [MIN_LON, MAX_LON, MIN_LAT, MAX_LAT]
# Define the CROCUS Waggle Nodes to Display
WAGGLE_SITES = {'NEIU'  : [41.980289109, -87.71703552],
                'ATMOS' : [41.701605152, -87.995196552]
               }

Define Helper Functions#

def gc_latlon_bear_dist(lat1, lon1, bear, dist):
    """
    Input lat1/lon1 as decimal degrees, as well as bearing and distance from
    the coordinate. Returns lat2/lon2 of final destination. Cannot be
    vectorized due to atan2.
    """
    re = 6371.1  # km
    lat1r = np.deg2rad(lat1)
    lon1r = np.deg2rad(lon1)
    bearr = np.deg2rad(bear)
    lat2r = np.arcsin(
        (np.sin(lat1r) * np.cos(dist / re))
        + (np.cos(lat1r) * np.sin(dist / re) * np.cos(bearr))
    )
    lon2r = lon1r + atan2(
        np.sin(bearr) * np.sin(dist / re) * np.cos(lat1r),
        np.cos(dist / re) - np.sin(lat1r) * np.sin(lat2r),
    )
    return np.rad2deg(lat2r), np.rad2deg(lon2r)

def add_scale_line(
    scale, ax, projection, color="k", linewidth=None, fontsize=None, fontweight=None
):
    """
    Adds a line that shows the map scale in km. The line will automatically
    scale based on zoom level of the map. Works with cartopy.

    Parameters
    ----------
    scale : scalar
        Length of line to draw, in km.
    ax : matplotlib.pyplot.Axes instance
        Axes instance to draw line on. It is assumed that this was created
        with a map projection.
    projection : cartopy.crs projection
        Cartopy projection being used in the plot.

    Other Parameters
    ----------------
    color : str
        Color of line and text to draw. Default is black.
    """
    frac_lat = 0.15  # distance fraction from bottom of plot
    frac_lon = 0.35  # distance fraction from left of plot
    e1 = ax.get_extent()
    center_lon = e1[0] + frac_lon * (e1[1] - e1[0])
    center_lat = e1[2] + frac_lat * (e1[3] - e1[2])
    # Main line
    lat1, lon1 = gc_latlon_bear_dist(
        center_lat, center_lon, -90, scale / 2.0
    )  # left point
    lat2, lon2 = gc_latlon_bear_dist(
        center_lat, center_lon, 90, scale / 2.0
    )  # right point
    if lon1 <= e1[0] or lon2 >= e1[1]:
        warnings.warn(
            "Scale line longer than extent of plot! "
            + "Try shortening for best effect."
        )
    ax.plot(
        [lon1, lon2],
        [lat1, lat2],
        linestyle="-",
        color=color,
        transform=projection,
        linewidth=linewidth,
    )
    # Draw a vertical hash on the left edge
    lat1a, lon1a = gc_latlon_bear_dist(
        lat1, lon1, 180, frac_lon * scale / 20.0
    )  # bottom left hash
    lat1b, lon1b = gc_latlon_bear_dist(
        lat1, lon1, 0, frac_lon * scale / 20.0
    )  # top left hash
    ax.plot(
        [lon1a, lon1b],
        [lat1a, lat1b],
        linestyle="-",
        color=color,
        transform=projection,
        linewidth=linewidth,
    )
    # Draw a vertical hash on the right edge
    lat2a, lon2a = gc_latlon_bear_dist(
        lat2, lon2, 180, frac_lon * scale / 20.0
    )  # bottom right hash
    lat2b, lon2b = gc_latlon_bear_dist(
        lat2, lon2, 0, frac_lon * scale / 20.0
    )  # top right hash
    ax.plot(
        [lon2a, lon2b],
        [lat2a, lat2b],
        linestyle="-",
        color=color,
        transform=projection,
        linewidth=linewidth,
    )
    # Draw scale label
    ax.text(
        center_lon,
        center_lat - frac_lat * (e1[3] - e1[2]) / 4.0,
        str(int(scale)) + " km",
        horizontalalignment="center",
        verticalalignment="center",
        color=color,
        fontweight=fontweight,
        fontsize=fontsize,
    )

Create Display Function to Display CROCUS Domain#

def chicago_aq_display(nradar, bounds, sites, aqvals, rad_time, rad_site='KLOT', **kwargs):
    #---------------------------------------------------
    # Define the GridSpec for Detailed Subplot Placement
    #---------------------------------------------------
    fig = plt.figure(figsize=(16, 10))

    gs0 = gridspec.GridSpec(1, 2, figure=fig)
    gs00 = gs0[1].subgridspec(4, 1, hspace=0.9, wspace=0.85)

    # update the extent of the subplot
    gs0.update(top=.90, bottom=0.1, left=0.1, right=.99)

    #-------------------
    # Plot the Radar PPI
    #-------------------
    ax1 = fig.add_subplot(gs0[0], projection=ccrs.PlateCarree())

    ax1.add_feature(cfeature.STATES, linewidth=3)
    ax1.add_feature(USCOUNTIES, alpha=0.4)

    # Create the Radar Display Object
    display = pyart.graph.RadarMapDisplay(nradar)

    # Plot the reflectivty
    display.plot_ppi_map('reflectivity', 
                         ax=ax1,
                         sweep=3, 
                         vmin=-20,
                         vmax=45,
                         lat_lines=None,
                         lon_lines=None,
                         min_lat=bounds[2],
                         max_lat=bounds[3],
                         min_lon=bounds[0],
                         max_lon=bounds[1],
                         ticklabs='',
                         embellish=False,
                         norm=None,
                         cmap="Spectral_r")
    
    # Add the scale line
    add_scale_line(10, ax1, ccrs.PlateCarree())

    # Add the locations of the waggle nodes
    for nsite in sites:
        ax1.scatter(sites[nsite][1], sites[nsite][0], s=60, marker='d', label=nsite)
    # Add a legend
    plt.legend(loc='upper left',
               fontsize=12)
    
    #-------------------------------------------
    # Add the air quality transmitter (AQT) data
    #-------------------------------------------
    ## Note: I am using the radar scan time to time sync the AQT and radar data
    aq_temp = aqvals.loc['2023-05-07 16:00:00':rad_time]
    # Add the second plot for the gridspec
    axs2 = fig.add_subplot(gs00[0])
    aq_temp['pm1.0'].plot(xlabel='UTC Time \n [HH:MM:SS]',
                          ylabel='Part Matter ug/m3',
                          title='CROCUS NEIU Node (W08D) - Vaisala AQT530',
                          ax=axs2, 
                          color='r', 
                          label='PM1.0',
                          )

    aq_temp['pm2.5'].plot(xlabel='UTC Time \n [HH:MM:SS]',
                          ylabel='Part Matter ug/m3',
                          title='CROCUS NEIU Node (W08D) - Vaisala AQT530',
                          ax=axs2, 
                          color='g', 
                          label='PM2.5',
                         )

    aq_temp['pm10.0'].plot(xlabel='UTC Time \n [HH:MM:SS]',
                           ylabel='Part Matter ug/m3',
                           title='CROCUS NEIU Node (W08D) - Vaisala AQT530',
                           ax=axs2, 
                           color='b', 
                           label='PM10.0',
                          )

    axs2.legend()
    axs2.grid(True)
    # Note: force the axis to display the entire time range
    axs2.set_xlim([DATE + ' ' + TIME_START, DATE + ' ' + TIME_STOP])
    #axs2.set_ylim([0.0, 0.3])

    axs3 = fig.add_subplot(gs00[1])
    (aq_temp['co']/10.0).plot(xlabel='UTC Time \n [HH:MM:SS]',
                              ylabel='Molecules of per million',
                              title='CROCUS NEIU Node (W08D) - Vaisala AQT530',
                              ax=axs3, 
                              color='b', 
                              label='CO/10',
                             )

    aq_temp['no'].plot(xlabel='UTC Time \n [HH:MM:SS]',
                       ylabel='Molecules of per million',
                       title='CROCUS NEIU Node (W08D) - Vaisala AQT530',
                       ax=axs3, 
                       color='g', 
                       label='NO',
                      )


    aq_temp['no2'].plot(xlabel='UTC Time \n [HH:MM:SS]',
                        ylabel='Molecules of per million',
                        title='CROCUS NEIU Node (W08D) - Vaisala AQT530',
                        ax=axs3, 
                        color='r', 
                        label='NO2',
                       )


    aq_temp['o3'].plot(xlabel='UTC Time \n [HH:MM:SS]',
                       ylabel='Molecules of per million',
                       title='CROCUS NEIU Node (W08D) - Vaisala AQT530',
                       ax=axs3, 
                       color='purple', 
                       label='o3',
                      )
    axs3.legend()
    axs3.grid(True)
    axs3.set_xlim([DATE + ' ' + TIME_START, DATE + ' ' + TIME_STOP])
    axs3.set_ylim([0.0, 0.05])

    axs4 = fig.add_subplot(gs00[2])
    aq_temp.temp.plot(xlabel='UTC Time \n [HH:MM:SS]',
                      ylabel='Ambient Temperature \n [Degree Celsius]',
                      title='CROCUS NEIU Node (W08D) - Vaisala AQT530',
                      ax=axs4, color='r', label='Dry Bulb',
                     )

    aq_temp.dewpoint.plot(xlabel='UTC Time \n [HH:MM:SS]',
                          ylabel='Ambient Temperature \n [Degree Celsius]',
                          title='CROCUS NEIU Node (W08D) - Vaisala AQT530',
                          color='b', label='Dew Point',
                          ax=axs4
                         )

    axs4.legend()
    axs4.grid(True)
    axs4.set_xlim([DATE + ' ' + TIME_START, DATE + ' ' + TIME_STOP])
    #axs4.set_ylim([0.0, 0.3])

    # Search to see if temporary directory was supplied to save the file
    if kwargs['templocation']:
        plt.savefig(kwargs['templocation'] + '/' + 'lakebreeze' + '_' + rad_site + '_' + str(rad_time) +'.png')
    else:
        plt.savefig('lakebreeze' + '_' + rad_site + '_' + str(rad_time) +'.png')

Data Query#

National Weather Service Radar - Romoville, IL (KLOT)#

  • The National Weather Service Next Generation Radar (NEXRAD) in Romoville, IL provides radar coverage for the Chicago Region, allowing meteorologists to understand potential weather hazards (severe storms).

  • We show how to query data from this station and create a phase plane indictator (PPI) movie for the events of the user’s desire

  • This will allow us to investigate meteorological events within the region and compare against our CROCUS Nodes

# Configure the nexrad interface using our time and location
conn = nexradaws.NexradAwsInterface()
scans = conn.get_avail_scans_in_range(START, STOP, RADAR_ID)
print("There are {} scans available between {} and {}\n".format(len(scans), START, STOP))

# Download the files
results = conn.download(scans, templocation)
There are 48 scans available between 2023-05-07 16:00:00+00:00 and 2023-05-07 21:00:00+00:00
Downloaded KLOT20230507_161726_V06
Downloaded KLOT20230507_163235_V06
Downloaded KLOT20230507_162536_V06
Downloaded KLOT20230507_161027_V06
Downloaded KLOT20230507_163934_V06
Downloaded KLOT20230507_160329_V06
Downloaded KLOT20230507_165332_V06_MDM
Downloaded KLOT20230507_165332_V06
Downloaded KLOT20230507_164633_V06
Downloaded KLOT20230507_170729_V06
Downloaded KLOT20230507_171428_V06
Downloaded KLOT20230507_170031_V06
Downloaded KLOT20230507_172127_V06
Downloaded KLOT20230507_174224_V06
Downloaded KLOT20230507_175622_V06
Downloaded KLOT20230507_172827_V06
Downloaded KLOT20230507_174923_V06
Downloaded KLOT20230507_173525_V06
Downloaded KLOT20230507_175622_V06_MDM
Downloaded KLOT20230507_181719_V06
Downloaded KLOT20230507_180321_V06
Downloaded KLOT20230507_181020_V06
Downloaded KLOT20230507_182419_V06
Downloaded KLOT20230507_183117_V06
Downloaded KLOT20230507_183817_V06
Downloaded KLOT20230507_185917_V06_MDM
Downloaded KLOT20230507_184517_V06
Downloaded KLOT20230507_185217_V06
Downloaded KLOT20230507_185917_V06
Downloaded KLOT20230507_190617_V06
Downloaded KLOT20230507_191316_V06
Downloaded KLOT20230507_192015_V06
Downloaded KLOT20230507_192714_V06
Downloaded KLOT20230507_193413_V06
Downloaded KLOT20230507_194112_V06
Downloaded KLOT20230507_195509_V06_MDM
Downloaded KLOT20230507_194811_V06
Downloaded KLOT20230507_200209_V06
Downloaded KLOT20230507_195509_V06
Downloaded KLOT20230507_201607_V06
Downloaded KLOT20230507_200908_V06
Downloaded KLOT20230507_203006_V06
Downloaded KLOT20230507_202307_V06
Downloaded KLOT20230507_203704_V06
Downloaded KLOT20230507_204403_V06
Downloaded KLOT20230507_205103_V06
Downloaded KLOT20230507_205801_V06_MDM
Downloaded KLOT20230507_205801_V06
48 out of 48 files downloaded...0 errors

CROCUS Level 3 Node Data Query (W08D) - Northeastern Illinois University#

  • Please check our notebooks on the CROCUS-Level1-Node for more information on data query with the SAGE Data Client

  • Northeastern Illinois University (NEIU) served as the first CROCUS node deployed to the Chicago region.

## NEIU AQT 
df_aq = sage_data_client.query(start = DATE + 'T' + TIME_START + 'Z',
                               end = DATE + 'T' + TIME_STOP + 'Z', 
                               filter={
                                        "plugin": "registry.sagecontinuum.org/jrobrien/waggle-aqt:0.23.5.*",
                                       }
)

# extract the particle measurements from the DataFrame
pm25 = df_aq[df_aq['name']=='aqt.particle.pm2.5']
pm10 = df_aq[df_aq['name']=='aqt.particle.pm1']
pm100 = df_aq[df_aq['name']=='aqt.particle.pm10']

# extract the gas measurements from the DataFrame
no = df_aq[df_aq['name']=='aqt.gas.no']
o3 = df_aq[df_aq['name']=='aqt.gas.ozone']
no2 = df_aq[df_aq['name']=='aqt.gas.no2']
co = df_aq[df_aq['name']=='aqt.gas.co']

# extract the environment data from the DataFrame
aqtemp = df_aq[df_aq['name']=='aqt.env.temp']
aqhum = df_aq[df_aq['name']=='aqt.env.humidity']

# Convert values to numpy arrays
aqvals = pm25.set_index('timestamp')
aqvals['pm2.5'] = aqvals.value.to_numpy().astype(float)
aqvals['pm1.0'] = pm10.value.to_numpy().astype(float)
aqvals['pm10.0'] = pm100.value.to_numpy().astype(float)
aqvals['no'] = no.value.to_numpy().astype(float)
aqvals['o3'] = o3.value.to_numpy().astype(float)
aqvals['no2'] = no2.value.to_numpy().astype(float)
aqvals['co'] = co.value.to_numpy().astype(float)
aqvals['temp'] =  aqtemp.value.to_numpy().astype(float)
aqvals['hum'] =  aqhum.value.to_numpy().astype(float)

# Use MetPY to calculate dewpoint from temperature and relative humidity
dp = dewpoint_from_relative_humidity( aqvals.temp.to_numpy() * units.degC, 
                                     aqvals.hum.to_numpy() * units.percent)

aqvals['dewpoint'] = dp

Create Display#

for i, scan in enumerate(results.iter_success(), start=1):
    ## skip the files ending in "MDM"
    if scan.filename[-3:] != "MDM":
        if i > 1:
            # define what file you are working on
            print("working on " + scan.filename)
            # define the radar time
            rad_time = scan.filename[4:8] + '-' + scan.filename[8:10] + '-' + scan.filename[10:12] + \
                       ' ' + scan.filename[13:15] + ':' + scan.filename[15:17] + ':' + scan.filename[17:19]
            # Open the file with PyART
            radar = scan.open_pyart()
            # Call the CROCUS AQ Display Function
            chicago_aq_display(radar, 
                               BOUNDING_BOX, 
                               WAGGLE_SITES, 
                               aqvals, 
                               rad_time,
                               templocation=templocation)
            # close the radar file
            del radar
working on KLOT20230507_161027_V06
Downloading file 'us_counties_20m.cpg' from 'https://github.com/Unidata/MetPy/raw/v1.6.3/staticdata/us_counties_20m.cpg' to '/home/runner/.cache/metpy/v1.6.3'.
Downloading file 'us_counties_20m.dbf' from 'https://github.com/Unidata/MetPy/raw/v1.6.3/staticdata/us_counties_20m.dbf' to '/home/runner/.cache/metpy/v1.6.3'.
Downloading file 'us_counties_20m.prj' from 'https://github.com/Unidata/MetPy/raw/v1.6.3/staticdata/us_counties_20m.prj' to '/home/runner/.cache/metpy/v1.6.3'.
Downloading file 'us_counties_20m.shx' from 'https://github.com/Unidata/MetPy/raw/v1.6.3/staticdata/us_counties_20m.shx' to '/home/runner/.cache/metpy/v1.6.3'.
Downloading file 'us_counties_20m.shp' from 'https://github.com/Unidata/MetPy/raw/v1.6.3/staticdata/us_counties_20m.shp' to '/home/runner/.cache/metpy/v1.6.3'.
working on KLOT20230507_161726_V06
working on KLOT20230507_162536_V06
working on KLOT20230507_163235_V06
working on KLOT20230507_163934_V06
working on KLOT20230507_164633_V06
working on KLOT20230507_165332_V06
working on KLOT20230507_170031_V06
working on KLOT20230507_170729_V06
working on KLOT20230507_171428_V06
working on KLOT20230507_172127_V06
working on KLOT20230507_172827_V06
working on KLOT20230507_173525_V06
working on KLOT20230507_174224_V06
working on KLOT20230507_174923_V06
working on KLOT20230507_175622_V06
working on KLOT20230507_180321_V06
working on KLOT20230507_181020_V06
working on KLOT20230507_181719_V06
working on KLOT20230507_182419_V06
working on KLOT20230507_183117_V06
working on KLOT20230507_183817_V06
working on KLOT20230507_184517_V06
working on KLOT20230507_185217_V06
working on KLOT20230507_185917_V06
working on KLOT20230507_190617_V06
working on KLOT20230507_191316_V06
working on KLOT20230507_192015_V06
working on KLOT20230507_192714_V06
working on KLOT20230507_193413_V06
working on KLOT20230507_194112_V06
working on KLOT20230507_194811_V06
working on KLOT20230507_195509_V06
working on KLOT20230507_200209_V06
working on KLOT20230507_200908_V06
working on KLOT20230507_201607_V06
working on KLOT20230507_202307_V06
working on KLOT20230507_203006_V06
working on KLOT20230507_203704_V06
working on KLOT20230507_204403_V06
working on KLOT20230507_205103_V06
working on KLOT20230507_205801_V06
../../_images/8a85dede266476951322e777283df6a9d7fcf7af836eca4ff2d3689a0437998d.png ../../_images/ad9c4625e06461a30d5deec97db073d8ecd41f19b0c30240647d6562b7f26eb2.png ../../_images/2d7859d9b36ba910b5bac58bbf6cd0d08db28c46cb3b38207273034395238beb.png ../../_images/bfc4daab39574e0714757d59694f3407a421c5f73766da79cfde9576032c5cf3.png ../../_images/f17e715c7b4260a1516aae76b80c0f6aab39a446f77904be822aafa20f452ee2.png ../../_images/932ba8b09f2c991733e969e02eb7406103ca77a94040b75374a87fa198952779.png ../../_images/381bb38528b2e6a84858ddabd52a8bc5030d86b31389afca560272d5a6319beb.png ../../_images/1ab8eb25253d1d682e68756934f9c2418c61d693140e7e75105055cd238e28b9.png ../../_images/c7bb1fdcd4b78aaf501f538e47fbd2d7777889424a388ba5064e36a61888079a.png ../../_images/a3c73e5d04df43c8f0271d4e67f4b29758223dc1f91c2695c5e9e627fb7c3dd7.png ../../_images/f1a8f62903dd4ec3b7d6a9295adb86cfa2d859b29831626a43f84047b35ab2cf.png ../../_images/a7f57fde8ee9037ab3eb456fafa5a815f47c1ebe16a23f0095e147fecc2142d6.png ../../_images/187dd57e18fab78816b38906e4bee7b205383e8f2e83b33de6cb259179f2fc34.png ../../_images/94153e8fac662a6c6c44a2f98a1446c61568fd2d57a2f9bd0e50bf1ab16f7c0b.png ../../_images/d5f84693c123dcdde6d4b82e18305e0e8e0defcac6812a23b81440dfc18606dc.png ../../_images/76a881f6aab169758957109d889c37fddd20b96d6efb750baab2af85d04476db.png ../../_images/19ca589e108b0f6ee0e4724a20dd61da2ff3563d00985c72efd98347070f8219.png ../../_images/6be521f89a867782c1e6cf5d73a8c9345e3fcee9aa8686c56d9ef238d25291ff.png ../../_images/edf8accac9a071662fc8df56a8095ec5a3a4d08605544055281cc0c1281b7ee3.png ../../_images/aa6926dc43819bed6f1c0efb6c689a1bca4602d7c902d630f6dec1f27ea89c65.png ../../_images/5a9a5cbaeaf2ee6a92bf01aaa74ff8bb304c993fefc329447690cc12127f2a9b.png ../../_images/0f6eaa99cebbba694ab6796f4679d77289026a4696b4d8e79f37ea9eb7bc99f1.png ../../_images/f8146a6c1c8249cc6f763d01b0cb1090228f3cf0d1db617770f2d8f7cccbbdbd.png ../../_images/54776dc8f4524f48de9af7c06c26cebdf13a876f921aca2cd8daa14ee949b0c4.png ../../_images/e531ed957bf2388c1fca7324e882e56dd5dd3f0fc7cb4fc700d487c76a496e41.png ../../_images/9814c1274cf933865e61642b964b0570dec9d51bfc5c99d0729481af88eac26b.png ../../_images/6806044b7a5580515881df23778b69b1a3e51297a20d0b47892a0a59170ae8ca.png ../../_images/d7f4f91c6ff580e81a40104bdd5af943f58cc5b259ecb19af0379cf079300f08.png ../../_images/41038126dde2538c7a6019bba29d135426daa5a4f064413a282d142e71cb41d8.png ../../_images/f0c1ef7fa4a147226ca40d1ca1b2ed662c34d90dc7c43833b2143d796f47ffe5.png ../../_images/473a65679cca1c49c09702c13705c62bdfcc9daf9117753e2b7143625836f0e4.png ../../_images/0f8bb686b034f151d5f3113b60ccab4734f1048f22a428d133d4053cbf7c4ec9.png ../../_images/216bdfe18700fdf13dfcf1d82c7d8d67afa7c5ab6dff5685654fe0f4d39930d5.png ../../_images/fd71d156117ce06c70a7f11768b97f5e421f5a58da152e46c0cc144eeff7f615.png ../../_images/54dea5903e2e67baeb9389cedf5616b4d92b8b01cc46de2bc06c0b84ecd1a7a0.png
Error in callback <function flush_figures at 0x7f2bb0834310> (for post_execute), with arguments args (),kwargs {}:

Assemble Static Plots into a Movie#

# Define files created and define movie path
map_images = sorted(glob.glob(templocation + f"/lakebreeze*"))
gif_title = f"lakebreeze_{RADAR_ID}-map-animation.gif"

# Check to see if the file exists - if it does, delete it
if os.path.exists(gif_title):
    os.remove(gif_title)

# Loop through and create the gif
with imageio.get_writer(gif_title, mode='I', duration=0.2) as writer:
    for filename in map_images:
        image = imageio.imread(filename)
        writer.append_data(image)

SegmentLocal