Here is a collection of scripts that we use with OpenGGCM to get data and analyze/plot OpenGGCM output. Much of this is in Perl and/or f77. We try to keep this compact by wrapping everything into a perl script (at least JR does). If there are newer versions, we keep the older ones here and distinguish the with a YYYYMMDD string in the file name. Everything uploaded here should be gzipped. We provide these scripts under the GNU GPL license V3.0. We give no guarantee, expressed or implied, that these scripts produce correct results.
- The fppn f77 pre-processor. It is also part of the OpenGGCM distribution, but provided here for those who don't want the distribution but only run the scripts and codes provided here.
- Attach:utils3.for.gz (JR)
A set of f77 utility codes
- Attach:mak.get-all-sc-20200615.gz (JR)
This script automagically downloads and formats various data sets from CDAWEB, MADRIGAL, NGDC, etc., like THEMIS, GEOTAIL, WIND, DMSP, GOES, and THEMIS ground mags. One basically just supplies a date range and averaging interval, and the script will grab and process the data. This typically takes hours. Downloaded data are cached in '$HOME/00cache-scdata'. Most data sets come in 1 day chunks. The decoded 1 day chunks (all in ascii) are stored in '$HOME/00cache-sc-days/YYYMMDD', where YYYYMMDD is the start date of the interval.
The data are then averaged and gap-filled (except spectra) and stored locally in 'data.YYYYMMDD'. Our standard time series format is as follows: each variable in one file, named as '$sc.$vname', for example 'tha.bxgse' for THEMIS A B-field x-component. One record per time: 'YYYY MO DD HH MI SS value'. Optionally an epoch time in the 7th column. Gaps are filled by linear interpolation. For spectra (currently DMSP only): 'YYYY MO DD HH MI SS energy flux energy flux ....' for as many energy channels there are. The script also renames the data to have common variable names, and computes some derived variables such as vector magnitudes. For most s/c orbit data (xgse,yges,zgse) are also included.
TODO: more sources (DISCOVR, LANL, ...)
Note: This supercedes code described on Processed S/C Data page.
- Attach:mak.gridxplot.gz (JR)
Creates a plot of dx(x) and dx(i). Requires gnuplot. Run after the runme has created the code. Either run within $RUN directory without argument, or outside (../) with the $RUN as argument.
- Attach:mak.compare-runme.gz (JR)
Compares runme files from different runs. Only outputs the differences. Typically use as mak.compare-runme $RUN1 $RUN2 .... or like mak.compare-runme jx-20150317-??.
- Attach:dl2.gz (JR
Compact listing of OpenGGCM output files, as in dl2 $RUN, where $RUN is the directory with the files.
Output looks like:
jr-2011-03-08-b5/jr-2011-03-08-b5.3df.[020160,042840,360] (64)
jr-2011-03-08-b5/jr-2011-03-08-b5.ioc.[000000,042900,60] (716)
jr-2011-03-08-b5/jr-2011-03-08-b5.iof.[000060,016200,60] (271)
jr-2011-03-08-b5/jr-2011-03-08-b5.iof.[016210,019990,10] (380)
jr-2011-03-08-b5/jr-2011-03-08-b5.iof.[020040,043140,60] (386)
IDL routines
Python routines
As follows a set of python scripts that retrieve data from the OpenGGCM output incorporating Fortran routines as Python modules.
Previous routine is a pure Python script and it does not incorporate any Fortran module, thus it can be run directly from the terminal or the IPython console. Next, a Fortran routine to read different 3d fields from the OpenGGCM output. This routine has been included as a module in the readdata.py script using the tool f2py.
- Attach:call_read.f.gz (JC)
Reads 3-d(3df) output files, the b(x,y,z), v(x,y,z), xj(x,y,z), rr, pp and resis fields are available. .
- Attach:readdata.py.gz (JC)
Python routine that reads the 3d-fields(3df) of the OpenGGCM output using the Fortran routine call_read.f. It saves the 3d-fields for post-processing to a hdf5 file as f(8bytes) to avoid data loss for compression. Note: this script is not restricted just to hd5f files, it can save data to any format compatible with Python.
To use the the call_read.f routine as a Python module for first time, please recompile the module in your system using the command
f2py -c -m readmagfiel3d call_read.f
in the terminal. Here, we have assumed that you already have f2py and a Fortran compiler installed in your system.
Other tools
- probe/pyprobe (fishercat.sr.unh.edu:/home/mgilson/git/probe.git)
- pyggcm (fishercat.sr.unh.edu:/home/mgilson/git/pyggcm.git)
- GGCMtools (fishercat.sr.unh.edu:/home/kmaynard/git/ggcm_tools.git)