spacepy.pybats.bats.VirtSat¶
- class spacepy.pybats.bats.VirtSat(*args, **kwargs)[source]¶
A
spacepy.pybats.LogFile
object tailored to virtual satellite output; includes special satellite-specific plotting methods.- __init__(*args, **kwargs)[source]¶
Base class for “Data Model” representation data
Abstract method, reimplement
- Attributes:
- attrsdict
dictionary of the attributes of the SpaceData object
Methods
add_orbit_plot
([plane, target, loc, rbody, ...])Create a 2D orbit plot in the given plane (e.g. 'XY' or 'ZY').
add_sat_loc
(time, target[, plane, dobox, ...])For a given axes, target, add the location of the satellite at time time as a circle.
Calculates total magnetic field magnitude via: $|B|=sqrt{B_X^2+B_Y^2+B_Z^2}$.
calc_magincl
([units])Magnetic inclination angle (a.k.a.
Calculate number densities for each fluid.
calc_temp
([units])Calculate plasma temperature for each fluid.
get_position
(time)For an arbitrary time, time, return a tuple of coordinates for the satellite's position at that time in GSM coordinates.
Attributes
- add_orbit_plot(plane='XY', target=None, loc=111, rbody=1.0, title=None, trange=None, add_grid=True, style='g.', adjust_axes=True, add_arrow=True, arrow_kwargs={'color': 'g', 'ec': 'k', 'width': 0.05}, **kwargs)[source]¶
Create a 2D orbit plot in the given plane (e.g. ‘XY’ or ‘ZY’). Extra kwargs are handed to the plot function.
- Parameters:
- None
- Other Parameters:
- planestring
Set the plane in which to plot (XY, XZ, etc.) Defaults to XY.
- targetMatplotlib Figure or Axes object
Set plot destination. Defaults to new figure.
- loc3-digit integer
Set subplot location. Defaults to 111.
- adjust_axesbool
If True, axes will be customized to best display orbit (equal aspect ratio, grid on, planet drawn, etc.). Defaults to True.
- style: string
A matplotlib line style specifier. Defaults to ‘g.’.
- titlestring
Set title of axes.
- rbodyreal
Set radius of model inner boundary. Defaults to 1.0
- trangelist of datetimes
Set the time range to plot. Defaults to None, or entire dataset.
- add_gridbool
Turn on or off grid style of axes. Default is True.
- add_arrowbool
Add arrow at end of orbit path to indicate direction. Default is True.
- arrow_kwargsdict
Dictionary of arrow kwargs. Defaults to match line style.
- add_sat_loc(time, target, plane='XY', dobox=False, dolabel=False, size=12, c='k', **kwargs)[source]¶
For a given axes, target, add the location of the satellite at time time as a circle. If kwarg dolabel is True, the satellite’s name will be used to label the dot. Optional kwargs are any accepted by matplotlib.axes.Axes.plot. The kwarg plane specifies the plane of the plot, e.g., ‘XY’, ‘YZ’, etc.
- calc_bmag()[source]¶
Calculates total magnetic field magnitude via: $|B|=sqrt{B_X^2+B_Y^2+B_Z^2}$. Results stored as variable name b.
- calc_magincl(units='deg')[source]¶
Magnetic inclination angle (a.k.a. inclination angle) is defined: $Theta = sin^{-1}(B_Z/B)$. It is a crucial value when examining magnetic dynamics about geosychronous orbit, the tail, and other locations.
This function calculates the magnetic inclination for the Virtual Satellite object and saves it as b_incl. Units default to degrees; the keyword units can be changed to ‘rad’ to change this.
- calc_ndens()[source]¶
Calculate number densities for each fluid. Species mass is ascertained via recognition of fluid name (e.g. OpRho is clearly oxygen). A full list of recognized fluids/species can be found by exploring the dictionary mass found in
bats
. Composition is also calculated as percent of total number density.New values are saved using the keys speciesN (e.g. opN) and speciesFrac (e.g. opFrac).
- calc_temp(units='eV')[source]¶
Calculate plasma temperature for each fluid. Number density is calculated using calc_ndens if it hasn’t been done so already.
Temperature is obtained via density and pressure through the simple relationship P=nkT.
Use the units kwarg to set output units. Current choices are KeV, eV, and K. Default is eV.
- get_position(time)[source]¶
For an arbitrary time, time, return a tuple of coordinates for the satellite’s position at that time in GSM coordinates.
time should be type datetime.datetime, matplotlib.dates.date2num output (i.e., number of days (fraction part represents hours, minutes, seconds) since 0001-01-01 00:00:00 UTC, plus one), or a sequence of either. The satellite’s position is interpolated (linearly) to time.
- attrs: collections.abc.Mapping¶