Binned Altitude Plot#
This example demonstrates how to:
put pandas data into bins using
pd.cut()
and.groupby()
plot binned data
If you are running this example on Cryocloud it is suggested to use a 3.7GB instance if using b200_baltimore.explore()
import pandas as pd
import geopandas as gpd
import numpy as np
import matplotlib.pyplot as plt
from shapely.geometry import box
b200_filepath = (
'/home/jovyan/shared/NASA-SARP/SARP_campaign_data/2024'
'/sarp-mrg1_b200_2024_fullmerge.geoparquet'
)
Exploration: Spatial subsetting#
b200 = gpd.read_file(b200_filepath)
Adjust the latitudes and longitudes in the box()
call below to profile a different spatial area. Format for the bounding box is: (West, South, East, North)
.
# clip data to just the region around baltimore
bbox = box(-76.8, 39.2, -76.5, 39.4) # latitude and longitude of the bounding box
b200_baltimore = gpd.clip(b200, mask=bbox)
b200_baltimore.plot()
<Axes: >

The cell below shows how to use the .explore()
function to create an interactive map for viewing where the data has been collected. This is a processing intensive function, so a few notes about using it:
Careful running this on more than ~50,000 rows of data. The map may run very very slowly
You may need to re-start your kernel if you run the line multiple times. The memory can fill up quickly
b200_baltimore.explore(column='NO2_CANOE_STCLAIR')