vista.sensors.sensor.Sensor¶
- class vista.sensors.sensor.Sensor(name, 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, _instance_count=0)[source]¶
Base class for sensor position, line-of-sight, geodetic conversion, and radiometric modeling
The Sensor class provides a framework for representing sensor platforms and their associated characteristics including projection polynomials and radiometric calibration data.
- bias_images¶
3D array of bias/dark frames with shape (num_bias_images, height, width).
- Type:
NDArray, optional
- bias_image_frames¶
1D array specifying frame ranges for each bias image.
- Type:
NDArray, optional
- uniformity_gain_images¶
3D array of flat-field/gain correction images.
- Type:
NDArray, optional
- uniformity_gain_image_frames¶
1D array specifying frame ranges for each uniformity gain image.
- Type:
NDArray, optional
- bad_pixel_masks¶
3D array of bad pixel masks.
- Type:
NDArray, optional
- bad_pixel_mask_frames¶
1D array specifying frame ranges for each bad pixel mask.
- Type:
NDArray, optional
Notes
All positions are in Earth-Centered Earth-Fixed (ECEF) Cartesian coordinates
Position units are kilometers
Positions are represented as (3, N) arrays with x, y, z in each column
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
Examples
>>> # Subclass can implement get_positions >>> class MySensor(Sensor): ... def get_positions(self, times): ... # Return sensor positions for given times ... return np.array([[x1, x2], [y1, y2], [z1, z2]])
- __init__(name, 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, _instance_count=0)¶
Methods
__init__(name[, bias_images, ...])add_imagery(imagery)Register imagery with this sensor and update frame/time tracking.
Check if sensor has radiometric bad pixel masks.
Check if sensor has bias images
Check if sensor has uniformity gain images
Check if sensor can convert pixels to geodetic coordiantes and vice versa.
geodetic_to_pixel(frame, loc)Convert geodetic coordinates to pixel coordinates using polynomial coefficients.
Get all unique imagery frames and corresponding times in increasing order.
get_positions(times)Return sensor positions in Cartesian ECEF coordinates for given times.
model_psf([sigma, size])Model the sensor's point spread function (PSF).
pixel_to_geodetic(frame, rows, columns)Convert pixel coordinates to geodetic coordinates using polynomial coefficients.
to_hdf5(group)Save sensor radiometric calibration data to an HDF5 group.
Attributes
- __post_init__()[source]¶
Initialize sensor instance and increment global counter.
Generates a unique UUID for this sensor instance and initializes internal data structures for tracking associated imagery.
- get_imagery_frames_and_times()[source]¶
Get all unique imagery frames and corresponding times in increasing order.
- Returns:
frames (NDArray[np.int_]) – Sorted array of unique frame numbers
times (NDArray[np.datetime64]) – Sorted array of corresponding timestamps
- Return type:
Tuple[ndarray[tuple[Any, …], dtype[_ScalarT]], ndarray[tuple[Any, …], dtype[_ScalarT]]]
Notes
This method aggregates frames and times from all imagery objects that have been registered with this sensor via add_imagery().
- add_imagery(imagery)[source]¶
Register imagery with this sensor and update frame/time tracking.
Adds the imagery’s frames and times to the sensor’s internal registry for coordinate conversion and time-to-frame mapping. Duplicate imagery (by UUID) or imagery without times is ignored.
- Parameters:
imagery (Imagery) – Imagery object to register with this sensor
Notes
Only imagery with non-None times are tracked
Duplicate frame/time pairs are automatically removed
This method is typically called automatically when Imagery is created
- get_positions(times)[source]¶
Return sensor positions in Cartesian ECEF coordinates for given times.
- Parameters:
times (NDArray[np.datetime64]) – Array of times for which to retrieve sensor positions
- Returns:
Sensor positions as (3, N) array where N is the number of times. Each column contains [x, y, z] coordinates in ECEF frame (km).
- Return type:
NDArray[np.float64]
Notes
The default implementation returns None. Subclasses should override this method
- 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:
- 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 coordiantes 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:
- can_correct_bad_pixel()[source]¶
Check if sensor has radiometric bad pixel masks.
- Returns:
True if sensor has radiometric bad pixel masks.
- Return type:
- can_correct_bias()[source]¶
Check if sensor has bias images
- Returns:
True if sensor has bias images.
- Return type:
- can_correct_non_uniformity()[source]¶
Check if sensor has uniformity gain images
- Returns:
True if sensor has uniformity gain images.
- Return type:
- geodetic_to_pixel(frame, loc)[source]¶
Convert geodetic coordinates to pixel coordinates using polynomial coefficients.
- Parameters:
frame (int) – Frame number for which to perform the conversion
loc (EarthLocation) – Astropy EarthLocation object(s) containing geodetic coordinates
- 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:
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(frame, rows, columns)[source]¶
Convert pixel coordinates to geodetic coordinates using polynomial coefficients.
- Parameters:
frame (int) – Frame number for which to perform the conversion
rows (np.ndarray) – Array of row pixel coordinates
columns (np.ndarray) – Array of column pixel coordinates
- Returns:
Astropy EarthLocation object(s) with geodetic coordinates (zeros for base implementation)
- Return type:
EarthLocation
Notes
The default implementation returns EarthLocation with zero 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, 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, _instance_count=0)¶