DEV Community

Cover image for OSCAR 2022 sea surface velocity streamplot animation

OSCAR 2022 sea surface velocity streamplot animation

Jordan Bell on February 17, 2024

Sea surface currents derived from OSCAR. Dec 20, 2022 We use xarray, cartopy, and matplotlib to plot sea surface current derived from sea surface ...
Collapse
 
michaeltharrington profile image
Michael Tharrington

Wow, this is super cool!

Collapse
 
jordanbell2357 profile image
Jordan Bell

Thank you!

This process will work for other geospatial datasets with velocity data. We make streamlines from the velocity vector field data. This could be done for the atmosphere or other geophysical datasets from sources such as NOAA and NASA.

The heavy lifting is done by matplotlib with matplotlib.org/stable/api/_as_gen/...

The arguments I fed it were trial and error to make a nice looking plot. The 8 that occurs as an argument is the density parameter for spacing between the streamlines.

Collapse
 
jordanbell2357 profile image
Jordan Bell

Also, about the cute way of making progress bars and combining into an animation using ImageMagick and ffmpeg, the bash script is fairly general and can be modified for other uses.