spacepy.pybats.bats.BatsLog

class spacepy.pybats.bats.BatsLog(filename, starttime=(2000, 1, 1, 0, 0, 0), keep_case=True, *args, **kwargs)[source]

A specialized version of LogFile that includes special methods for plotting common BATS-R-US log file values, such as D$_{ST}$.

__init__(filename, starttime=(2000, 1, 1, 0, 0, 0), keep_case=True, *args, **kwargs)

Base class for “Data Model” representation data

Abstract method, reimplement

Attributes:
attrsdict

dictionary of the attributes of the SpaceData object

Methods

add_dst_quicklook([target, loc, plot_obs, ...])

Create a quick-look plot of Dst (if variable present in file) and compare against observations.

fetch_obs_dst()

Fetch the observed Dst index for the time period covered in the logfile.

fetch_obs_sym()

Fetch the observed SYM-H index for the time period covered in the logfile.

Attributes

add_dst_quicklook(target=None, loc=111, plot_obs=False, epoch=None, add_legend=True, plot_sym=False, dstvar=None, lw=2.0, obs_kwargs={'ls': '-.'}, sym_kwargs={'ls': '-'}, **kwargs)[source]

Create a quick-look plot of Dst (if variable present in file) and compare against observations.

Like all add_* * methods in Pybats, the *target kwarg determines where to place the plot. If kwarg target is None (default), a new figure is generated from scratch. If target is a matplotlib Figure object, a new axis is created to fill that figure at subplot location loc (defaults to 111). If target is a matplotlib Axes object, the plot is placed into that axis at subplot location loc.

With newer versions of BATS-R-US, new dst-like variables are included, named ‘dst’, ‘dst-sm’, ‘dstflx’, etc. This subroutine will attempt to first use ‘dst-sm’ as it is calculated consistently with observations. If not found, ‘dst’ is used. Users may choose which value to use via the dstvar kwarg.

Observed Dst and SYM-H is automatically fetched from the Kyoto World Data Center via the spacepy.pybats.kyoto module. The associated spacepy.pybats.kyoto.KyotoDst or spacepy.pybats.kyoto.KyotoSym object, which holds the observed Dst/SYM-H, is stored as self.obs_dst for future use. The observed line can be customized via the obs_kwargs kwarg, which is a dictionary of plotting keyword arguments.

If kwarg epoch is set to a datetime object, a vertical dashed line will be placed at that time.

The figure and axes objects are returned to the user.

Changed in version 0.5.0: Separated kwargs for Sym-H and Dst lines.

fetch_obs_dst()[source]

Fetch the observed Dst index for the time period covered in the logfile. Return True on success.

Observed Dst is automatically fetched from the Kyoto World Data Center via the spacepy.pybats.kyoto module. The associated spacepy.pybats.kyoto.KyotoDst object, which holds the observed Dst, is stored as self.obs_dst for future use.

fetch_obs_sym()[source]

Fetch the observed SYM-H index for the time period covered in the logfile. Return True on success.

Observed SYM-H is automatically fetched from the Kyoto World Data Center via the spacepy.pybats.kyoto module. The associated spacepy.pybats.kyoto.KyotoSym object, which holds the observed Dst, is stored as self.obs_sym for future use.

attrs: collections.abc.Mapping