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

Class SourceSpectrum

source code


Base class for the Source Spectrum object.

Instance Methods [hide private]
 
__add__(self, other)
Source Spectra can be added.
source code
 
__sub__(self, other)
Source Spectra can be subtracted, which is just another way of adding.
source code
 
__mul__(self, other)
Source Spectra can be multiplied, by constants or by SpectralElement objects.
source code
 
__rmul__(self, other) source code
 
addmag(self, magval)
Adding a magnitude is like multiplying a flux.
source code
 
getArrays(self)
Returns wavelength and flux arrays as a tuple, performing units conversion.
source code
 
_getWaveProp(self) source code
 
_getFluxProp(self) source code
 
validate_units(self)
Ensure that waveunits are WaveUnits and fluxunits are FluxUnits
source code
 
writefits(self, filename, clobber=True, trimzero=True, binned=False, precision=None, hkeys=None)
Write the spectrum to a FITS file.
source code
 
integrate(self, fluxunits='photlam') source code
 
sample(self, wave)
Return a flux array, in self.fluxunits, on the provided wavetable
source code
 
convert(self, targetunits)
Convert to other units.
source code
 
redshift(self, z)
Returns a new redshifted spectrum.
source code
 
setMagnitude(self, band, value)
Makes the magnitude of the source in the band equal to value.
source code
 
renorm(self, RNval, RNUnits, band, force=False)
Renormalize the spectrum to the specified value (in the specified flux units) in the specified band.
source code
 
effstim(self, fluxunits='photlam') source code

Inherited from Integrator: trapezoidIntegration, validate_fluxtable, validate_wavetable

Inherited from Integrator (private): _columnsFromASCII

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

Properties [hide private]
  wave
Wavelength property
  flux
Flux property

Inherited from object: __class__

Method Details [hide private]

__add__(self, other)
(Addition operator)

source code 

Source Spectra can be added. Delegate the work to the CompositeSourceSpectrum class.

addmag(self, magval)

source code 

Adding a magnitude is like multiplying a flux. Only works for numbers -- not arrays, spectrum objects, etc

writefits(self, filename, clobber=True, trimzero=True, binned=False, precision=None, hkeys=None)

source code 
Write the spectrum to a FITS file.
filename:      name of file to write to
clobber=True:  Will clobber existing file by default
trimzero=True: Will trim zero-flux elements from both ends
           by default
binned=False:  Will write in native waveset by default
precision:     Will write in native precision by default; can be
           set to "single" or "double"
hkeys:         Optional dictionary of {keyword:(value,comment)}
           to be added to primary FITS header

convert(self, targetunits)

source code 

Convert to other units. This method actually just changes the wavelength and flux units objects, it does not recompute the internally kept wave and flux data; these are kept always in internal units. Method getArrays does the actual computation.

setMagnitude(self, band, value)

source code 

Makes the magnitude of the source in the band equal to value. band is a SpectralElement. This method is marked for deletion once the .renorm method is well tested.

renorm(self, RNval, RNUnits, band, force=False)

source code 

Renormalize the spectrum to the specified value (in the specified flux units) in the specified band. Calls a function in another module to alleviate circular import issues.


Property Details [hide private]

wave

Wavelength property

Get Method:
_getWaveProp(self)

flux

Flux property

Get Method:
_getFluxProp(self)