Loading [MathJax]/extensions/Safe.js
Kamodo Analysis Suite
  • Kamodo Quick Start
  • Introduction
  • Data Functionalization
  • Functionalizing HAPI Results
  • Choosing Models and Variables
  • Functionalizing a Modeled Dataset
  • Satellite Trajectories
  • Coordinate Conversions
  • Performing a Flythrough in a Notebook
  • Performing a Flythrough from the Command Line
  • Constellation Mission Planning Tool
  • Advanced Plotting Routines
    • SatPlot4D
      • Load data and make several different plots
    • Other ways to modify figures
    • Custom plots for just one data source
  • Contribution Guidelines
  • How to Write a Model Reader
Kamodo Analysis Suite
  • »
  • Advanced Plotting Routines

Advanced Plotting Routines¶

This notebook tutorial shows special customized visualization options that can be utilized for some model output or data type.

SatPlot4D¶

This tool enables many customizations for timeseries output along a satellite trajectory. It is designed to work with FlyThrough output or more generalized datasets.

In [2]:
Copied!
from kamodo_ccmc.flythrough.plots import SatPlot4D
help(SatPlot4D)
from kamodo_ccmc.flythrough.plots import SatPlot4D help(SatPlot4D)
Help on function SatPlot4D in module kamodo_ccmc.flythrough.plots:

SatPlot4D(var, time, c1, c2, c3, vard, varu, inCoordName, inCoordType, plotCoord, groupby, model, displayplot=True, returnfig=False, type='3D', body='black', zoom=False, divfile='', htmlfile='', plotCoordType1D='car', vUnit='', vxName='', vx='', vyName='', vy='', vzName='', vz='', vScale=1.0, vSkip=0)
    4D plotting for satellite trajectories using plotly by Darren De Zeeuw
    
    __Required variables__
    
    var: string of variable name
    time: time formatted as a timestamp in UTC
    c1: latitude  or X
    c2: longitude or Y
    c3: altitude  or Z
    vard: data of variable var, same size array as positions
    varu: string of variable var units
    inCoordName: string for incoming coordinate system.
        GDZ, GEO, GSM, GSE, SM, GEI, MAG, RLL
    inCoordType: string for incoming coordinate type.  car, sph
    plotCoord: string for coordinate system used in 3D plot. 
        Assumes car for 3D and Polar, sph otherwise.
    groupby: grouping of data for animation, values include
        all, day, hour, minute, N, orbitE, orbitM
    model: string of name of model the data was extracted from
    
    __Optional variables__
    
    displayplot: logical to show/hide displayed plot
    returnfig: logical to return figure object for further modification,
        will override displayplot if True
    type: string for choice of plot type, values:
        3D, 3Dv, 1D, 2D, 2DLT, 2DPN, 2DPS
    body: string choice of 3D inner body, values: black, earth (GEO), none
    zoom: logical to show zoomed in view for polar plots
    divfile: string with filename to save a html div file of the plot
    htmlfile: string with filename to save a full html file of the plot
    plotCoordType1D: displayed coordinate type for 1D plots.  car, sph
    vUnit: units of quiver vector quantity, ie 'nT'
    vxName: string name of X component of quiver vector, ie 'B_x'
    vx: array of values of X component of quiver vector
    vyName: string name of Y component of quiver vector, ie 'B_y'
    vy: array of values of Y component of quiver vector
    vzName: string name of Z component of quiver vector, ie 'B_z'
    vz: array of values of Z component of quiver vector
    vScale: length scale factor to quiver vectors
    vSkip: skip this number of points between displaying quiver vector

Load data and make several different plots¶

In [3]:
Copied!
# Load a saved satellite flythrough file (or use data in memory)
from kamodo_ccmc.flythrough.SF_output import SFcsv_reader
cdf_dict = SFcsv_reader('Files/FakeFlightExample_CTIPe20s.csv')

var = 'rho' # variable to plot
# Load a saved satellite flythrough file (or use data in memory) from kamodo_ccmc.flythrough.SF_output import SFcsv_reader cdf_dict = SFcsv_reader('Files/FakeFlightExample_CTIPe20s.csv') var = 'rho' # variable to plot

Screenshot

Screenshot

Screenshot

Screenshot

Screenshot

Other ways to modify figures¶

We have already loaded a kamodo_object with a couple of days of model output (not shown). With time and altitude fixed, the plot will show the ion Temperature for all latitude and longitude values.

Now we compare the default plot for a slice through the model at noon and 500km altitude with one where several plot parameters are modified, for a subjectively more appealing figure.

Screenshot

Screenshot

While these are improved plots, more can be done. Another plot modification function can pick any arbitrary two values from Lat, Lon, Alt, Time and plot in 2D. Any supported coordinate system is also available, and Earth shorlines can also be overlayed, as well as custom plot titles.

Screenshot

Alternatively, the original fig1 from above can be viewed in 3D, again with other customizations such as coordinate system, title, colorscale, and contour ranges.

Screenshot

Custom plots for just one data source¶

Sometimes, custom plotting can't easily be generalized for all model readers yet. These custom options fit one model reader for now for specific types of plots. A custom model reader was written to read in satellite extractions from CCMC Run on Request magnetosphere runs. The custom plotting can show multiple satellite positions available for the duration of the run or it can pick one and show value and/or vector plots broken up into groupings by day or orbit.

Screenshot

Screenshot

Previous Next

Built with MkDocs using a theme provided by Read the Docs.
« Previous Next »