Package pysls :: Module sp :: Class spectra
[frames] | no frames]

Class spectra

source code

a spectra is a flux assiociated to wavelengths, the other parameters can be readfrom the SDSS data

Instance Methods
 
__init__(self, fluxes_cs=np.array([]), fluxes=np.array([]), noise=np.array([]), zsdss=0, coeff0=3.5793, coeff1=0.0001, ra=0, dec=0, angst=np.array([])) source code
 
initmask(self)
initialize the mask to an array containing only 'False' values, this fonction should be called only once the spectra is non-empty
source code
 
copy(self)
Returns a deep copy of itself
source code
 
pixtoangst(self, index)
converts a pixel to a wavelenght in angstroems, using a formula from SDSS site
source code
 
angsttopix(self, wavelength)
converts a wavelength in angstroems to a pixel (it is the inverse function 'pixtoangst')
source code
 
pixtoz(self, index)
converts a pixel to a redshift
source code
 
ztopix(self, z)
converts a redshift to a pixel (it is the inverse function 'pixtoz')
source code
 
setangst(self, coeff0=3.5793, coeff1=0.0001)
defines the wavelength of the spectra
source code
 
setz(self, z)
sets the wavelengths corrsponding to the redshift
source code
 
calc_csc(self)
substracts the continuum of the spectra, using a median filter
source code
 
read(self, directory, filename)
creates a spectra from a SDSS file (i.e.
source code
 
mask_angst(self, tupleslist, z=0)
for a spectra, we give a list of tuples (each one containing a wavelength and a width) and we hide the pixels at the given wavelength
source code
 
mask_height(self, height, fluxchoice)
hides the peaks higher than a given value [not used]
source code
 
mask_borders(self, lambda1=5007+20, lambda2=6562.81-160)
eliminates the flux outside the two given wavelengths
source code
 
specsim(self, z1, z2, model, noiseintensity, secintensity=1)
simulates a spectra containing one main and one secondary spectra : you give one spectra as a model, the noise intensity, the two redshift and the ratio between the two spectra flux [not used]
source code
Method Details

read(self, directory, filename)

source code 

creates a spectra from a SDSS file (i.e. reads the redshift, the flux, the noise...etc.