vista.sensors.sampled_sensor.SampledSensor

class vista.sensors.sampled_sensor.SampledSensor(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, radiometric_gain=None, radiometric_gain_frames=None, poly_pixel_to_arf_azimuth=None, poly_pixel_to_arf_elevation=None, poly_arf_to_row=None, poly_arf_to_col=None, times=None)[source]

Sensor implementation providing ARF polynomials.

SampledSensor stores ARF polynomials and radiometric gain at known times, providing geodetic coordinate conversion capabilities and gain calibration.

radiometric_gain

1D array of multiplicative factors to convert from counts to irradiance in units of kW/km²/sr.

Type:

NDArray, optional

radiometric_gain_frames

1D array specifying frame ranges for each radiometric gain value.

Type:

NDArray, optional

poly_pixel_to_arf_azimuth

Polynomial coefficients for converting (column, row) to ARF azimuth (radians). Shape: (N, num_coeffs) where num_coeffs depends on polynomial order.

Type:

NDArray[np.float64], optional

poly_pixel_to_arf_elevation

Polynomial coefficients for converting (column, row) to ARF elevation (radians). Shape: (N, num_coeffs) where num_coeffs depends on polynomial order.

Type:

NDArray[np.float64], optional

poly_arf_to_row

Polynomial coefficients for converting (azimuth, elevation) to row. Shape: (N, num_coeffs) where num_coeffs depends on polynomial order.

Type:

NDArray[np.float64], optional

poly_arf_to_col

Polynomial coefficients for converting (azimuth, elevation) to column. Shape: (N, num_coeffs) where num_coeffs depends on polynomial order.

Type:

NDArray[np.float64], optional

times

Times corresponding to each ARF polynomial. Must have length N.

Type:

NDArray[np.datetime64]

Notes

  • Duplicate times in the input are automatically removed during initialization

  • For 2+ unique samples: uses linear interpolation within range, linear extrapolation outside

  • For 1 sample: returns the same polynomial coefficients for all query times

  • ARF (Attitude Reference Frame) is a local coordinate system where the X-axis points along the sensor pointing direction

__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, radiometric_gain=None, radiometric_gain_frames=None, poly_pixel_to_arf_azimuth=None, poly_pixel_to_arf_elevation=None, poly_arf_to_row=None, poly_arf_to_col=None, times=None)

Methods

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

append(poly_pixel_to_arf_azimuth, ...)

Append new times and polynomials to the sensor.

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 ARF polynomials.

get_coefficients(coeffs, times)

Return polynomial coefficients for the given times via interpolation/extrapolation.

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 ARF polynomials.

to_hdf5(group)

Save sampled sensor data to an HDF5 group.

Attributes

bad_pixel_mask_frames

bad_pixel_masks

bias_image_frames

bias_images

name

platform

poly_arf_to_col

poly_arf_to_row

poly_pixel_to_arf_azimuth

poly_pixel_to_arf_elevation

radiometric_gain

radiometric_gain_frames

times

uniformity_gain_image_frames

uniformity_gain_images

uuid

radiometric_gain: NDArray | None = None
radiometric_gain_frames: NDArray | None = None
poly_pixel_to_arf_azimuth: NDArray[float64] | None = None
poly_pixel_to_arf_elevation: NDArray[float64] | None = None
poly_arf_to_row: NDArray[float64] | None = None
poly_arf_to_col: NDArray[float64] | None = None
times: NDArray[datetime64] | None = None
__post_init__()[source]

Validate inputs and remove duplicate times.

Ensures times and polynomials have compatible shapes and removes any duplicate time entries along with their corresponding polynomial coefficients.

Raises:

ValueError – If polynomial coefficients have incompatible shapes with their times.

append(poly_pixel_to_arf_azimuth, poly_pixel_to_arf_elevation, poly_arf_to_row, poly_arf_to_col, times)[source]

Append new times and polynomials to the sensor. Must be compatible with existing data. After appending, duplicate times are removed and arrays are sorted in order of increasing time.

Parameters:
  • poly_pixel_to_arf_azimuth (NDArray[np.float64]) – New polynomial samples corresponding to the new times.

  • poly_pixel_to_arf_elevation (NDArray[np.float64]) – New polynomial samples corresponding to the new times.

  • poly_arf_to_row (NDArray[np.float64]) – New polynomial samples corresponding to the new times.

  • poly_arf_to_col (NDArray[np.float64]) – New polynomial samples corresponding to the new times.

  • times (NDArray[np.datetime64]) – New time sample(s) to append.

can_geolocate()[source]

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

Returns:

True if sensor has all required ARF geolocation data: platform position and pointing vectors and both forward (pixel→ARF) and reverse (ARF→pixel) polynomials.

Return type:

bool

get_coefficients(coeffs, times)[source]

Return polynomial coefficients for the given times via interpolation/extrapolation.

Parameters:
  • coeffs (NDArray[np.float64]) – A reference to one of the sensor’s already existing ARF polynomial coefficients arrays

  • times (NDArray[np.datetime64]) – Array of times for which to retrieve polynomial coefficients

Returns:

Polynomial coefficients as (N, num_coeffs) array where N is the number of query times.

Return type:

NDArray[np.float64]

Notes

  • For sensors with 1 sample: returns the single set of coefficients for all times

  • For sensors with 2+ samples: uses linear interpolation within the time range and linear extrapolation outside the range

pixel_to_geodetic(times, rows, columns)[source]

Convert pixel coordinates to geodetic coordinates using ARF polynomials.

Uses ARF (Attitude Reference Frame) polynomials to map (row, column) pixel coordinates to geodetic coordinates by ray-casting to the Earth’s surface. Pixels that do not intersect Earth will have NaN coordinates.

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. Returns NaN coordinates for pixels that do not intersect Earth. Returns NaN coordinates if polynomials are not available.

Return type:

EarthLocation

Raises:

ValueError – If times is an array and its length does not match the length of the last axis of rows and columns

Notes

  • Requires ARF polynomials to be defined

  • Returns NaN coordinates if polynomials are not available

  • Off-Earth pixels will have NaN x/y/z geocentric coordinates. This corresponds to 90/0/NaN for its lat/lon/height values, so a check for NaN coordinates need only check for NaN height.

geodetic_to_pixel(times, loc)[source]

Convert geodetic coordinates to pixel coordinates using ARF polynomials.

Uses ARF (Attitude Reference Frame) polynomials to map geodetic coordinates (latitude, longitude, altitude) to (row, column) pixel coordinates. This method properly handles targets at any altitude, not just ground level.

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 (NaNs if polynomials unavailable)

  • columns (np.ndarray) – Array of column pixel coordinates (NaNs if polynomials unavailable)

Raises:

ValueError – If times is an array and its length does not match the length of the last axis of location

Return type:

Tuple[ndarray, ndarray]

Notes

  • Requires ARF polynomials to be defined

  • Returns NaN coordinates if polynomials are not available

  • Properly handles targets at any altitude (not limited to ground level)

to_hdf5(group)[source]

Save sampled sensor data to an HDF5 group.

Parameters:

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

Notes

This method extends the base Sensor.to_hdf5() by adding: - Geolocation polynomials in geolocation/ subgroup - Radiometric gain values in radiometric/ subgroup

__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, radiometric_gain=None, radiometric_gain_frames=None, poly_pixel_to_arf_azimuth=None, poly_pixel_to_arf_elevation=None, poly_arf_to_row=None, poly_arf_to_col=None, times=None)