Package pysynphot :: Module spectrum :: Class FileSourceSpectrum
[hide private]
[frames] | no frames]

Class FileSourceSpectrum

source code


spec = FileSpectrum(filename (FITS or ASCII), fluxname=column name containing flux (for FITS tables only), keepneg=True to override thedefault behavior of setting negative flux values to zero)

Instance Methods [hide private]
 
__init__(self, filename, fluxname=None, keepneg=False)
Create a spectrum from a file.
source code
 
_readSpectrumFile(self, filename, fluxname) source code
 
_readFITS(self, filename, fluxname) source code
 
_readASCII(self, filename)
Ascii files have no headers.
source code

Inherited from TabularSourceSpectrum: GetWaveSet, ToInternal, __call__, __str__, resample, taper

Inherited from TabularSourceSpectrum (private): _reverse_wave

Inherited from SourceSpectrum: __add__, __mul__, __rmul__, __sub__, addmag, convert, effstim, getArrays, integrate, redshift, renorm, sample, setMagnitude, validate_units, writefits

Inherited from SourceSpectrum (private): _getFluxProp, _getWaveProp

Inherited from Integrator: trapezoidIntegration, validate_fluxtable, validate_wavetable

Inherited from Integrator (private): _columnsFromASCII

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]

Inherited from SourceSpectrum: flux, wave

Inherited from object: __class__

Method Details [hide private]

__init__(self, filename, fluxname=None, keepneg=False)
(Constructor)

source code 

Create a spectrum from a file.

Parameters:
  • filename (string) - FITS or ASCII file containing the spectrum
  • fluxname (string) - Column name specifying the flux (FITS only)
  • keepneg (bool) - If true, negative flux values will be retained; by default, they are forced to zero
Overrides: object.__init__

_readSpectrumFile(self, filename, fluxname)

source code 
Overrides: TabularSourceSpectrum._readSpectrumFile

_readFITS(self, filename, fluxname)

source code 
Overrides: TabularSourceSpectrum._readFITS

_readASCII(self, filename)

source code 

Ascii files have no headers. Following synphot, this routine will assume the first column is wavelength in Angstroms, and the second column is flux in Flam.

Overrides: TabularSourceSpectrum._readASCII