Closed RippleGylf closed 4 years ago
Are you attempting to process the ASTER library or the ECOSTRESS library? I ask because the link you provided is for ECOSTRESS. Also, can you please provide the full output of the command you ran (it should have printed the name of the file and the pair of values it was attempting to process)?
ECOSTRESS, as far as I can tell, appears to be the current manifestation of the ASTER library. I'm not exactly sure when this shift occurred, but any links to the ASTER library direct to this set of pages.
The output of the command I ran is as follows:
Importing HSI_DATA/mineral.sulfide.none.medium.vswir.s-7a.jpl.beckman.spectrum.txt. [u'']
So this page indicates that ECOSTRESS was formerly the ASTER library. Give me some time to grab a few of the ECOSTRESS files and see how much effort would be involved in updating the import routine.
I received a copy of the ECOSTRESS library. It appears the format header section of the data files has changed slightly so I will need to create a modified version of the import code to handle the changes.
I've added the EcostressDatabase
class, which is functionally identical to AsterDatabase
but will parse ECOSTRESS library files instead.
In [2]: db = spy.EcostressDatabase.create('ecostress.db', './eco_data_ver1')
...
Importing ./eco_data_ver1/mineral.silicate.inosilicate.coarse.vswir.in-8a.jpl.perkin.spectrum.txt.
Importing ./eco_data_ver1/vegetation.shrub.aloe.arborescens.tir.jpl077.jpl.nicolet.spectrum.txt.
Importing ./eco_data_ver1/mineral.silicate.phyllosilicate.coarse.tir.ps-12f.jpl.nicolet.spectrum.txt.
Processed 3403 files.
In [3]: db.print_query('SELECT COUNT() FROM Samples WHERE Name LIKE "%stone%"')
78
I am trying to bring in the current version of the ASTER files available from https://speclib.jpl.nasa.gov/, but it runs into an IndexError on the first file every time. Is anyone aware of any changes to the formatting since the AsterDatabase.create function was made?
Error and traceback looks like this: