vista.sensors.sensor.Sensor

class vista.sensors.sensor.Sensor(name=None, platform=None, bias_images=None, bias_image_frames=None, uniformity_gain_images=None, uniformity_gain_image_frames=None, bad_pixel_masks=None, bad_pixel_mask_frames=None)[source]

Base class for sensor geodetic conversion and radiometric modeling

The Sensor class provides a framework for representing sensors and their associated characteristics including projection polynomials and radiometric calibration data.

Core Attributes

namestr

Unique name for this sensor. Used as the primary identifier.

bias_imagesNDArray, optional

3D array of bias/dark frames with shape (num_bias_images, height, width).

bias_image_framesNDArray, optional

1D array specifying frame ranges for each bias image.

uniformity_gain_imagesNDArray, optional

3D array of flat-field/gain correction images.

uniformity_gain_image_framesNDArray, optional

1D array specifying frame ranges for each uniformity gain image.

bad_pixel_masksNDArray, optional

3D array of bad pixel masks.

bad_pixel_mask_framesNDArray, optional

1D array specifying frame ranges for each bad pixel mask.

Sensor Platform Information

platformSensorPlatform

SensorPlatform object containing sensor position and pointing information.

Notes

  • PSF modeling is optional and can be used for fitting signal blobs to estimate irradiance

  • Sensor names must be unique within a VISTA session

  • Class variable _instance_count tracks the total number of Sensor instances created

  • Geodetic conversion requires valid polynomial coefficients for the time of interest

  • Calibration frame arrays define ranges: frame N applies until frame N+1 starts

__init__(name=None, platform=None, bias_images=None, bias_image_frames=None, uniformity_gain_images=None, uniformity_gain_image_frames=None, bad_pixel_masks=None, bad_pixel_mask_frames=None)

Methods

__init__([name, platform, bias_images, ...])

can_correct_bad_pixel()

Check if sensor has radiometric bad pixel masks.

can_correct_bias()

Check if sensor has bias images

can_correct_non_uniformity()

Check if sensor has uniformity gain images

can_geolocate()

Check if sensor can convert pixels to geodetic coordinates and vice versa.

geodetic_to_pixel(times, loc)

Convert geodetic coordinates to pixel coordinates using polynomial coefficients.

model_psf([sigma, size])

Model the sensor's point spread function (PSF).

pixel_to_geodetic(times, rows, columns)

Convert pixel coordinates to geodetic coordinates using polynomial coefficients.

to_hdf5(group)

Save sensor radiometric calibration data to an HDF5 group.

Attributes

name: str | None = None
platform: SensorPlatform | None = None
bias_images: NDArray | None = None
bias_image_frames: NDArray | None = None
uniformity_gain_images: NDArray | None = None
uniformity_gain_image_frames: NDArray | None = None
bad_pixel_masks: NDArray | None = None
bad_pixel_mask_frames: NDArray | None = None
uuid: str = None
__post_init__()[source]

Initialize sensor instance and increment global counter.

Generates a unique UUID for this sensor instance and initializes its name and sensor platform if not provided.

__eq__(other)[source]

Compare Sensors based on UUID

model_psf(sigma=None, size=None)[source]

Model the sensor’s point spread function (PSF).

This is an optional method that can be overridden by subclasses to provide PSF modeling capability. The PSF can be used to fit signal pixel blobs in imagery to estimate irradiance.

Parameters:
  • sigma (float, optional) – Standard deviation parameter for PSF modeling (e.g., Gaussian width)

  • size (int, optional) – Size of the PSF kernel to generate

Returns:

2D array representing the point spread function, or None if not implemented

Return type:

NDArray[np.float64] or None

Notes

The default implementation returns None. Subclasses should override this method to provide specific PSF models (e.g., Gaussian, Airy disk, etc.).

can_geolocate()[source]

Check if sensor can convert pixels to geodetic coordinates and vice versa.

Notes

The default implementation returns False. Subclasses can override this method.

Returns:

True if sensor has both forward and reverse geolocation polynomials.

Return type:

bool

can_correct_bad_pixel()[source]

Check if sensor has radiometric bad pixel masks.

Returns:

True if sensor has radiometric bad pixel masks.

Return type:

bool

can_correct_bias()[source]

Check if sensor has bias images

Returns:

True if sensor has bias images.

Return type:

bool

can_correct_non_uniformity()[source]

Check if sensor has uniformity gain images

Returns:

True if sensor has uniformity gain images.

Return type:

bool

geodetic_to_pixel(times, loc)[source]

Convert geodetic coordinates to pixel coordinates using polynomial coefficients.

Parameters:
  • times (np.datetime64 or np.ndarray) – Time(s) for which to perform the conversion. If a number, it is assumed that a time axis for the location is not present. If an array, it is expected to have the same length as the final (time) axis of the location, and each element specifies the time for the corresponding location.

  • loc (EarthLocation) – Astropy EarthLocation object(s) containing geodetic coordinates in km

Returns:

  • rows (np.ndarray) – Array of row pixel coordinates (NaN for base implementation)

  • columns (np.ndarray) – Array of column pixel coordinates (NaN for base implementation)

Return type:

Tuple[ndarray, ndarray]

Notes

The default implementation returns NaN arrays. Subclasses should override this method to provide geodetic-to-pixel conversion using their specific projection model (e.g., polynomial coefficients).

pixel_to_geodetic(times, rows, columns)[source]

Convert pixel coordinates to geodetic coordinates using polynomial coefficients.

Parameters:
  • times (np.datetime64 or np.ndarray) – Time(s) for which to perform the conversion. If a number, it is assumed that a time axis for the rows and columns is not present. If an array, it is expected to have the same length as the final (time) axis of rows/columns, and each element specifies the time for the corresponding pixel coordinates.

  • rows (np.ndarray) – Array of row pixel coordinates

  • columns (np.ndarray) – Array of column pixel coordinates

Returns:

Astropy EarthLocation object(s) with geodetic coordinates (NaN for base implementation)

Return type:

EarthLocation

Notes

The default implementation returns EarthLocation with NaN coordinates. Subclasses should override this method to provide pixel-to-geodetic conversion using their specific projection model.

to_hdf5(group)[source]

Save sensor radiometric calibration data to an HDF5 group.

Parameters:

group (h5py.Group) – HDF5 group to write sensor data to (typically sensors/<sensor_uuid>/)

Notes

This method writes radiometric calibration data to the HDF5 group: - bias_images and bias_image_frames - uniformity_gain_images and uniformity_gain_image_frames - bad_pixel_masks and bad_pixel_mask_frames

Subclasses should call super().to_hdf5(group) and then add their own data.

__init__(name=None, platform=None, bias_images=None, bias_image_frames=None, uniformity_gain_images=None, uniformity_gain_image_frames=None, bad_pixel_masks=None, bad_pixel_mask_frames=None)