Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Access SOCRATES Aircraft Data via GDEX Exchange

Access SOCRATES Aircraft Campaign Data via GDEX Exchange

Binder

Run this notebook interactively on CIRRUS BinderHub.

Required Packages

Please ensure the following packages are installed before proceeding.

CategoryPackagePurpose
Data Access & AnalysisfsspecOpen remote NetCDF files as a binary stream over HTTPS
xarrayLoad and manipulate NetCDF datasets
pandasDatetime conversion utilities
numpyNumerical operations and NaN masking
Visualization (static)matplotlibStatic scatter plot of the flight track
Visualization (interactive)foliumInteractive Leaflet map

Step 1 - Access the Data

The SOCRATES dataset is hosted on the NCAR GDEX Exchange portal. The file is a standard NetCDF served over plain HTTPS. Because xarray cannot pass an HTTPS URL directly to its file-reading backends, we use fsspec to open the remote file as a binary stream and hand that stream to xarray.open_dataset.

Step 2 - Plot the Flight Track (Static)

Plot the aircraft latitude (GGLAT) and longitude (GGLON) as a scatter plot with a connecting line ordered by time. Points are colored using the viridis colormap from earliest (purple) to latest (yellow). Start and end positions are highlighted with distinct markers.

<Figure size 1000x600 with 2 Axes>

Step 3 - Interactive Map with Folium

Render the same flight track on an interactive Leaflet map using folium. NaN positions are removed before plotting. Points are subsampled every 30 seconds for performance; clicking any dot shows its exact UTC timestamp. The map is saved as a standalone HTML file that can be opened in any browser.

Saved to flight_track.html
Loading...