Kamodo Quick Start¶
Installation instructions¶
Kamodo is built to run with at least 16 GB of RAM. Attempting to run Kamodo with less memory may result in errors.
Conda prompt commands to create working environment¶
- Move to the directory where you want the Kamodo package to be stored or if you wish to create a new environment, use this command:
conda create -n Kamodo_env python=3.7
- Add the packages needed by the CCMC readers to the desired environment (replace 'Kamodo_env' with your environment name):
conda install -n Kamodo_env -c conda-forge netCDF4 cdflib astropy ipython jupyter h5py sgp4
- Activate the desired environment.
conda activate Kamodo_env
- Install remaining dependencies:
python -m pip install --upgrade spacepy
python -m pip install hapiclient
- Download CCMC Kamodo to the current directory:
git clone https://github.com/nasa/Kamodo.git
- Install the CCMC Kamodo package. (Check the directory structure before using this command. The ./Kamodo directory should contain the kamodo_ccmc directory.)
python -m pip install ./Kamodo
Note: Developers should install CCMC Kamodo with the -e option
Test install from an ipython or notebook session¶
from kamodo import Kamodo
k = Kamodo()
import kamodo_ccmc.flythrough.model_wrapper as MW
MW.Model_Variables('OpenGGCM_GM')
The OpenGGCM_GM model accepts the standardized variable names listed below. ----------------------------------------------------------------------------------- B_x : '['x component of magnetic field', 0, 'GSE', 'car', ['time', 'x', 'y', 'z'], 'nT']' B_y : '['y component of magnetic field', 1, 'GSE', 'car', ['time', 'x', 'y', 'z'], 'nT']' B_z : '['z component of magnetic field', 2, 'GSE', 'car', ['time', 'x', 'y', 'z'], 'nT']' E_x : '['x component of electric field', 6, 'GSE', 'car', ['time', 'x', 'x', 'x'], 'mV/m']' E_y : '['y component of electric field', 7, 'GSE', 'car', ['time', 'y', 'y', 'y'], 'mV/m']' E_z : '['z component of electric field', 8, 'GSE', 'car', ['time', 'z', 'z', 'z'], 'mV/m']' N_plasma : '['number density of plasma (hydrogen equivalent)', 12, 'GSE', 'car', ['time', 'x', 'y', 'z'], '1/cm**3']' P_plasma : '['plasma pressure', 14, 'GSE', 'car', ['time', 'x', 'y', 'z'], 'pPa']' eta : '['resistivity', 13, 'GSE', 'car', ['time', 'x', 'y', 'z'], 'm**2/s']' j_x : '['current density, x component', 15, 'GSE', 'car', ['time', 'x', 'y', 'z'], 'muA/m**2']' j_y : '['current density, y component', 16, 'GSE', 'car', ['time', 'x', 'y', 'z'], 'muA/m**2']' j_z : '['current density, z component', 17, 'GSE', 'car', ['time', 'x', 'y', 'z'], 'muA/m**2']' v_plasmax : '['x component of plasma velocity', 9, 'GSE', 'car', ['time', 'x', 'y', 'z'], 'km/s']' v_plasmay : '['y component of plasma velocity', 10, 'GSE', 'car', ['time', 'x', 'y', 'z'], 'km/s']' v_plasmaz : '['z component of plasma velocity', 11, 'GSE', 'car', ['time', 'x', 'y', 'z'], 'km/s']'
Other testing¶
Additional quick tests can be performed by following the "Data Functionalization" tab in this documentation as it does not require access to a dataset to function. Kamodo does not generate model outputs.
Plotly interactive plots¶
The default plotting built into Kamodo uses plotly. Plotly (https://plotly.com/python/) is an open-source interactive plotting library supporting a wide range of plotting options. It enables web-based visualizations that can be displayed in Jupyter notebooks, as well as exported to html, png, and pdf. Below is a self contained html file to visualize model output in 3D you can interact with.
from IPython.display import IFrame
IFrame(src='Files/GITM_3D_500km.html', width="100%", height="650")