Skip to content

Commit

Permalink
Remove stack normalization when writing stack to disk
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastien Courroux committed Mar 27, 2024
1 parent 90fbede commit 0c9a509
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions micasense/capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,12 +602,9 @@ def save_capture_as_stack(self, outfilename, sort_by_wavelength=False, photometr

eo_count = len(eo_list)

multispec_min = np.min(np.percentile(aligned_cap[:, :, 1:eo_count].flatten(), 0.01))
multispec_max = np.max(np.percentile(aligned_cap[:, :, 1:eo_count].flatten(), 99.99))

for outband_count, inband in enumerate(eo_list):
outband = outRaster.GetRasterBand(outband_count + 1)
outdata = imageutils.normalize(aligned_cap[:, :, inband], multispec_min, multispec_max)
outdata = self.__aligned_capture[:, :, inband]
outdata[outdata < 0] = 0
outdata[outdata > 2] = 2 # limit reflectance data to 200% to allow some specular reflections
outdata = outdata * 32767 # scale reflectance images so 100% = 32768
Expand Down

0 comments on commit 0c9a509

Please sign in to comment.