Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
already exists if
``data_dir`` isn't provided, or will
be generated if ``data_dir`` is provided
hdr_file (str): name of the ENVI spectral library to
generate (without the ``.hdr`` or
``.sli`` extension)
"""
if not hdr_file:
raise ValueError(
"Must provide path for generated ENVI header file.")
if not db_file:
raise ValueError("Must provide path for sqlite file.")
if data_dir:
spectral.AsterDatabase.create(db_file, data_dir)
aster_database = spectral.AsterDatabase(db_file)
spectrum_ids = [x[0] for x in aster_database.query(
'SELECT SampleID FROM Samples').fetchall()]
band_min = 0.38315
band_max = 2.5082
band_num = 128
band_info = spectral.BandInfo()
band_info.centers = numpy.arange(band_min, band_max,
(band_max - band_min) / band_num)
band_info.band_unit = 'micrometer'
library = aster_database.create_envi_spectral_library(spectrum_ids,
band_info)
library.save(hdr_file)
already exists if
``data_dir`` isn't provided, or will
be generated if ``data_dir`` is provided
hdr_file (str): name of the ENVI spectral library to
generate (without the ``.hdr`` or
``.sli`` extension)
"""
if not hdr_file:
raise ValueError(
"Must provide path for generated ENVI header file.")
elif not db_file:
raise ValueError("Must provide path for sqlite file.")
if data_dir:
spectral.AsterDatabase.create(db_file, data_dir)
aster_database = spectral.AsterDatabase(db_file)
spectrum_ids = [x[0] for x in aster_database.query(
'SELECT SampleID FROM Samples').fetchall()]
band_min = 0.38315
band_max = 2.5082
band_num = 128
band_info = spectral.BandInfo()
band_info.centers = numpy.arange(band_min, band_max,
(band_max - band_min) / band_num)
band_info.band_unit = 'micrometer'
library = aster_database.create_envi_spectral_library(spectrum_ids,
band_info)
library.save(hdr_file)