Example #1
0
    def setUp(self):
        self.ascii = self.make_path('threads/ascii_table/sim.poisson.1.dat')
        self.single = self.make_path('single.dat')
        self.double = self.make_path('double.dat')
        self.filter = self.make_path('filter_single_integer.dat')
        self.func = lambda x: x

        ui.dataspace1d(1,1000,dstype=ui.Data1D)
Example #2
0
    def setUp(self):
        self.ascii = self.datadir + "/threads/ascii_table/sim.poisson.1.dat"
        self.single = self.datadir + "/single.dat"
        self.double = self.datadir + "/double.dat"
        self.filter = self.datadir + "/filter_single_integer.dat"
        self.func = lambda x: x

        ui.dataspace1d(1, 1000, dstype=ui.Data1D)
Example #3
0
    def setUp(self):
        self.ascii = self.make_path('threads/ascii_table/sim.poisson.1.dat')
        self.single = self.make_path('single.dat')
        self.double = self.make_path('double.dat')
        self.filter = self.make_path('filter_single_integer.dat')
        self.func = lambda x: x

        ui.dataspace1d(1, 1000, dstype=ui.Data1D)
Example #4
0
    def setUp(self):
        self.ascii = self.datadir + '/threads/ascii_table/sim.poisson.1.dat'
        self.single = self.datadir + '/single.dat'
        self.double = self.datadir + '/double.dat'
        self.filter = self.datadir + '/filter_single_integer.dat'
        self.func = lambda x: x

        ui.dataspace1d(1,1000,dstype=ui.Data1D)
Example #5
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]
Example #6
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"]
Example #7
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
Example #8
0
    def setUp(self):
        self._old_logger_level = logger.getEffectiveLevel()
        logger.setLevel(logging.ERROR)

        self.ascii = self.make_path('sim.poisson.1.dat')
        self.single = self.make_path('single.dat')
        self.double = self.make_path('double.dat')
        self.filter = self.make_path('filter_single_integer.dat')
        self.func = lambda x: x

        ui.dataspace1d(1,1000,dstype=ui.Data1D)
Example #9
0
def setup_ui(make_data_path):

    ui.dataspace1d(1, 1000, dstype=ui.Data1D)

    out = namedtuple('setup_ui_data', ['ascii', 'single', 'double', 'filter'])

    out.ascii = make_data_path('sim.poisson.1.dat')
    out.single = make_data_path('single.dat')
    out.double = make_data_path('double.dat')
    out.filter = make_data_path('filter_single_integer.dat')
    return out
Example #10
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
Example #11
0
    def setUp(self):
        ui.clean()
        self._old_logger_level = logger.getEffectiveLevel()
        logger.setLevel(logging.ERROR)

        self.ascii = self.make_path('sim.poisson.1.dat')
        self.single = self.make_path('single.dat')
        self.double = self.make_path('double.dat')
        self.filter = self.make_path('filter_single_integer.dat')
        self.func = lambda x: x

        ui.dataspace1d(1, 1000, dstype=ui.Data1D)
Example #12
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
Example #13
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, )
Example #14
0
def setup_ui():
    """A version of setup_ui_full where we don't need the data."""

    ui.dataspace1d(1, 1000, dstype=ui.Data1D)