API Reference
Public
SpaceDataModel.AbstractCoordinateSystem — Type
AbstractCoordinateSystemBase abstract type for all coordinate system implementations.
SpaceDataModel.AbstractCoordinateVector — Type
AbstractCoordinateVectorBase abstract type to represent coordinates in a coordinate systems.
SpaceDataModel.AbstractDataVariable — Type
A variable v of a type derived from AbstractDataVariable should at least implement:
Base.parent(v): the parent array of the variable
Optional:
times(v): the timestamps of the variableunits(v): the units of the variablemeta(v): the metadata of the variablename(v): the name of the variabledim(v, i): thei-th dimension of the variabledim(v, name): the dimension namednameof the variable
SpaceDataModel.AbstractReferenceFrame — Type
A specific realization of a reference system.
SpaceDataModel.AbstractRepresentation — Type
Abstract base for representing a point in a 3D coordinate system.
Reference:
- https://docs.astropy.org/en/stable/coordinates/representations.html
- https://github.com/JuliaEarth/CoordRefSystems.jl/blob/main/src/crs.jl
SpaceDataModel.DataSet — Type
DataSet <: AbstractDataSetA concrete dataset with a name, data (parameters), and metadata.
SpaceDataModel.DataSet — Method
Construct a DataSet from a name and data, with optional metadata.
SpaceDataModel.DataSet — Method
DataSet(ld::LDataSet; kwargs...)Create a concrete DataSet from a Dataset template with specified data.
See also: LDataSet
SpaceDataModel.Instrument — Type
Instrument <: AbstractInstrumentFields
name: The name of the instrumentmetadata: Additional metadatadatasets: Collection of datasets
SpaceDataModel.Instrument — Method
Construct an Instrument from a dictionary.
SpaceDataModel.Instrument — Method
keyword-based constructor
SpaceDataModel.LDataSet — Type
LDataSet <: AbstractDataSetA template for generating datasets with parameterized naming patterns.
Fields
format: Format string pattern for the dataset namedata: Dictionary of variable patternsmetadata: Additional metadata
Examples
using SPEDAS.MMS
# Access FPI dataset specification
lds = mms.datasets.fpi_moms
# Create a concrete dataset with specific parameters
ds = DataSet(lds; probe=1, data_rate="fast", data_type="des")The format string and variable patterns use placeholders like {probe}, {data_rate}, which are replaced with actual values when creating a concrete DataSet.
SpaceDataModel.Project — Type
Project <: AbstractProjectA representation of a project or mission containing instruments and datasets.
Fields
name: The name of the projectmetadata: Additional metadatainstruments: Collection of instrumentsdatasets: Collection of datasets
SpaceDataModel.Project — Method
keyword-based constructor
SpaceDataModel.TimeRanges — Type
An iterator over a series of time ranges that are window long, with a cadence of cadence.
SpaceDataModel.getcsys — Method
getcsys(x)Get the coordinate system of x. Ideally, this should return both the reference frame and coordinate representation.
If x is a instance of AbstractCoordinateSystem, return x itself. If x is a type of AbstractCoordinateSystem, return an instance of the coordinate system, i.e. x().
This is a generic function, packages should extend it for their own types.
SpaceDataModel.getmeta — Function
getmeta(x, key, default=nothing)Get metadata value associated with key for object x, or default if key is not present.
SpaceDataModel.getmeta — Method
getmeta(x)Get metadata for object x. If x does not have metadata, return NoMetadata().
SpaceDataModel.setmeta — Function
setmeta(x, key => value, ...; symbolkey => value2, ...)
setmeta(x, dict::AbstractDict)Update metadata for object x for key key to have value value and return x.
SpaceDataModel.setmeta! — Function
setmeta!(x, key => value, ...; symbolkey => value2, ...)
setmeta!(x, dict::AbstractDict)Update metadata for object x in-place and return x. The metadata container must be mutable.
The arguments could be multiple key-value pairs or a dictionary of metadata; keyword arguments are also accepted.
Examples
setmeta!(x, :units => "m/s", :source => "sensor")
setmeta!(x, Dict(:units => "m/s", :quality => "good"))
setmeta!(x; units="m/s", calibrated=true)Throws an error if the metadata is not mutable. Use setmeta for immutable metadata.
Private
SpaceDataModel._getfield — Function
_getfield(v, name, default)Return the field from a composite v for the given name, or the given default if no field is present.
See also: getfield.
SpaceDataModel.dim — Function
dim(x, i)
dim(x, name)Get the i-th dimension of object x, or the dimension associated with the given name. The default implementation returns axes(x, i).
A dimension may be time-varying or dependent on other dimensions; in such cases, the effective size of the corresponding array dimension ndims can be greater than 1.