spacepy.pybats.ram¶
A module for reading, handling, and plotting RAM-SCB output.
Functions
|
Creates a circle of radius kwarg rad (default 2.0 RE) at the center of axis ax. |
|
Add the "Earth" to the center of a polar dial plot located on axis "ax". |
|
Given number of points and a lower boundary (nE and lb), build the RAM-SCB energy grid. |
|
Given number of points, $*nPa*$, build the RAM-SCB pitch angle grid. |
|
Given the number of radial points, nR, the min and max of the radial extent, rmin and rmax, repsectively, create and return the radial grid of RAM-SCB as a vector of points in Earth radii. |
|
Given the number of local time grid points, nT, return, as vectors, the grid points in local time in units of radians and then local time hours that would be used in RAM-SCB. |
|
Several custom colorbars used by RIM and AMIE have become standard when visualizing data from these models. |
|
Attempt to plot x=0 and y=0 gridlines w/o messing up plot range. |
|
Read a T89 input file intended for RAM-SCB. |
|
Set major ticks to multiples of 1, minor ticks to 1/4. |
|
Vizualize the RAM-SCB energy grid. |
Create a quick-look plot of % O+ as calculated by Young et al. for various values of Kp and F10.7. |
|
|
Determine plasma sheet composition using the Young et al. empirical relationship based on Kp and F10.7 (first and second arguments, respectively) as given by Young et al. [JGR, 1982, Vol. |
Classes
|
Read, plot, and edit flux $([filename].swf)$ or $([filename].dat)$ files. |
|
A class that collects many |
|
The 3D equilibrium code produces NetCDF files that contain the electric currents throughout the domain. |
|
Base class for reading electric field input and output ASCII files. |
|
GeoMltFile is a class to open, read, manipulate and write files that contain LANL geosynchronous multi-satellite averaged, MLT-interpolated fluxes. |
|
The 3D equilibrium code produces NetCDF files that contain the ionospheric potential on the polar cap as well as mapped to the equatorial plane. |
|
|
|
It is sometimes necessary to read and parse a PARAM.in file. |
|
Opens an ascii-format boundary file written from IM_wrapper.f90:IM_put_from_gm in the coupled SWMF-RAM-SCB model. |
|
A class for reading and visualizing pressure_####.in files. |
|
A class to handle and plot RAM-SCB virtual satellite files. |
|
Slight variation on the weimer class to read weq_***.in files. |
- spacepy.pybats.ram.add_body(ax, rad=2.0, rotate=0.0, add_night=True, **extra_kwargs)[source]¶
Creates a circle of radius kwarg rad (default 2.0 RE) at the center of axis ax. Then, a planet of radius 1.0 RE is added to the center to represent the Earth. Extra kwargs are passed to the patch generators.
Three patches are created by this function: the inner boundary (a light grey Circle patch), the planet (a white Circle patch) and the night side of the planet (a black wedge.) All three are returned to the caller.
The kwarge “rotate”, which defaults to 0.0, can be set to any angle (in degrees) to rotate the location of local noon/midnight on the planet patches. The default is local noon points towards +X. A rotate value of 90 will cause local noon to point towards +Y.
Example
>>>ax=pylab.subplot(111) >>>inner, planet, night = rampy.add_body(ax)
If you are using a polar axis, try using add_body_polar.
- spacepy.pybats.ram.add_body_polar(ax, noon=90.0)[source]¶
Add the “Earth” to the center of a polar dial plot located on axis “ax”. Kwarg noon specifies the angle counter clockwise from the x-axis, in degrees, that is local noon (e.g. sun facing.) Default is 90 degrees, or in the +Y direction.
- spacepy.pybats.ram.gen_egrid(nE=36, lb=0.1, ew=0.03, power=1.27)[source]¶
Given number of points and a lower boundary (nE and lb), build the RAM-SCB energy grid. Three arrays are returned: ebound(nE+1), the boundary of each bin, ecenter(nE), the center of each bin, and ewidth(nE), the width of each bin. All output units are in keV.
Grid parameters can be set with kwargs but default to common RAM values: ======= ========================================= Kwarg Description ======= ========================================= nE Number of grid points. lb Lower boundary of energy grid in keV ew Width of first energy bin. power Power series exponent to determine grid spacing. ======= =========================================
Usage:
>>> (ecentr, ebound, ewidth)=gen_egrid(nE=36, lb=0.1, ew=3E-2, power=1.27)
- spacepy.pybats.ram.gen_pgrid(nPa=72)[source]¶
Given number of points, $*nPa*$, build the RAM-SCB pitch angle grid. The return value is a $*nPa*x3$ matrix containing the bin starts, centers, and ends in cosine of pitch angle.
- spacepy.pybats.ram.gen_rgrid(nR=20, rmin=1.75, rmax=6.5)[source]¶
Given the number of radial points, nR, the min and max of the radial extent, rmin and rmax, repsectively, create and return the radial grid of RAM-SCB as a vector of points in Earth radii.
Note that the first and last cells are ghost cells.
- spacepy.pybats.ram.gen_tgrid(nT=25)[source]¶
Given the number of local time grid points, nT, return, as vectors, the grid points in local time in units of radians and then local time hours that would be used in RAM-SCB.
- spacepy.pybats.ram.get_iono_cb(ct_name='bwr')[source]¶
Several custom colorbars used by RIM and AMIE have become standard when visualizing data from these models. These are ‘blue_white_red’ and ‘white_red’, used for data that have positive and negative values and for data that have only positive values, respectively. This function builds and returns these colorbars when called with the initials of the color table name as the only argument.
For RAM-SCB usage, the ‘bwr’ color map is useful for plotting ionospheric potential and will create plots that look similar to those produced by AMIE and RIM. The ‘wr’ color map is useful when plotting anisotropy.
Example - get each colormap:
>>>bwr_map = get_iono_cb(‘bwr’) >>>wr_map = get_iono_cb(‘wr’)
- spacepy.pybats.ram.grid_zeros(axis)[source]¶
Attempt to plot x=0 and y=0 gridlines w/o messing up plot range. This should be called last when creating a plot; after you have the range sorted out.
- spacepy.pybats.ram.read_t89file(filename)[source]¶
Read a T89 input file intended for RAM-SCB.
Usage:
>>> time, b_dip, b_ext = read_t89file('somefile.t89')
- spacepy.pybats.ram.set_orb_ticks(axis)[source]¶
Set major ticks to multiples of 1, minor ticks to 1/4.
- spacepy.pybats.ram.viz_egrid(nE=36, lb=0.1, ew=0.03, power=1.27)[source]¶
Vizualize the RAM-SCB energy grid. All kwargs correspond to those used by
gen_egrid()
.
- spacepy.pybats.ram.viz_young_comp()[source]¶
Create a quick-look plot of % O+ as calculated by Young et al. for various values of Kp and F10.7. No input arguments are taken.
- spacepy.pybats.ram.young_comp(kp, f107)[source]¶
Determine plasma sheet composition using the Young et al. empirical relationship based on Kp and F10.7 (first and second arguments, respectively) as given by Young et al. [JGR, 1982, Vol. 87 No. A11]
Returns fraction of total number density that is Hydrogen, Helium, and Oxygen.
Example usage:
>>> FracH, FracHe, FracO = young_comp(5, 150.0)