camerasensor

NOTE: This module is a feature under developement.

class pyvale.camerasensor.CameraBasic2D(cam_data: CameraData2D, field: IField, descriptor: SensorDescriptor | None = None)[source]

Bases: ISensorArray

calc_measurement_images() ndarray[source]
calc_measurements() ndarray[source]

Abstract method. Calculates measurements as: measurement = truth + systematic errors + random errors. The truth is calculated once and is interpolated from the input simulation field. The errors are calculated based on the user specified error chain.

NOTE: this is a 'calc' method and will sample all probability distributions in the error chain returning a new simulated experiment for this sensor array.

Returns:

np.ndarray -- The calculated measurements for this sensor array with shape: (num_sensors,num_field_components,num_time_steps)

calc_truth_values() ndarray[source]
get_descriptor() SensorDescriptor[source]
get_errors_random() ndarray | None[source]

Abstract method. Gets the random error array from the previously calculated sensor measurements. Returns None is no error integrator has been specified.

Returns:

np.ndarray | None -- Array of random errors for this sensor array. shape=(num_sensors ,num_field_components,num_time_steps). Returns None if no error integrator has been set.

get_errors_systematic() ndarray | None[source]

Abstract method. Gets the systematic error array from the previously calculated sensor measurements. Returns None is no error integrator has been specified.

Returns:

np.ndarray | None -- Array of systematic errors for this sensor array. shape=(num_sensors ,num_field_components,num_time_steps). Returns None if no error integrator has been set.

get_errors_total() ndarray | None[source]

Abstract method. Gets the total error array from the previously calculated sensor measurements. Returns None is no error integrator has been specified.

Returns:

np.ndarray | None -- Array of total errors for this sensor array. shape=(num_sensors ,num_field_components,num_time_steps). Returns None if no error integrator has been set.

get_field() IField[source]

Abstract method. Gets the field object that this array of sensors is sampling to simulate measurements.

Returns:

IField -- A field object interface.

get_image_measurements_shape() tuple[int, int, int, int][source]
get_measurement_images() ndarray[source]
get_measurement_shape() tuple[int, int, int][source]

Abstract method. Gets the shape of the measurement array: shape=(num_sensors,num_field_components,num_time_steps).

The number of sensors is specified by the user with a SensorData object. The number of field components is dependent on the field being sampled (i.e. 1 for a scalar field and 3 for a vector field in 3D). The number of time steps is specified by the user in the SensorData object or defaults to the time steps taken from the simulation.

Returns:

tuple[int,int,int] -- Shape of the measurement array as (num_sensors, num_field_components,num_time_steps)

get_measurements() ndarray[source]

Abstract method. Returns the current set of simulated measurements if theses have been calculated. If these have not been calculated then 'calc_measurements()' is called and a set of measurements in then returned.

NOTE: this is a 'get' method and does not sample from probability distributions in the error chain and directly returns the current set of measurements if they exist.

Returns:

np.ndarray -- The calculated measurements for this sensor array with shape: (num_sensors,num_field_components,num_time_steps)

get_sample_times() ndarray[source]
get_truth() ndarray[source]

Abstract method. Gets the ground truth sensor values that were calculated previously. If the ground truth values have not been calculated then calc_truth_values() is called first.

Returns:

np.ndarray -- Array of ground truth sensor values. shape=(num_sensors, num_field_components,num_time_steps).

set_error_integrator(err_int: ErrIntegrator) None[source]