1. ArrayWFrame#
- class ArrayWFrame(array: ArrayWUnits | ndarray | float, units_or_frame: Units | Frame, frame: Frame = None)#
Bases:
object
This class define ArrayWFrame objects, which contains informations about the reference frames associated to them. An ArrayWFrame links an ArrayWUnits (which links a quantity with units) with a Frame on which the ArrayWUnits is specified with respect to.
- Parameters:
array (
ArrayWUnits
) – Quantity that needs to be linked with a reference frame.units_or_frame (
Units
orFrame
) – scb.Units or scb.Frame objects that need to be linked with the objectframe (
Frame
, optional) – scb.Frame object that need to be linked with the object. Defaults toNone
.
See also
scarabaeus.Frame
define a Frame object that carry information about a SPICE-defined frame with origin and orientation
scarabaeus.Units
define Units to be attached to numpy arrays
scarabaeus.ArrayWUnits
define an ArrayWUnits that carry information about numpy arrays and units linked to their content
Examples
# initial setup import scarabaeus as scb import numpy as np # generate units km = scb.Units.get_units('km') # load spice kernels furnshKernelFilename = os.getcwd() + "/data/Kernels/kernels.tm" scb.SpiceManager.load_kernel_from_mkfile(furnshKernelFilename) # generate common frames (J2000,ITRF93,ECLIPJ2000,IAUEARTH) = scb.Frame.generate_common_frames() # Generate nparray and awu quantities (2 different AWF initializations) quantity_nparray = np.random.rand(5, 100) quantity_awu = scb.ArrayWUnits(quantity_nparray,km) # Create the AWF in 2 different ways: # Method (1), AWU and Frame initialization arrayWframe = scb.ArrayWFrame(quantity_awu, J2000) # Method (2), np.array and Frame initialization arrayWframe = scb.ArrayWFrame(quantity_nparray, km, J2000)
Attributes
The associated frame of the ArrayWFrame.
quantity that needs to be linked to the Frame
The shape of the ArrayWFrame.
Methods
convert_to
(frame_target[, epoch])Convert an entire AWF from its current frame to a target frame at given epochs.
- convert_to(frame_target: Frame, epoch: EpochArray = None) None #
Convert an entire AWF from its current frame to a target frame at given epochs.
- Parameters:
frame_target (
Frame
) – The target frame to convert to.epoch (
EpochArray
, optional) – Given an array of ET at which the transformations hold. Required if the AWF has time-dependent data.
- Raises:
ValueError – If the transformation requirements are not met (shape mismatch, incompatible frames, etc.).
- property quantity: ArrayWUnits#
quantity that needs to be linked to the Frame
- Base:
ArrayWFrame
- Type: