-
Couldn't load subscription status.
- Fork 1
Loading and Plotting simulation data
GEMINI *.m scripts require either:
- GNU Octave ≥ 4.0
- Matlab ≥ R2007b
Note that only the essential scripts needed to setup a simple example, and plot the results are included in the main GEMINI repository.
Gemini-scripts repository has more involved examples.
The plotting scripts are mostly in the vis/ directory. The results for an entire simulation can be plotted using plotall.m.
These also illustrates how to read in a sequence of files from a simulation.
This script prints a copy of the output plots into the simulation output directory. Finer-level output control can be achieve by using the 'plotframe.m' and 'loadframe.m' scripts to plot and load data from individual simulation output frames, respectively.
The particular format of the output files is specified by the user in the input config.ini file. There are three options:
- full output - output all state variables; very large file sizes will results, but this is required for building initial conditions and for some analysis that require detailed composition and temperature information.
- average state parameter output - species averaged temperature and velocity; electron density. Probably best for most uses
- density only output - only electron density output. Best for high-res instability runs where only the density is needed and the output cadence is high
The organization of the data in the MATLAB/octave workspace, after a single frame is loaded via 'loadframe.m', is as follows. MKSA units are used throughout:
simdate - a six element vector containing year, month, day, UT hour, UT minute, and UT seconds of the present frame
- structure xg - members xg.x1,2,3 are the position variables,
xg.h*are the metric factors,xg.dx*are the finite differences, - xg.glat,glon are the latitudes and longitudes (degrees geographic) of each grid point, xg.alt is the altitude of each grid point.
- xg.r,theta,phi - for each grid point: radial distance (from ctr of Earth), magnetic colatitude (rads.), and magnetic longitude (rads.)
The grid structure, by itself, can be read in by the MATLAB function 'readgrid.m'; this is automatically invoked with 'loadframe.m' so there is not need to separately load the grid and output frame data.
Ts
- first three dimensions have size
lxs - 4th dimension is species index: 1=O+,2=NO+,3=N2+,4=O2+,5=N+, 6=H+,7=e-)
ns (same indexing as temperature)
vs1 (same indexing as temperature)
- x2-drift component: v2 (same for all species, so this is just size lxs and is a 3D array)
- x3-drift component: v3
- current density: J1, J2, J3
- potential: Phitop (EFL potential)
Note that the electric field is not included in the output file, but that it can be calculated from this output by taking -vxB at an altitude above about 200 km or by differentiating the top boundary electric potential 'Phitop' with respect to the x2 and x3 variables; however, note that if a curvilinear grid is used the derivatives must include the appropriate metric factors.