spacepy.pybats.PbData¶
- class spacepy.pybats.PbData(*args, **kwargs)[source]¶
The base class for all PyBats data container classes. Inherits from
spacepy.datamodel.SpaceData
but has additional methods for quickly exploring an SWMF dataset.Just like
spacepy.datamodel.SpaceData
objects, PbData objects work just like dictionaries except they have special attr dictionary attributes for both the top-level object and most values. This means that the following syntax can be used to explore a generic PbData object:>>>print obj.keys() >>>print obj.attrs >>>value = obj[key]
Printing PbData objects will produce a tree of contents and attributes; calling
self.listunits()
will print all values that have the ‘units’ attribute and the associated units. Hence, it is often most instructive to use the following two lines to quickly learn a PbData’s contents:>>>print obj >>>obj.listunits()
PbData is the main organizational tool for Pybats datasets, so the information here is applicable to nearly all Pybats classes.
- __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
List all variables and associated units.
timeseries_append
(obj)If obj is of the same type as self, and both have a 'time' entry, append all arrays within obj that have the same size as 'time' to the corresponding arrays within self.
Attributes
- timeseries_append(obj)[source]¶
If obj is of the same type as self, and both have a ‘time’ entry, append all arrays within obj that have the same size as ‘time’ to the corresponding arrays within self. This is useful for combining time series data of consecutive data.
- attrs: collections.abc.Mapping¶