ImageHeader#
- class msfc_ccd.ImageHeader(pixel, time_start, timedelta, timedelta_requested, serial_number=None, run_mode=None, status=None, voltage_fpga_vccint=0, voltage_fpga_vccaux=0, voltage_fpga_vccbram=0, temperature_fpga=0, temperature_adc_1=0, temperature_adc_2=0, temperature_adc_3=0, temperature_adc_4=0)[source]#
Bases:
AbstractExplicitCartesianVectorArrayA singe FITS header or a sequence of FITS headers saved by MSFC camera.
Attributes
A
tupleofstrrepresenting the names of each dimension of this array.if this array has multiple components, broadcast them against each other.
Convert any instance of
AbstractVectorArrayto an instance ofAbstractCartesianNdVectorArrayThe vector components of this array expressed as a
dictwhere the keys are the names of the component.The scalar entries that compose this object.
Converts this array to an instance of
named_arrays.AbstractExplicitArray.Compute the index of each element of this array.
L2-norm of this array.
Cast this vector into its matrix representation.
Number of dimensions of the array.
Return a normalized copy of this vector, where
lengthis unity.The indices of each pixel in the image.
Return vector of same type with all components zeroed.
The Run Mode of the camera when each image was captured.
The serial number of the camera that captured each image.
The number of elements along each axis of the array.
Total number of elements in the array.
The status of the camera while each image was being captured.
Temperature 1 of the ADC when each image was captured.
Temperature 2 of the ADC when each image was captured.
Temperature 3 of the ADC when each image was captured.
Temperature 4 of the ADC when each image was captured.
The temperature of the FPGA when each image was captured.
The time in UTC at the midpoint of the exposure.
The time in UTC at the end of the exposure.
The time in UTC at the start of the exposure.
The measured exposure time of each image.
The requested exposure time of each image.
The
named_arrays.AbstractArraytype corresponding to this array.The
named_arrays.AbstractExplicitArraytype corresponding to this array.The corresponding
named_arrays.AbstractMatrixArrayclassReturns a new array with its units removed, if they exist.
The VCCAUX voltage of the FPGA when each image was captured.
The VCCBRAM voltage of the FPGA when each image was captured.
The VCCINT voltage of the FPGA when each image was captured.
Methods
__init__(pixel, time_start, timedelta, ...)add_axes(axes)Add new singleton axes to this array.
all([axis, where])Return
Trueif all of the elements along the given axes areTrue.any([axis, where])Return
Trueif any of the elements along the given axes areTrue.astype(dtype[, order, casting, subok, copy])Copy of the array cast to a specific data type.
broadcast_to(shape[, append])A new view of this array with the specified shape.
cell_centers([axis, random])Convert an array from cell vertices to cell centers.
combine_axes([axes, axis_new])Combine some of the axes of the array into a single new axis.
copy()Create a deep copy of this array.
Create a shallow copy of this array.
from_cartesian_nd(array[, like])Construct a new instance of this class using an instance of
named_arrays.CartesianNdVectorArray.from_components(components)Construct a new instance of this class using a
dictof components.from_scalar(scalar[, like])Convert a scalar (an instance of
named_arrays.AbstractScalar) into a vector.from_scalar_array(a[, like])Constructs a new version of this array using
aas the underlying data.index(value[, axis])index_secant(value[, axis])interp_linear(item)Linearly interpolate this array to find its value at the given fractional index.
max([axis, initial, where])The maximum value of this array along the given axes.
mean([axis, where])The mean value of this array along the given axes.
median([axis])The median value of this array along the given axes.
min([axis, initial, where])The minimum value of this array along the given axes.
ndindex([axis_ignored])An iterator that yields the index of each element of this array.
percentile(q[, axis, out, overwrite_input, ...])The requested percentile of this array along the given axes.
ptp([axis])The peak-to-peak value of this array along the given axes.
replace(**changes)A method version of
dataclasses.replace()for named arrays.reshape(shape)Reorganize this array into a new shape.
rms([axis, where])The root-mean-square of this array along the given axes.
std([axis, where])The standard deviation of this array along the given axes.
sum([axis, where])The sum of each element of this array along the given axes.
to(unit[, equivalencies, copy])Convert this array to a new unit.
to_string([prefix, multiline])Convert this array instance to a string representation.
to_string_array([format_value, format_unit, ...])Convert to an array of strings where each string has an appropriately-formatted unit attached to the value.
transpose([axes])Reorder the axes of this array to the given sequence.
var([axis, where])The variance of this array along the given axes.
vmr([axis, where])The variance-to-mean ratio of this array along the given axes.
volume_cell(axis)Computes the n-dimensional volume of each cell formed by interpreting this array as a logically-rectangular grid of vertices.
Inheritance Diagram

