Esempio n. 1
0
def test_list_psf_ids_single(id, clean_ui):
    ui.dataspace1d(1, 10, id=id)
    ui.load_psf('psf1d', 'gauss1d.mdl')
    ui.set_psf(id, 'psf1d')

    if id is None:
        id = 1

    assert ui.list_psf_ids() == [id]
Esempio n. 2
0
def test_list_psf_ids_multi(clean_ui):

    ui.dataspace1d(1, 10)
    ui.dataspace1d(1, 10, id="2")
    ui.load_psf('psf1d', 'gauss1d.mdl')
    ui.set_psf('psf1d')
    ui.set_psf("2", 'psf1d')

    ans = ui.list_psf_ids()
    assert ans == [1, "2"]
Esempio n. 3
0
 def test_psf_model2d(self):
     ui.dataspace1d(1, 10)
     for model in self.models1d:
         try:
             ui.load_psf("psf1d", model + ".mdl")
             ui.set_psf("psf1d")
             mdl = ui.get_model_component("mdl")
             self.assert_((numpy.array(mdl.get_center()) == numpy.array([4])).all())
         except:
             print model
             raise
Esempio n. 4
0
 def test_psf_model2d(self):
     ui.dataspace2d([216, 261])
     for model in self.models2d:
         try:
             ui.load_psf("psf2d", model + ".mdl")
             ui.set_psf("psf2d")
             mdl = ui.get_model_component("mdl")
             self.assert_((numpy.array(mdl.get_center()) == numpy.array([108, 130])).all())
         except:
             print model
             raise
Esempio n. 5
0
 def test_psf_model1d(self):
     ui.dataspace1d(1, 10)
     for model in self.models1d:
         try:
             ui.load_psf('psf1d', model + '.mdl')
             ui.set_psf('psf1d')
             mdl = ui.get_model_component('mdl')
             self.assertTrue(
                 (numpy.array(mdl.get_center()) == numpy.array([4])).all())
         except:
             print(model)
             raise
Esempio n. 6
0
 def test_psf_model2d(self):
     ui.dataspace2d([216,261])
     for model in self.models2d:
         try:
             ui.load_psf('psf2d', model+'.mdl')
             ui.set_psf('psf2d')
             mdl = ui.get_model_component('mdl')
             self.assertTrue((numpy.array(mdl.get_center()) ==
                              numpy.array([108,130])).all())
         except:
             print model
             raise
Esempio n. 7
0
 def test_psf_model1d(self):
     ui.dataspace1d(1, 10)
     for model in self.models1d:
         try:
             ui.load_psf('psf1d', model+'.mdl')
             ui.set_psf('psf1d')
             mdl = ui.get_model_component('mdl')
             self.assertTrue((numpy.array(mdl.get_center()) ==
                              numpy.array([4])).all())
         except:
             print model
             raise
Esempio n. 8
0
 def test_psf_model2d(self):
     ui.dataspace2d([216, 261])
     for model in self.models2d:
         try:
             ui.load_psf('psf2d', model + '.mdl')
             ui.set_psf('psf2d')
             mdl = ui.get_model_component('mdl')
             self.assertTrue((numpy.array(mdl.get_center()) ==
                              numpy.array([108, 130])).all())
         except:
             print(model)
             raise
Esempio n. 9
0
def test_psf_model2d(model):
    ui.dataspace2d([216, 261])
    ui.load_psf('psf2d', model + '.mdl')
    ui.set_psf('psf2d')
    mdl = ui.get_model_component('mdl')
    assert mdl.get_center() == (108.0, 130.0)
Esempio n. 10
0
def test_psf_model1d(model, clean_ui):
    ui.dataspace1d(1, 10)
    ui.load_psf('psf1d', model + '.mdl')
    ui.set_psf('psf1d')
    mdl = ui.get_model_component('mdl')
    assert mdl.get_center() == (4.0, )
Esempio n. 11
0
x1 = np.arange(-5.0, 30, 0.5)

x2 = np.arange(1.0, 29.0, 0.2)

ui.load_arrays(1, x1, x1 * 0, ui.Data1D)
ui.load_arrays(2, x2, x2 * 0, ui.Data1D)

ui.set_source(1, ui.box1d.box)
box = ui.get_model_component('box')
ui.set_source(2, box)

box.xlow = 10.0
box.xhi = 20.0

# Copy all the objects just to make sure
g1 = ui.gauss1d('g1')
g1.fwhm = 3.0

g2 = ui.gauss1d('g2')
g2.fwhm = 3.0

ui.load_psf('psf1', g1)
ui.load_psf('psf2', g2)

ui.set_psf(1, 'psf1')
ui.set_psf(2, 'psf2')

ui.plot_model(1)
ui.plot_model(2, overplot=True)