trident.spectrum_generator.SpectrumGenerator.load_spectrum
- SpectrumGenerator.load_spectrum(lambda_field=None, tau_field=None, flux_field=None)[source]
Load data arrays into an existing spectrum object.
Parameters
- Lambda_field
array
The array of valid wavelengths Default: None
- Tau_field
array
The array of optical depths for the corresponding wavelengths Default: None
- Flux_field
array
The array of flux values for the corresponding wavelengths Default: None
Example
Loading a custom set of data into an existing SpectrumGenerator object:
>>> import trident >>> import numpy as np >>> lambda_field = np.arange(1200,1400) >>> flux_field = np.ones(len(lambda_field)) >>> sg = trident.SpectrumGenerator('COS') >>> sg.load_spectrum(lambda_field=lambda_field, flux_field=flux_field) >>> sg.plot_spectrum('temp.png')