API Reference

Public

SpaceDataModel.AbstractDataVariableType

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 variable
  • units(v): the units of the variable
  • meta(v): the metadata of the variable
  • name(v): the name of the variable
  • dim(v, i): the i-th dimension of the variable
  • dim(v, name): the dimension named name of the variable
source
SpaceDataModel.AbstractRepresentationType

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
source
SpaceDataModel.InstrumentType
Instrument <: AbstractInstrument

Fields

  • name: The name of the instrument
  • metadata: Additional metadata
  • datasets: Collection of datasets
source
SpaceDataModel.LDataSetType
LDataSet <: AbstractDataSet

A template for generating datasets with parameterized naming patterns.

Fields

  • format: Format string pattern for the dataset name
  • data: Dictionary of variable patterns
  • metadata: 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.

source
SpaceDataModel.ProjectType
Project <: AbstractProject

A representation of a project or mission containing instruments and datasets.

Fields

  • name: The name of the project
  • metadata: Additional metadata
  • instruments: Collection of instruments
  • datasets: Collection of datasets
source
SpaceDataModel.getcsysMethod
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.

source
SpaceDataModel.getmetaFunction
getmeta(x, key, default=nothing)

Get metadata value associated with key for object x, or default if key is not present.

source
SpaceDataModel.setmetaFunction
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.

source
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.

source

Private

SpaceDataModel._getfieldFunction
_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.

source
SpaceDataModel.dimFunction
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.

source