'Unit tests for parameters
Read an iraf database file created by onedspec.identify.  Use the
information to create a 1D Chebyshev model and perform the same fit.
Create also a gausian model.'

def setup_class(self):

    test_file = get_pkg_data_filename(u'data/idcompspec.fits')
    f = open(test_file)
    lines = f.read()
    reclist = lines.split(u'begin')
    f.close()
    record = irafutil.IdentifyRecord(reclist[1])
    self.icoeff = record.coeff
    order = int(record.fields[u'order'])
    self.model = models.Chebyshev1D((order - 1))
    self.gmodel = models.Gaussian1D(2, mean=3, stddev=4)
    self.linear_fitter = fitting.LinearLSQFitter()
    self.x = record.x
    self.y = record.z
    self.yy = np.array([record.z, record.z])
