# Slice out a single frame of grid data
grid = data.data.grid[:, :, 0]
timestamp = data.timestamp[0]
# Grab the fill value used to represent grid cells with no data
fill_val = data.data.fill_value
# Prep the grid data for plotting (make non-data cells transparent)
rgba_grid = at.grid_files.prep_grid_image(grid, fill_val, scale=[0,12500])
# Create an empty map using cartopy
projection = cartopy.crs.NearsidePerspective(central_longitude=-100, central_latitude=55)
fig = plt.figure(figsize=(5, 5))
ax = fig.add_axes((0, 0, 1, 1), projection=projection)
ax.set_extent([-140, -70, 35, 80], crs=cartopy.crs.Geodetic())
ax.add_feature(cartopy.feature.OCEAN, zorder=0)
# Overlay the grid data on the map
plt.imshow(rgba_grid, extent=(-180, 180, -90, 90), transform=cartopy.crs.PlateCarree(), origin='lower')
plt.text(0.01, 0.925, "THEMIS ASI - Gridded Data", transform=ax.transAxes, fontsize=18, weight='bold')
plt.text(0.01, 0.100, timestamp.strftime("%Y/%m/%d"), transform=ax.transAxes, fontsize=18, weight='bold')
plt.text(0.01, 0.025, timestamp.strftime("%H:%M:%S")+" UT", transform=ax.transAxes, fontsize=18, weight='bold')
plt.show()