Skip to content

Commit

Permalink
Fix ENVI *.hdr key wavelengths->wavelength
Browse files Browse the repository at this point in the history
  • Loading branch information
havardlovas committed Sep 6, 2024
1 parent f702dcd commit 1e63325
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gref4hsi/scripts/orthorectification.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def main(iniPath):



# Resample imagery (RGB composite or both)#! Here is the error
# Resample imagery (RGB composite or both)#!
gisHSI.resample_datacube(radiance_cube=radiance_cube,
wavelengths=wavelengths,
fwhm=fwhm,
Expand Down
7 changes: 4 additions & 3 deletions gref4hsi/utils/gis_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def resample_datacube(self, radiance_cube, wavelengths, fwhm, envi_cube_dir, rgb
chunk_size_GB = config_ortho.chunk_size_cube_GB


# If chunking is to be applied, we can use square chunks. Round to the nearest thousand because of personal OCD
# If chunking is to be applied, we can use square chunks
chunk_square_length = np.sqrt((chunk_size_GB*1024**3) / (k*bytes_per_entry))
self.chunk_square_length = int(np.round(chunk_square_length/1000)*1000)

Expand Down Expand Up @@ -169,15 +169,16 @@ def resample_datacube(self, radiance_cube, wavelengths, fwhm, envi_cube_dir, rgb
# To let ENVI pick up on which bands are used for red-green-blue vizualization
self.default_bands_string = '{ '+' , '.join([str(band_ind_R), str(band_ind_G), str(band_ind_B)]) + ' }'

# Some relevant metadata
# Some relevant metadata.
# See https://www.nv5geospatialsoftware.com/docs/ENVIHeaderFiles.html for documentation of the entries
metadata_ENVI = {
'description': 'Radiance converted, georeferenced data',
'unit': config_ortho.radiometric_unit,
'wavelength units': config_ortho.wavelength_unit,
'sensor type': config_ortho.sensor_type,
'default bands': self.default_bands_string,
'interleave': config_ortho.interleave,
'wavelengths': wavelengths
'wavelength': wavelengths
}
try:
# If vector form
Expand Down

0 comments on commit 1e63325

Please sign in to comment.