1 """
2 Candidat
3 """
4
5
6 import copy as pythoncopy
7 import numpy as np
8 import pyfits as pf
9 import sp
10 import li
11 import cPickle
12
14 """a candidat comes from a spectra that satisfy certain criteria of selection, it contains : a name, the original spectra, the redshift of the possible background object, a list of lines that correspond with the template used for the detection and finally a quality (if its high, we trust that the object really exists) ; this is the highest class : it contains complicated objects"""
15 - def __init__(self,name , spec, lines = [], secz = 0, quality = 0):
16 self.name = name
17 self.spec = spec
18 self.secz = secz
19 self.lines = lines
20 self.quality = quality
21
22
23 - def write(self, directory_out):
24 """Writes the candidat in the 'directory_out' directory"""
25 f = open(directory_out + self.name, 'w')
26 cPickle.dump(self, f)
27 f.close()
28