Skip to content

Exception raised when band info is not passed to SpectralLibrary constructor #102

@tboggs

Description

@tboggs

If wavelength info is not passed in the SpectralLibrary constructor header argument, the following exception is raised:

----> 1 s.save('mylib.json')

~/src/spectral/spectral/io/envi.py in save(self, fileBaseName, description)
    980             meta['samples'] = len(self.bands.centers)
    981         else:
--> 982             meta['samples'] = len(self.spectra.shape[0])
    983         meta['lines'] = self.spectra.shape[0]
    984         meta['bands'] = 1

TypeError: object of type 'int' has no len()

Line 982 should actually be

meta['samples'] = self.spectra.shape[1]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions