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.

Cross-section using real data from soundings.

This example uses actual soundings to create a cross-section. There are two functions defined to help interpolate radiosonde observations, which won’t all be at the same level, to a standard grid. The vertical interpolation assumes a log-linear relationship. Each radisosonde vertical profile is interpolated first, then the scipy.interpolate.griddata function is used to generate a full 2D (x, p) grid between each station. Pyproj is used to calculate the distance between each station and the standard atmosphere is used to convert the elevation of each station to a pressure value for plotting purposes.

Vertical Interpolation Function

Function interpolates to given pressure level data to set grid.

Radiosonde Observation Interpolation Function

This function interpolates given radiosonde data into a 2D array for all meteorological variables given in dataframe. Returns a dictionary that will have requesite data for plotting a cross section.

Stations and Time

Select cross section stations by creating a list of three-letter identifiers and choose a date by creating a datetime object

Get Radiosonde Data

This example is built around the data from the University of Wyoming sounding archive and using the Siphon package to remotely access that data.

Create Interpolated fields

Use the function radisonde_cross_section to generate the 2D grid (x, p) for all radiosonde variables including, Temperature, Dewpoint, u-component of the wind, and v-component of the wind.

Calculate Variables for Plotting

Use MetPy to calculate potential temperature for plotting a cross section.

Plot Cross Section

Use standard Matplotlib to plot the now 2D cross section grid using the data from xsect and those calculated above. Additionally, the actualy radiosonde wind observations are plotted as barbs on this plot.

<Figure size 1700x1100 with 1 Axes>