Skip to content
Merged
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ heading to indicate that only the bug fixes and security fixes are in the bug fi
release.
-->

## [Unreleased]

### Changed
- Reduced linescan ISD ephemeris sampling from one-per-line to every 10th line for images with 1000+ lines, significantly reducing ISD file sizes and load times for large sensors. Configurable via `reduction` and `ephem_sample_rate` props. [#677](https://github.com/DOI-USGS/ale/pull/677)

### Fixed
- Fixed Eigen 5.x compatibility by removing version constraint in CMakeLists.txt [#677](https://github.com/DOI-USGS/ale/pull/677)

## [1.1.3] - 2026-03-12

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ else()
endif()

if(ALE_USE_EXTERNAL_EIGEN)
find_package(Eigen3 3.3 REQUIRED NO_MODULE)
find_package(Eigen3 REQUIRED NO_MODULE)
else()
add_library (eigen INTERFACE)
add_library (Eigen3::Eigen ALIAS eigen)
Expand Down
19 changes: 18 additions & 1 deletion ale/base/type_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,24 @@ def ephemeris_time(self):
ephemeris times split based on image lines
"""
if not hasattr(self, "_ephemeris_time"):
self._ephemeris_time = np.linspace(self.ephemeris_start_time, self.ephemeris_stop_time, self.image_lines + 1)
# Determine reduction mode. Default is "linear" (subsample every
# Nth line). Set reduction=None via props to keep one-per-line.
props = self._props if hasattr(self, '_props') else {}
reduction = props.get('reduction', 'linear')
rate = props.get('ephem_sample_rate', 10)

if reduction == 'linear':
# Sample at most every Nth line to keep ISD file size in check
# for large linescan images (e.g., 177k lines for Chandrayaan-2
# TMC). For images under ~1000 lines, keep one sample per line
# to avoid reducing below 100 samples.
reduced = self.image_lines // rate + 1
num_samples = reduced if reduced >= 100 else self.image_lines + 1
else:
# No reduction: one sample per line (original behavior)
num_samples = self.image_lines + 1

self._ephemeris_time = np.linspace(self.ephemeris_start_time, self.ephemeris_stop_time, num_samples)
return self._ephemeris_time

@property
Expand Down
56 changes: 0 additions & 56 deletions ale/drivers/chandrayaan_drivers.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,34 +611,6 @@ def sensor_frame_id(self):

return self.original_naif_sensor_frame_id - 10

@property
def ephemeris_time(self):
"""
Returns an array of times between the start/stop ephemeris times
based on the number of lines in the image.
Expects ephemeris start/stop times to be defined. These should be
floating point numbers containing the start and stop times of the
images.
Expects image_lines to be defined. This should be an integer containing
the number of lines in the image.

Returns
-------
: ndarray
ephemeris times split based on image lines
"""

# Override the parent class logic, as returning the ephemeris time for
# every single line does not scale for Chandrayaan2 TMC images, which
# can have 189999 lines. Sampling at every 10th line should be enough.
num = self.image_lines
if num > 20000:
num = int(float(num) / 10.0)
if not hasattr(self, "_ephemeris_time"):
self._ephemeris_time = \
numpy.linspace(self.ephemeris_start_time, self.ephemeris_stop_time, num + 1)
return self._ephemeris_time

class Chandrayaan2OHRCIsisLabelNaifSpiceDriver(LineScanner, IsisLabel, NaifSpice, NoDistortion, Driver):

@property
Expand Down Expand Up @@ -814,31 +786,3 @@ def sensor_frame_id(self):
"""

return self.original_naif_sensor_frame_id - 10

@property
def ephemeris_time(self):
"""
Returns an array of times between the start/stop ephemeris times
based on the number of lines in the image.
Expects ephemeris start/stop times to be defined. These should be
floating point numbers containing the start and stop times of the
images.
Expects image_lines to be defined. This should be an integer containing
the number of lines in the image.

Returns
-------
: ndarray
ephemeris times split based on image lines
"""

# Override the parent class logic, as returning the ephemeris time for
# every single line does not scale for Chandrayaan2 OHRC images, which
# can have 101075 lines. Sampling at every 10th line should be enough.
num = self.image_lines
if num > 20000:
num = int(float(num) / 10.0)
if not hasattr(self, "_ephemeris_time"):
self._ephemeris_time = \
numpy.linspace(self.ephemeris_start_time, self.ephemeris_stop_time, num + 1)
return self._ephemeris_time
Loading
Loading