This is a rotating shallow water model for studying vortices at a planet's pole.
Simply open run.ipynb
to get started!
demo.mp4
This project is part of a finished school project and is unlikely to evolve further. However if you are interested in using it feel free to suggest any improvement, I'll be happy to work on it again.
- Save/load results as NetCDF.
- Plot animations, save them as MP4 or GIF.
- Set initial vortices by latitudes and number (e.g. 1 vortex at 90°N and 5 vortices at 83°N) or by coordinates (e.g. one vortex at 83°N, 45°E).
This is for example the code used to generate the demo video:
from model import Model
import plot
m = Model(300)
m.initialize(vort_lat=[83, 70], vort_number=[5, 1])
m.run('3 months')
plot.show_var_anim(m, 'pv', title='PV', save_as='mp4', filename='demo')
JupiRSW uses NumPy, Xarray, SciPy and Matplotlib.
ffmpeg is required to save animations as MP4.
There are many builds available, you can for instance get one here.
Once installed, add the path to the ffmpeg executable in config.py
:
FFMPEG_PATH = R'C:\ffmpeg\bin\ffmpeg.exe'
Animations can still be saved as GIFs without ffmpeg.
I recommend using the cmcrameri module for pretty, perceptually uniform, colorblind-friendly colormaps. This install is optional.
The RK3 scheme implementation is taken from PyRSW.
The configuration of JupiRSW is based on:
Li C, Ingersoll AP, Klipfel AP, Brettle H. Modeling the stability of polygonal patterns of vortices at the poles of Jupiter as revealed by the Juno spacecraft. Proc Natl Acad Sci U S A. 2020 Sep 29;117(39):24082-24087. doi: 10.1073/pnas.2008440117. Epub 2020 Sep 8. PMID: 32900956; PMCID: PMC7533696.