- Parameters:
pixel (AbstractCartesian2dVectorArray)
time_start (Time | AbstractScalar)
timedelta (Quantity | AbstractScalar)
timedelta_requested (Quantity | AbstractScalar)
serial_number (None | str | AbstractScalar)
run_mode (None | str | AbstractScalar)
status (None | str | AbstractScalar)
voltage_fpga_vccint (Quantity | AbstractScalar)
voltage_fpga_vccaux (Quantity | AbstractScalar)
voltage_fpga_vccbram (Quantity | AbstractScalar)
temperature_fpga (Quantity | AbstractScalar)
temperature_adc_1 (Quantity | AbstractScalar)
temperature_adc_2 (Quantity | AbstractScalar)
temperature_adc_3 (Quantity | AbstractScalar)
temperature_adc_4 (Quantity | AbstractScalar)
- classmethod from_cartesian_nd(array, like=None)#
Construct a new instance of this class using an instance of
named_arrays.CartesianNdVectorArray.- Parameters:
array (CartesianNdVectorArray) – The \(n\)-dimensional cartesian vector to convert.
like (None | AbstractExplicitVectorArray) – A reference instance of the result. This is needed if the resulting class has components that are themselves vectors.
- Return type:
- classmethod from_components(components)#
Construct a new instance of this class using a
dictof components.- Parameters:
components (dict[str, AbstractArray]) – A
dictof component names and values. The keys of the dict must match the names of the components in this class.- Return type:
- classmethod from_scalar(scalar, like=None)[source]#
Convert a scalar (an instance of
named_arrays.AbstractScalar) into a vector.- Parameters:
scalar (AbstractScalar)
like (None | AbstractExplicitVectorArray)
- Return type:
- classmethod from_scalar_array(a, like=None)#
Constructs a new version of this array using
aas the underlying data.- Parameters:
a (None | float | Quantity | AbstractArray) – Anything that can be coerced into an instance of
named_arrays.AbstractScalarArray.like (None | AbstractExplicitVectorArray) – Optional reference object. If provided, the result will be defined by this object.
- Return type:
- add_axes(axes)#
Add new singleton axes to this array.
- Parameters:
- Return type:
See also
named_arrays.add_axes()A functional version of this method.
- all(axis=None, where=<no value>)#
Return
Trueif all of the elements along the given axes areTrue.- Parameters:
- Return type:
See also
numpy.all()A functional version of this method.
- any(axis=None, where=<no value>)#
Return
Trueif any of the elements along the given axes areTrue.- Parameters:
- Return type:
See also
numpy.any()A functional version of this method.
- astype(dtype, order='K', casting='unsafe', subok=True, copy=True)#
Copy of the array cast to a specific data type.
Equivalent to
numpy.ndarray.astype().
- broadcast_to(shape, append=False)#
A new view of this array with the specified shape.
- Parameters:
- Return type:
See also
named_arrays.broadcast_to()A functional version of this method.
- cell_centers(axis=None, random=False)#
Convert an array from cell vertices to cell centers.
- Parameters:
- Return type:
- combine_axes(axes=None, axis_new=None)#
Combine some of the axes of the array into a single new axis.
- index(value, axis=None)#
- index_secant(value, axis=None)#
- interp_linear(item)#
Linearly interpolate this array to find its value at the given fractional index.
- max(axis=None, initial=<no value>, where=<no value>)#
The maximum value of this array along the given axes.
- Parameters:
axis (None | str | Sequence[str]) – The logical axis or axes along which the operation is computed.
initial (_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]) – The initial value of the minimum, required if where provided.
where (Self) – An optional mask which selects which elements to be considered.
self (Self)
- Return type:
See also
numpy.max()A functional version of this method.
- mean(axis=None, where=<no value>)#
The mean value of this array along the given axes.
- Parameters:
- Return type:
See also
numpy.mean()A functional version of this method.
- median(axis=None)#
The median value of this array along the given axes.
- Parameters:
axis (None | str | Sequence[str]) – The logical axis or axes along which the operation is computed.
See also
numpy.median()A functional version of this method.
- min(axis=None, initial=<no value>, where=<no value>)#
The minimum value of this array along the given axes.
- Parameters:
axis (None | str | Sequence[str]) – The logical axis or axes along which the operation is computed.
initial (_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]) – The initial value of the minimum, required if where provided.
where (Self) – An optional mask which selects which elements to be considered.
self (Self)
- Return type:
See also
numpy.min()A functional version of this method.
- ndindex(axis_ignored=None)#
An iterator that yields the index of each element of this array.
- Parameters:
- Return type:
See also
named_arrays.ndindex()A functional version of this method.
- percentile(q, axis=None, out=None, overwrite_input=False, method='linear', keepdims=False)#
The requested percentile of this array along the given axes.
- Parameters:
q (int | float | Quantity | Self) – The percentile to compute.
axis (None | str | Sequence[str]) – The logical axis or axes along which the operation is computed.
out (None | Self) – An optional output array in which to place the result.
overwrite_input (bool) – Whether to overwrite the input array.
method (str) – How to interpolate the result.
keepdims (bool) – A boolean flag indicating whether to keep the reduced dimensions.
self (Self)
See also
numpy.percentile()A functional version of this method.
- ptp(axis=None)#
The peak-to-peak value of this array along the given axes.
- Parameters:
- Return type:
See also
numpy.ptp()A functional version of this method.
- replace(**changes)#
A method version of
dataclasses.replace()for named arrays.- Parameters:
changes – The fields of the dataclass to be overwritten
- Return type:
- reshape(shape)#
Reorganize this array into a new shape.
- rms(axis=None, where=<no value>)#
The root-mean-square of this array along the given axes.
- std(axis=None, where=<no value>)#
The standard deviation of this array along the given axes.
- Parameters:
- Return type:
See also
numpy.std()A functional version of this method.
- sum(axis=None, where=<no value>)#
The sum of each element of this array along the given axes.
- Parameters:
- Return type:
See also
numpy.sum()A functional version of this method.
- to(unit, equivalencies=[], copy=True)#
Convert this array to a new unit.
Equivalent to
astropy.units.Quantity.to().- Parameters:
- Return type:
- to_string(prefix=None, multiline=None)#
Convert this array instance to a string representation.
- to_string_array(format_value='%.2f', format_unit='latex_inline', pad_unit='$\\,$')#
Convert to an array of strings where each string has an appropriately-formatted unit attached to the value.
- Parameters:
- Return type:
- transpose(axes=None)#
Reorder the axes of this array to the given sequence.
- Parameters:
- Return type:
See also
numpy.transpose()The
numpyversion of this method.
- var(axis=None, where=<no value>)#
The variance of this array along the given axes.
- Parameters:
- Return type:
See also
numpy.var()A functional version of this method.
- vmr(axis=None, where=<no value>)#
The variance-to-mean ratio of this array along the given axes.
- volume_cell(axis)#
Computes the n-dimensional volume of each cell formed by interpreting this array as a logically-rectangular grid of vertices.
Note that this method is usually only used for sorted arrays.
If self is a scalar, this method computes the length of each edge, and is equivalent to
numpy.diff(). If self is a 2d vector, this method computes the area of each quadrilateral, and if self is a 3d vector, this method computes the volume of each cuboid.
- property axes: tuple[str, ...]#
A
tupleofstrrepresenting the names of each dimension of this array.Must have the same length as the number of dimensions of this array.
- property axes_flattened: str#
Combine
axesinto a singlestr.This is useful for functions like
numpy.flatten()which returns an array with only one dimension.
- property broadcasted: AbstractExplicitArray#
if this array has multiple components, broadcast them against each other.
Equivalent to
a.broadcast_to(a.shape).
- property cartesian_nd: AbstractCartesianNdVectorArray#
Convert any instance of
AbstractVectorArrayto an instance ofAbstractCartesianNdVectorArray
- property components: dict[str, int | float | complex | ndarray | Quantity | AbstractArray]#
The vector components of this array expressed as a
dictwhere the keys are the names of the component.
- property entries: dict[str, int | float | complex | ndarray | Quantity | AbstractArray]#
The scalar entries that compose this object.
- property explicit: AbstractExplicitVectorArray#
Converts this array to an instance of
named_arrays.AbstractExplicitArray.
- property indices: dict[str, ScalarArrayRange]#
Compute the index of each element of this array.
See also
named_arrays.indices()A functional version of this method.
- property length: AbstractScalar#
L2-norm of this array.
- property matrix: AbstractMatrixArray#
Cast this vector into its matrix representation.
- property ndim: int#
Number of dimensions of the array. Equivalent to
numpy.ndarray.ndim.
- pixel: AbstractCartesian2dVectorArray = <dataclasses._MISSING_TYPE object>#
The indices of each pixel in the image.
- property prototype_vector: AbstractExplicitVectorArray#
Return vector of same type with all components zeroed.
- run_mode: None | str | AbstractScalar = None#
The Run Mode of the camera when each image was captured.
- serial_number: None | str | AbstractScalar = None#
The serial number of the camera that captured each image.
- property shape: dict[str, int]#
The number of elements along each axis of the array. Analogous to
numpy.ndarray.shapebut represented as adictwhere the keys are the axis names and the values are the axis sizes.
- property size: int#
Total number of elements in the array. Equivalent to
numpy.ndarray.size
- status: None | str | AbstractScalar = None#
The status of the camera while each image was being captured.
- temperature_adc_1: Quantity | AbstractScalar = 0#
Temperature 1 of the ADC when each image was captured.
- temperature_adc_2: Quantity | AbstractScalar = 0#
Temperature 2 of the ADC when each image was captured.
- temperature_adc_3: Quantity | AbstractScalar = 0#
Temperature 3 of the ADC when each image was captured.
- temperature_adc_4: Quantity | AbstractScalar = 0#
Temperature 4 of the ADC when each image was captured.
- temperature_fpga: Quantity | AbstractScalar = 0#
The temperature of the FPGA when each image was captured.
- property time: Time | ScalarArray#
The time in UTC at the midpoint of the exposure.
- property time_end: Time | ScalarArray#
The time in UTC at the end of the exposure.
- time_start: Time | AbstractScalar = <dataclasses._MISSING_TYPE object>#
The time in UTC at the start of the exposure.
- timedelta: Quantity | AbstractScalar = <dataclasses._MISSING_TYPE object>#
The measured exposure time of each image.
- timedelta_requested: Quantity | AbstractScalar = <dataclasses._MISSING_TYPE object>#
The requested exposure time of each image.
- property type_abstract: Type[Self]#
The
named_arrays.AbstractArraytype corresponding to this array.
- property type_explicit: Type[Self]#
The
named_arrays.AbstractExplicitArraytype corresponding to this array.
- property type_matrix: Type[AbstractCartesianMatrixArray]#
The corresponding
named_arrays.AbstractMatrixArrayclass
- um = <module 'numpy._core.umath' from '/home/docs/checkouts/readthedocs.org/user_builds/msfc-ccd/envs/latest/lib/python3.11/site-packages/numpy/_core/umath.py'>#
- property value: AbstractExplicitVectorArray#
Returns a new array with its units removed, if they exist.
- voltage_fpga_vccaux: Quantity | AbstractScalar = 0#
The VCCAUX voltage of the FPGA when each image was captured.
- voltage_fpga_vccbram: Quantity | AbstractScalar = 0#
The VCCBRAM voltage of the FPGA when each image was captured.
- voltage_fpga_vccint: Quantity | AbstractScalar = 0#
The VCCINT voltage of the FPGA when each image was captured.