Add ImageClass.OpticalFilters (2.1.0) - #13
cthvideometer wants to merge 1 commit into
Conversation
Each band's optical filter as a dict (type, pass band), or None for a plain reflectance band. reduceBands keeps it aligned. Needed by the ONNX model contract to tell filtered from unfiltered bands.
|
@henrikh Review: |
henrikh
left a comment
There was a problem hiding this comment.
Additional test case needed to check that filtered bands are properly read.
Need an implementation of the OpticalFilters field for the Python backend (see _init_python
| VMImageObject.StrobeTimesUniversal | ||
| ) | ||
| self.OpticalFilters = [ | ||
| self._opticalFilter2dict(VMImageObject.GetOpticalFilterForBand(band)) |
There was a problem hiding this comment.
Need to also make sure this works with the Python backend.
| def test_optical_filters_are_read_per_band(): | ||
| # Plain reflectance bands have no optical filter (None); filtered bands give a dict | ||
| # with type and pass band (see ImageClass.OpticalFilters). | ||
| img = hips.ImageClass(r"TestData\1c8f82ed-2ede-48c7-a0be-4978f282a6ea.hips") | ||
| assert len(img.OpticalFilters) == img.Bands | ||
| assert all(f is None for f in img.OpticalFilters) # No optical filters | ||
|
|
||
| img.reduceBands([0, 2]) | ||
| assert len(img.OpticalFilters) == 2 No newline at end of file |
There was a problem hiding this comment.
It would be good to have a test of actually parsing an image with filtered bands.
Each band's optical filter as a dict (type, pass band), or None for a plain reflectance band. reduceBands keeps it aligned. Needed by the ONNX model contract to tell filtered from unfiltered bands.