SP2SP

Reformat a set of spectra


EnvironmentsPYTHON :: EASI :: MODELER
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Example :: Acknowledgements

Back to top

Description


Reads spectra from a file and outputs them to a file of user-specified type.
Back to top

Parameters


sp2sp(specfili, specfilo, sprecs, filotype)

Name Type Caption Length Value range
SPECFILI * str Input spectrum library file name 1 -    
SPECFILO * str Output spectrum library file name 1 -    
SPRECS List[int] Spectrum records 0 -    
FILOTYPE str Type of File to be Created 0 - 16 SPCB | XLS | TXT
Default: SPCB

* Required parameter
Back to top

Parameter descriptions

SPECFILI

Specifies the name of the input spectra library file.

SPECFILO

Specifies the name of the output spectra library file. If a file with the specified name exists, it will be overwritten.

The following rules apply to the output spectra library file extensions:

SPRECS

Specifies the record numbers (1 to N) of the spectra in the input file to be copied to the output file. If this parameter is not specified, all spectra in the input file is copied to the output.

FILOTYPE

Specifies the type of the output file.

Supported file types are:
Note: If TXT (text file) is specified, a file with a ".gav" extension with also be generated that contains the schema for the file.
Back to top

Details

Both the input and output files must be GDB-recognized spectra library files.

Back to top

Example

Read all spectra from a SPCB-format file and write them to an XLS-format file.

from pci.sp2sp import sp2sp

specfili	=	"splib04a-part.spl"
specfilo	=	"splib04a-part-spl2.xls"
sprecs	=	[]
filotype	=	"xls"

sp2sp( specfili, specfilo, sprecs, filotype )
Back to top

Acknowledgements

PCI Geomatics received financial support from the Canadian Space Agency/L'Agence Spatiale Canadienne through the Earth Observation Application Development Program (EOADP) for the development of this software, under contract 9F028-0-4902/12.

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.