1. ArrayWFrame#
- class ArrayWFrame(array: ArrayWUnits | ndarray | float, units_or_frame: Units | Frame, frame: Frame = None)#
Bases:
objectDefines an object that contains informations about the reference frames associated with it.
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 (
UnitsorFrame) – Units or Frame objects to be linked with the objectframe (
Frame, optional) – Frame object to be linked with the ArrayWFrame. Defaults toNone.
See also
scarabaeus.Framedefine a Frame object that carry information about a SPICE-defined frame with origin and orientation
scarabaeus.Unitsdefine Units to be attached to numpy arrays
scarabaeus.ArrayWUnitsdefine an ArrayWUnits that carry information about numpy arrays and units linked to their content
Examples
# initial setup import scarabaeus as scb import scarabaeus.utils.NumpyWrapper 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.
The quantity or quantities linked to the Frame.
The shape of the ArrayWFrame.
Methods
T()Same as self.transpose()
append(other[, axis])NEED DESC
convert_to(frame_target[, epoch])Convert an entire AWF from its current frame to a target frame at given epochs.
cos()Trigonometric cosine operator for ArrayWFrame objects.
cross(other)Cross product operation between two ArrayWFrame objects.
exp()Exponential operator for ArrayWFrame objects.
exp2()Exponential base 2 operator for ArrayWFrame objects.
inverse()Inverse operator for ArrayWFrame objects.
log()Natural log operator for ArrayWFrame objects.
log10()Log base 10 operator for ArrayWFrame objects.
log2()Log base 2 operator for ArrayWFrame objects.
norm()Matrix or vector norm operator for ArrayWFrame objects.
Pseudo-inverse operator for ArrayWFrame objects.
sin()Trigonometric sine operator for ArrayWFrame objects.
Sum all elements in the ArrayWFrame object, if units allow.
tan()Trigonometric tangent operator for ArrayWFrame objects.
Transpose operator for ArrayWFrame objects.
unitary()Converts a given ArrayWFrame vector into a unit vector with the same units.
- 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.).
- unitary() Self#
Converts a given ArrayWFrame vector into a unit vector with the same units.
Only valid for vectorial ArrayWFrame.
- property quantity: ArrayWUnits#
The quantity or quantities linked to the Frame.