spacepy.pybats.ram.RamSat¶
- class spacepy.pybats.ram.RamSat(filename)[source]¶
A class to handle and plot RAM-SCB virtual satellite files. Instantiate an object by simply calling:
>>>sat=rampy.RamSat(‘SatFile.nc’)
Simple satellite file info, such as the time vector, file name, and output frequency are found as direct object attributes:
- >>>sat.time
array([2005-08-31 09:29:00, …,2005-09-02 00:58:00],dtype=object)
Data arrays are stored as object keys. For example, obtain satellite coordinates by typing:
>>>sat[‘SM_xyz’]
RamSats work, for the most part, like dictionaries. Add a new data entry (an array, constant, etc.) by simply calling:
>>>sat[‘New Thing’]=(0,1,2,3,4)
Be sure to peruse the docstrings of the many object methods to discover the many plotting functions and other capabilities.
- __init__(filename)[source]¶
Base class for “Data Model” representation data
Abstract method, reimplement
- Attributes:
- attrsdict
dictionary of the attributes of the SpaceData object
Methods
add_omniflux_plot
(nameflux[, target, zlim, ...])Create and place a pcolor-type plot of omnidirectional flux.
add_orbit_plot
([plane, target, timelim, ...])Add a simple, 2D plot of the satellite orbit in a given (SM) plane.
create_omniflux
([check])Integrate the flux(currently as a function of energy and pitch angle) to get omnidirectional flux as a function of energy.
plot_omni_quicklook
([flux_opts, eflux_opts, ...])Create a quick-look plot of omnidirectional fluxes.
Attributes
- add_omniflux_plot(nameflux, target=None, zlim=[10000.0, 1000000000.0], add_cbar=True, do_orbticks=False, title=False, timelim=False, loc=111, no_xlabels=False)[source]¶
Create and place a pcolor-type plot of omnidirectional flux.
Omnidirectional fluxes are calculated by the object method “create_omniflux” and are saved into the object with keys such as ‘omniO’ and ‘omniHe’, etc.
- Other Parameters:
- targetFigure or Axes
If None (default), a new figure is generated from scratch. If a matplotlib Figure object, a new axis is created to fill that figure. If a matplotlib Axes object, the plot is placed into that axis.
- locint
Use to specify the subplot placement of the axis (e.g. loc=212, etc.) Used if target is a Figure or None. Default 111 (single plot).
- do_orbticksboolean
Activate orbit ticks (default False): add complex but informational tick marks that list the satellite’s coordinates along with the time on the x-axis. However, using these will require some “massaging” of the plot to make them properly visible. Be sure to add lots of padding to the bottom of the plot.
- no_xlabelsboolean
(Default False) Completely omit xlabel and xticklabels. Convenient for stacking flux plots on each other.
- add_orbit_plot(plane='XY', target=None, timelim=False, loc=111, ls='g.', title=False, invertX=True)[source]¶
Add a simple, 2D plot of the satellite orbit in a given (SM) plane.
- Other Parameters:
- planestring
Plane to plot. Options are ‘XY’, ‘XZ’, and ‘YZ’; defaults ‘XY’.
- targetFigure or Axes
If None (default), a new figure is generated from scratch. If a matplotlib Figure object, a new axis is created to fill that figure. If a matplotlib Axes object, the plot is placed into that axis.
- locint
Use to specify the subplot placement of the axis (e.g. loc=212, etc.) Used if target is a Figure or None. Default 111 (single plot).
- invertXboolean
Reverse the SM X axis so “Sun is to the left.” Default True. This reverses the SM axis, not the plot axis, so it has no effect if plane is YZ.
- timelimtuple
A tuple of two
datetime.datetime
objects specifying the time range to be plotted. Defaults to None such that the whole time range available is plotted.- titlestring
Sets title for plot axes.
- lsstring
A matplotlib-compatable line format specifier, e.g., ‘b-‘. Defaults to ‘g.’, or green dots.
- create_omniflux(check=True)[source]¶
Integrate the flux(currently as a function of energy and pitch angle) to get omnidirectional flux as a function of energy. New units = (cm-2*s*keV)^-1
Usage: just call this method to integrate all species.
- Other Parameters:
- checkBoolean
If check is True (default) then the presence of existing omni variables will cause this calculation to abort cleanly. If check is False, anything pre-calculated will be overwritten.
- plot_omni_quicklook(flux_opts=None, eflux_opts=None, hflux_opts=None, oflux_opts=None)[source]¶
Create a quick-look plot of omnidirectional fluxes.
- Returns:
- outFigure
Has 9 axes instances (axes attribute) 0: XY orbit plot 1: XZ orbit plot 2: YZ orbit plot 3: e- flux 4: H+ flux 5: O+ flux 6: e- flux color bar 7: H+ flux color bar 8: O+ flux color bar
- Other Parameters:
- flux_optsdict
dictionary of keyword arguments to pass to
add_omniflux_plot()
for all flux plots- eflux_optsdict
as flux_opts, but for the electron flux plot only
- hflux_optsdict
as flux_opts, but for the H+ flux plot only
- oflux_optsdict
as flux_opts, but for the O+ flux plot only
- attrs: collections.abc.Mapping¶