enable different mixture choices per source
@@ -629,10 +629,6 @@ def surfmodel(config):
normalize = config['normalize']
reference_windows = config['reference_windows']
outfile = expand_path(configdir, config['output_model_file'])
- if 'mixtures' in config:
- mixtures = config['mixtures']
- else:
- mixtures = 0
# load wavelengths file
q = s.loadtxt(wavelength_file)
@@ -668,6 +664,14 @@ def surfmodel(config):
raise ValueError(
'Source %i is missing a parameter: %s' % (si, q))
+ # Determine whether we should synthesize our own mixtures
+ if 'mixtures' in source_config:
+ mixtures = source_config['mixtures']
+ elif 'mixtures' in config:
+ mixtures = config['mixtures']
+ else:
+ mixtures = 0
+
infiles = [expand_path(configdir, fi) for fi in
source_config['input_spectrum_files']]
ncomp = int(source_config['n_components'])
@@ -677,6 +681,7 @@ def surfmodel(config):
spectra = []
for infile in infiles:
+ print('Loading '+infile)
hdrfile = infile + '.hdr'
rfl = envi.open(hdrfile, infile)
nl, nb, ns = [int(rfl.metadata[n])
