Example #1
0
    def test_get_config_attribute(self) -> None:
        create_config(self.test_dir + 'PynPoint_config.ini')
        Pypeline(self.test_dir, self.test_dir, self.test_dir)

        storage = DataStorage(self.test_dir + 'PynPoint_database.hdf5')
        port = ConfigPort('config', None)

        with pytest.warns(UserWarning) as warning:
            attribute = port.get_attribute('CPU')

        assert len(warning) == 1
        assert warning[0].message.args[0] == 'ConfigPort can not load data unless a database is ' \
                                             'connected.'

        assert attribute is None

        port = ConfigPort('config', storage)

        attribute = port.get_attribute('CPU')
        assert attribute == 1

        attribute = port.get_attribute('NFRAMES')
        assert attribute == 'NAXIS3'

        attribute = port.get_attribute('PIXSCALE')
        assert np.allclose(attribute, 0.027, rtol=limit, atol=0.)

        with pytest.warns(UserWarning) as warning:
            attribute = port.get_attribute('test')

        assert len(warning) == 1
        assert warning[0].message.args[
            0] == 'The attribute \'test\' was not found.'

        assert attribute is None
Example #2
0
    def setup_class(self):

        self.test_dir = os.path.dirname(__file__) + '/'

        create_star_data(path=self.test_dir + 'star',
                         npix_x=51,
                         npix_y=51,
                         x0=[10., 10., 10., 10.],
                         y0=[10., 10., 10., 10.])

        create_fake(path=self.test_dir + 'binary',
                    ndit=[20, 20, 20, 20],
                    nframes=[20, 20, 20, 20],
                    exp_no=[1, 2, 3, 4],
                    npix=(101, 101),
                    fwhm=3.,
                    x0=[50, 50, 50, 50],
                    y0=[50, 50, 50, 50],
                    angles=[[0., 25.], [25., 50.], [50., 75.], [75., 100.]],
                    sep=20.,
                    contrast=1.)

        create_config(self.test_dir + 'PynPoint_config.ini')

        self.pipeline = Pypeline(self.test_dir, self.test_dir, self.test_dir)
Example #3
0
    def setup_class(self) -> None:

        self.test_dir = os.path.dirname(__file__) + '/'

        create_fake(path=self.test_dir + 'science',
                    ndit=[20, 20, 20, 20],
                    nframes=[20, 20, 20, 20],
                    exp_no=[1, 2, 3, 4],
                    npix=(100, 100),
                    fwhm=3.,
                    x0=[50, 50, 50, 50],
                    y0=[50, 50, 50, 50],
                    angles=[[0., 25.], [25., 50.], [50., 75.], [75., 100.]],
                    sep=10.,
                    contrast=3e-3)

        create_fake(path=self.test_dir + 'reference',
                    ndit=[10, 10, 10, 10],
                    nframes=[10, 10, 10, 10],
                    exp_no=[1, 2, 3, 4],
                    npix=(100, 100),
                    fwhm=3.,
                    x0=[50, 50, 50, 50],
                    y0=[50, 50, 50, 50],
                    angles=[[0., 25.], [25., 50.], [50., 75.], [75., 100.]],
                    sep=None,
                    contrast=None)

        create_config(self.test_dir + 'PynPoint_config.ini')

        self.pipeline = Pypeline(self.test_dir, self.test_dir, self.test_dir)
Example #4
0
    def setup_class(self) -> None:

        self.limit = 1e-10
        self.test_dir = os.path.dirname(__file__) + '/'

        np.random.seed(1)

        images = np.random.normal(loc=0, scale=2e-4, size=(5, 11, 11))
        dark = np.random.normal(loc=0, scale=2e-4, size=(5, 11, 11))
        flat = np.random.normal(loc=0, scale=2e-4, size=(5, 11, 11))

        images[0, 5, 5] = 1.
        dark[:, 5, 5] = 1.
        flat[:, 8, 8] = -1.
        flat[:, 9, 9] = -1.
        flat[:, 10, 10] = -1.

        with h5py.File(self.test_dir + 'PynPoint_database.hdf5',
                       'w') as hdf_file:
            hdf_file.create_dataset('images', data=images)
            hdf_file.create_dataset('dark', data=dark)
            hdf_file.create_dataset('flat', data=flat)

        create_config(self.test_dir + 'PynPoint_config.ini')

        self.pipeline = Pypeline(self.test_dir, self.test_dir, self.test_dir)
Example #5
0
    def setup_class(self):

        self.test_dir = os.path.dirname(__file__) + '/'

        create_star_data(path=self.test_dir+'data1',
                         npix_x=100,
                         npix_y=100,
                         x0=[50, 50, 50, 50],
                         y0=[50, 50, 50, 50],
                         parang_start=[0., 25., 50., 75.],
                         parang_end=[25., 50., 75., 100.],
                         exp_no=[1, 2, 3, 4])

        create_star_data(path=self.test_dir+'data2',
                         npix_x=100,
                         npix_y=100,
                         x0=[50, 50, 50, 50],
                         y0=[50, 50, 50, 50],
                         parang_start=[0., 25., 50., 75.],
                         parang_end=[25., 50., 75., 100.],
                         exp_no=[1, 2, 3, 4])

        create_star_data(path=self.test_dir+'data3',
                         npix_x=100,
                         npix_y=100,
                         x0=[50, 50, 50, 50],
                         y0=[50, 50, 50, 50],
                         parang_start=[0., 25., 50., 75.],
                         parang_end=[25., 50., 75., 100.],
                         exp_no=[1, 2, 3, 4])

        create_config(self.test_dir+'PynPoint_config.ini')

        self.pipeline = Pypeline(self.test_dir, self.test_dir, self.test_dir)
Example #6
0
    def setup_class(self):

        self.test_dir = os.path.dirname(__file__) + '/'

        np.random.seed(1)
        images = np.random.normal(loc=0, scale=2e-4, size=(40, 100, 100))
        dark = np.random.normal(loc=0, scale=2e-4, size=(40, 100, 100))
        flat = np.random.normal(loc=0, scale=2e-4, size=(40, 100, 100))

        images[0, 10, 10] = 1.
        images[0, 12, 12] = 1.
        images[0, 14, 14] = 1.
        images[0, 20, 20] = 1.
        images[0, 22, 22] = 1.
        images[0, 24, 24] = 1.
        dark[:, 10, 10] = 1.
        dark[:, 12, 12] = 1.
        dark[:, 14, 14] = 1.
        flat[:, 20, 20] = -1.
        flat[:, 22, 22] = -1.
        flat[:, 24, 24] = -1.

        with h5py.File(self.test_dir + 'PynPoint_database.hdf5',
                       'w') as hdf_file:
            hdf_file.create_dataset('images', data=images)
            hdf_file.create_dataset('dark', data=dark)
            hdf_file.create_dataset('flat', data=flat)
            hdf_file.create_dataset('header_images/STAR_POSITION',
                                    data=np.full((40, 2), 50.))

        create_config(self.test_dir + 'PynPoint_config.ini')

        self.pipeline = Pypeline(self.test_dir, self.test_dir, self.test_dir)
Example #7
0
    def setup_class(self) -> None:

        self.limit = 1e-10
        self.test_dir = os.path.dirname(__file__) + '/'

        create_random(self.test_dir)
        create_config(self.test_dir+'PynPoint_config.ini')
Example #8
0
    def setup_class(self):

        self.test_dir = os.path.dirname(__file__) + '/'

        create_star_data(path=self.test_dir + 'flux', npix_x=101, npix_y=101)

        create_star_data(path=self.test_dir + 'psf',
                         npix_x=15,
                         npix_y=15,
                         x0=[7., 7., 7., 7.],
                         y0=[7., 7., 7., 7.],
                         ndit=1,
                         nframes=1,
                         noise=False)

        create_fake(path=self.test_dir + 'adi',
                    ndit=[5, 5, 5, 5],
                    nframes=[5, 5, 5, 5],
                    exp_no=[1, 2, 3, 4],
                    npix=(15, 15),
                    fwhm=3.,
                    x0=[7., 7., 7., 7.],
                    y0=[7., 7., 7., 7.],
                    angles=[[0., 50.], [50., 100.], [100., 150.], [150.,
                                                                   200.]],
                    sep=5.5,
                    contrast=1.)

        create_config(self.test_dir + 'PynPoint_config.ini')

        self.pipeline = Pypeline(self.test_dir, self.test_dir, self.test_dir)
Example #9
0
    def test_get_config_attribute(self):
        create_config(self.test_dir + "PynPoint_config.ini")
        Pypeline(self.test_dir, self.test_dir, self.test_dir)

        storage = DataStorage(self.test_dir + "PynPoint_database.hdf5")
        port = ConfigPort("config", None)

        with pytest.warns(UserWarning) as warning:
            attribute = port.get_attribute("CPU")

        assert len(warning) == 1
        assert warning[0].message.args[0] == "ConfigPort can not load data unless a database is " \
                                             "connected."

        assert attribute is None

        port = ConfigPort("config", storage)

        attribute = port.get_attribute("CPU")
        assert attribute == 1

        attribute = port.get_attribute("NFRAMES")
        assert attribute == "NAXIS3"

        attribute = port.get_attribute("PIXSCALE")
        assert np.allclose(attribute, 0.027, rtol=limit, atol=0.)

        with pytest.warns(UserWarning) as warning:
            attribute = port.get_attribute("test")

        assert len(warning) == 1
        assert warning[0].message.args[
            0] == "No attribute found - requested: test."

        assert attribute is None
Example #10
0
    def setup_class(self) -> None:

        self.test_dir = os.path.dirname(__file__) + '/'
        self.fitsfile = self.test_dir + 'near/images_1.fits'

        create_near_data(path=self.test_dir + 'near')
        create_config(self.test_dir + 'PynPoint_config.ini')

        self.pipeline = Pypeline(self.test_dir, self.test_dir, self.test_dir)

        self.pipeline.set_attribute('config',
                                    'NFRAMES',
                                    'ESO DET CHOP NCYCLES',
                                    static=True)
        self.pipeline.set_attribute('config',
                                    'EXP_NO',
                                    'ESO TPL EXPNO',
                                    static=True)
        self.pipeline.set_attribute('config', 'NDIT', 'None', static=True)
        self.pipeline.set_attribute('config',
                                    'PARANG_START',
                                    'None',
                                    static=True)
        self.pipeline.set_attribute('config',
                                    'PARANG_END',
                                    'None',
                                    static=True)
        self.pipeline.set_attribute('config', 'DITHER_X', 'None', static=True)
        self.pipeline.set_attribute('config', 'DITHER_Y', 'None', static=True)
        self.pipeline.set_attribute('config', 'PIXSCALE', 0.045, static=True)
        self.pipeline.set_attribute('config', 'MEMORY', 100, static=True)

        self.positions = ('chopa', 'chopb')
Example #11
0
    def setup_class(self):

        self.test_dir = os.path.dirname(__file__) + "/"

        np.random.seed(1)
        images = np.random.normal(loc=0, scale=2e-4, size=(40, 100, 100))
        dark = np.random.normal(loc=0, scale=2e-4, size=(40, 100, 100))
        flat = np.random.normal(loc=0, scale=2e-4, size=(40, 100, 100))

        images[0, 10, 10] = 1.
        images[0, 12, 12] = 1.
        images[0, 14, 14] = 1.
        images[0, 20, 20] = 1.
        images[0, 22, 22] = 1.
        images[0, 24, 24] = 1.
        dark[:, 10, 10] = 1.
        dark[:, 12, 12] = 1.
        dark[:, 14, 14] = 1.
        flat[:, 20, 20] = -1.
        flat[:, 22, 22] = -1.
        flat[:, 24, 24] = -1.

        h5f = h5py.File(self.test_dir + "PynPoint_database.hdf5", "w")
        h5f.create_dataset("images", data=images)
        h5f.create_dataset("dark", data=dark)
        h5f.create_dataset("flat", data=flat)
        h5f.create_dataset("header_images/STAR_POSITION",
                           data=np.full((40, 2), 50.))
        h5f.close()

        create_config(self.test_dir + "PynPoint_config.ini")

        self.pipeline = Pypeline(self.test_dir, self.test_dir, self.test_dir)
Example #12
0
    def setup_class(self):

        self.test_dir = os.path.dirname(__file__) + '/'

        create_star_data(path=self.test_dir + 'images', ndit=10, nframes=11)
        create_config(self.test_dir + 'PynPoint_config.ini')

        self.pipeline = Pypeline(self.test_dir, self.test_dir, self.test_dir)
Example #13
0
    def setup_class(self) -> None:

        self.test_dir = os.path.dirname(__file__) + '/'

        create_random(self.test_dir + 'data')
        create_config(self.test_dir + 'PynPoint_config.ini')

        self.pipeline = Pypeline(self.test_dir, self.test_dir, self.test_dir)
Example #14
0
    def setup_class(self):

        self.test_dir = os.path.dirname(__file__) + "/"

        create_random(self.test_dir)
        create_config(self.test_dir+"PynPoint_config.ini")

        self.pipeline = Pypeline(self.test_dir, self.test_dir, self.test_dir)
Example #15
0
    def setup_class(self):

        self.test_dir = os.path.dirname(__file__) + "/"

        create_star_data(path=self.test_dir + "limits")
        create_config(self.test_dir + "PynPoint_config.ini")

        self.pipeline = Pypeline(self.test_dir, self.test_dir, self.test_dir)
Example #16
0
    def setup_class(self):

        self.test_dir = os.path.dirname(__file__) + '/'

        create_star_data(path=self.test_dir + 'fits')
        create_config(self.test_dir + 'PynPoint_config.ini')

        self.pipeline = Pypeline(self.test_dir, self.test_dir, self.test_dir)
Example #17
0
    def setup_class(self) -> None:

        self.limit = 1e-5
        self.test_dir = os.path.dirname(__file__) + '/'

        create_ifs_data(self.test_dir+'science')
        create_config(self.test_dir+'PynPoint_config.ini')

        self.pipeline = Pypeline(self.test_dir, self.test_dir, self.test_dir)
    def setup_class(self) -> None:

        self.limit = 1e-10
        self.test_dir = os.path.dirname(__file__) + '/'

        create_star_data(self.test_dir + 'images')
        create_config(self.test_dir + 'PynPoint_config.ini')

        self.pipeline = Pypeline(self.test_dir, self.test_dir, self.test_dir)
Example #19
0
    def setup_class(self):

        self.test_dir = os.path.dirname(__file__) + '/'

        create_fake(path=self.test_dir + 'dither',
                    ndit=[20, 20, 20, 20],
                    nframes=[20, 20, 20, 20],
                    exp_no=[1, 2, 3, 4],
                    npix=(100, 100),
                    fwhm=3.,
                    x0=[25, 75, 75, 25],
                    y0=[75, 75, 25, 25],
                    angles=[[0., 25.], [25., 50.], [50., 75.], [75., 100.]],
                    sep=None,
                    contrast=None)

        create_fake(path=self.test_dir + 'star',
                    ndit=[10, 10, 10, 10],
                    nframes=[10, 10, 10, 10],
                    exp_no=[1, 3, 5, 7],
                    npix=(100, 100),
                    fwhm=3.,
                    x0=[50, 50, 50, 50],
                    y0=[50, 50, 50, 50],
                    angles=[[0., 25.], [25., 50.], [50., 75.], [75., 100.]],
                    sep=None,
                    contrast=None)

        create_fake(path=self.test_dir + 'sky',
                    ndit=[5, 5, 5, 5],
                    nframes=[5, 5, 5, 5],
                    exp_no=[2, 4, 6, 8],
                    npix=(100, 100),
                    fwhm=None,
                    x0=[50, 50, 50, 50],
                    y0=[50, 50, 50, 50],
                    angles=[[0., 25.], [25., 50.], [50., 75.], [75., 100.]],
                    sep=None,
                    contrast=None)

        create_fake(path=self.test_dir + 'line',
                    ndit=[4, 4, 4, 4],
                    nframes=[4, 4, 4, 4],
                    exp_no=[1, 3, 5, 7],
                    npix=(20, 20),
                    fwhm=3.,
                    x0=[10, 10, 10, 10],
                    y0=[10, 10, 10, 10],
                    angles=[[0., 25.], [25., 50.], [50., 75.], [75., 100.]],
                    sep=None,
                    contrast=None)

        create_config(self.test_dir + 'PynPoint_config.ini')

        self.pipeline = Pypeline(self.test_dir, self.test_dir, self.test_dir)
Example #20
0
    def setup_class(self) -> None:

        self.limit = 1e-10
        self.test_dir = os.path.dirname(__file__) + '/'

        create_fake_data(self.test_dir + 'adi')
        create_star_data(self.test_dir + 'psf', npix=21, pos_star=10.)
        create_star_data(self.test_dir + 'ref', npix=21, pos_star=10.)
        create_config(self.test_dir + 'PynPoint_config.ini')

        self.pipeline = Pypeline(self.test_dir, self.test_dir, self.test_dir)
Example #21
0
    def setup_class(self):

        self.test_dir = os.path.dirname(__file__) + '/'

        create_random(self.test_dir, ndit=10, parang=None)
        create_config(self.test_dir+'PynPoint_config.ini')

        np.savetxt(self.test_dir+'parang.dat', np.arange(1., 11., 1.))
        np.savetxt(self.test_dir+'new.dat', np.arange(10., 21., 1.))
        np.savetxt(self.test_dir+'attribute.dat', np.arange(1, 11, 1), fmt='%i')

        data2d = np.random.normal(loc=0, scale=2e-4, size=(10, 10))
        np.savetxt(self.test_dir+'data_2d.dat', data2d)

        self.pipeline = Pypeline(self.test_dir, self.test_dir, self.test_dir)
Example #22
0
    def setup_class(self):

        self.test_dir = os.path.dirname(__file__) + "/"

        create_star_data(path=self.test_dir + "images",
                         npix_x=20,
                         npix_y=20,
                         x0=[10, 10, 10, 10],
                         y0=[10, 10, 10, 10],
                         parang_start=[0., 25., 50., 75.],
                         parang_end=[25., 50., 75., 100.],
                         exp_no=[1, 2, 3, 4])

        create_config(self.test_dir + "PynPoint_config.ini")

        self.pipeline = Pypeline(self.test_dir, self.test_dir, self.test_dir)
Example #23
0
    def setup_class(self):

        self.test_dir = os.path.dirname(__file__) + "/"

        create_star_data(path=self.test_dir+"dither",
                         npix_x=100,
                         npix_y=100,
                         x0=[25, 75, 75, 25],
                         y0=[75, 75, 25, 25],
                         parang_start=[0., 25., 50., 75.],
                         parang_end=[25., 50., 75., 100.],
                         exp_no=[1, 2, 3, 4])

        create_star_data(path=self.test_dir+"star_odd",
                         npix_x=101,
                         npix_y=101,
                         x0=[50],
                         y0=[50],
                         parang_start=[0.],
                         parang_end=[25.],
                         exp_no=[1],
                         noise=False)

        create_star_data(path=self.test_dir+"star_even",
                         npix_x=100,
                         npix_y=100,
                         x0=[49.5],
                         y0=[49.5],
                         parang_start=[0.],
                         parang_end=[25.],
                         exp_no=[1],
                         noise=False)

        create_waffle_data(path=self.test_dir+"waffle_odd",
                           npix=101,
                           x_waffle=[20., 20., 80., 80.],
                           y_waffle=[20., 80., 80., 20.])

        create_waffle_data(path=self.test_dir+"waffle_even",
                           npix=100,
                           x_waffle=[20., 20., 79., 79.],
                           y_waffle=[20., 79., 79., 20.])

        create_config(self.test_dir+"PynPoint_config.ini")

        self.pipeline = Pypeline(self.test_dir, self.test_dir, self.test_dir)
Example #24
0
    def setup_class(self) -> None:

        self.test_dir = os.path.dirname(__file__) + '/'

        create_star_data(path=self.test_dir+'dither',
                         npix_x=100,
                         npix_y=100,
                         x0=[25, 75, 75, 25],
                         y0=[75, 75, 25, 25],
                         parang_start=[0., 25., 50., 75.],
                         parang_end=[25., 50., 75., 100.],
                         exp_no=[1, 2, 3, 4])

        create_star_data(path=self.test_dir+'star_odd',
                         npix_x=101,
                         npix_y=101,
                         x0=[50],
                         y0=[50],
                         parang_start=[0.],
                         parang_end=[25.],
                         exp_no=[1],
                         noise=False)

        create_star_data(path=self.test_dir+'star_even',
                         npix_x=100,
                         npix_y=100,
                         x0=[49.5],
                         y0=[49.5],
                         parang_start=[0.],
                         parang_end=[25.],
                         exp_no=[1],
                         noise=False)

        create_waffle_data(path=self.test_dir+'waffle_odd',
                           npix=101,
                           x_spot=[20., 20., 80., 80.],
                           y_spot=[20., 80., 80., 20.])

        create_waffle_data(path=self.test_dir+'waffle_even',
                           npix=100,
                           x_spot=[20., 20., 79., 79.],
                           y_spot=[20., 79., 79., 20.])

        create_config(self.test_dir+'PynPoint_config.ini')

        self.pipeline = Pypeline(self.test_dir, self.test_dir, self.test_dir)
Example #25
0
    def setup_class(self):

        self.test_dir = os.path.dirname(__file__) + "/"

        # science

        create_fake(path=self.test_dir + 'adi',
                    ndit=[22, 17, 21, 18],
                    nframes=[23, 18, 22, 19],
                    exp_no=[1, 2, 3, 4],
                    npix=(100, 102),
                    fwhm=3.,
                    x0=[25, 75, 75, 25],
                    y0=[75, 75, 25, 25],
                    angles=[[0., 25.], [25., 50.], [50., 75.], [75., 100.]],
                    sep=7.,
                    contrast=1e-2)

        # dark

        ndit = [3, 3, 5, 5]

        np.random.seed(2)

        for j, item in enumerate(ndit):
            image = np.random.normal(loc=0, scale=2e-4, size=(item, 100, 100))
            create_fits(self.test_dir + 'dark',
                        'dark' + str(j + 1).zfill(2) + '.fits', image, ndit[j])

        # flat

        ndit = [3, 3, 5, 5]

        np.random.seed(3)

        for j, item in enumerate(ndit):
            image = np.random.normal(loc=1, scale=1e-2, size=(item, 100, 100))
            create_fits(self.test_dir + 'flat',
                        'flat' + str(j + 1).zfill(2) + '.fits', image, ndit[j])

        create_config(self.test_dir + "PynPoint_config.ini")

        self.pipeline = Pypeline(self.test_dir, self.test_dir, self.test_dir)
Example #26
0
    def setup_class(self):

        self.test_dir = os.path.dirname(__file__) + "/"

        np.random.seed(1)

        images = np.random.normal(loc=0, scale=2e-4, size=(10, 100, 100))
        dark = np.random.normal(loc=0, scale=2e-4, size=(10, 100, 100))
        flat = np.random.normal(loc=0, scale=2e-4, size=(10, 100, 100))

        h5f = h5py.File(self.test_dir + "PynPoint_database.hdf5", "w")
        h5f.create_dataset("images", data=images)
        h5f.create_dataset("dark", data=dark)
        h5f.create_dataset("flat", data=flat)
        h5f.close()

        create_config(self.test_dir + "PynPoint_config.ini")

        self.pipeline = Pypeline(self.test_dir, self.test_dir, self.test_dir)
    def setup_class(self) -> None:

        self.limit = 1e-10
        self.test_dir = os.path.dirname(__file__) + '/'

        create_random(self.test_dir, nimages=10)
        create_config(self.test_dir + 'PynPoint_config.ini')

        np.savetxt(self.test_dir + 'parang.dat', np.arange(10., 20., 1.))
        np.savetxt(self.test_dir + 'new.dat', np.arange(20., 30., 1.))
        np.savetxt(self.test_dir + 'attribute.dat',
                   np.arange(0, 10, 1),
                   fmt='%i')
        np.savetxt(self.test_dir + 'wavelength.dat', np.arange(0., 10., 1.))

        data2d = np.random.normal(loc=0, scale=2e-4, size=(10, 10))
        np.savetxt(self.test_dir + 'data_2d.dat', data2d)

        self.pipeline = Pypeline(self.test_dir, self.test_dir, self.test_dir)
Example #28
0
    def setup_class(self):
        self.test_dir = os.path.dirname(__file__) + "/"

        np.random.seed(1)

        image_3d = np.random.normal(loc=0, scale=2e-4, size=(4, 10, 10))
        image_2d = np.random.normal(loc=0, scale=2e-4, size=(10, 10))
        science = np.random.normal(loc=0, scale=2e-4, size=(4, 10, 10))
        dark = np.random.normal(loc=0, scale=2e-4, size=(4, 10, 10))

        h5f = h5py.File(self.test_dir + "PynPoint_database.hdf5", "w")
        h5f.create_dataset("image_3d", data=image_3d)
        h5f.create_dataset("image_2d", data=image_2d)
        h5f.create_dataset("science", data=science)
        h5f.create_dataset("dark", data=dark)
        h5f.close()

        create_star_data(path=self.test_dir + "images")
        create_config(self.test_dir + "PynPoint_config.ini")

        self.pipeline = Pypeline(self.test_dir, self.test_dir, self.test_dir)
Example #29
0
    def setup_class(self):

        self.test_dir = os.path.dirname(__file__) + '/'

        np.random.seed(1)

        images = np.random.normal(loc=0, scale=2e-4, size=(10, 100, 100))
        dark = np.random.normal(loc=0, scale=2e-4, size=(10, 100, 100))
        flat = np.random.normal(loc=0, scale=2e-4, size=(10, 100, 100))
        crop = np.random.normal(loc=0, scale=2e-4, size=(10, 60, 60))

        with h5py.File(self.test_dir + 'PynPoint_database.hdf5',
                       'w') as hdf_file:
            hdf_file.create_dataset('images', data=images)
            hdf_file.create_dataset('dark', data=dark)
            hdf_file.create_dataset('flat', data=flat)
            hdf_file.create_dataset('crop', data=crop)

        create_config(self.test_dir + 'PynPoint_config.ini')

        self.pipeline = Pypeline(self.test_dir, self.test_dir, self.test_dir)
Example #30
0
    def setup_class(self):
        self.test_dir = os.path.dirname(__file__) + '/'

        np.random.seed(1)

        image_3d = np.random.normal(loc=0, scale=2e-4, size=(4, 10, 10))
        image_2d = np.random.normal(loc=0, scale=2e-4, size=(1, 10, 10))
        science = np.random.normal(loc=0, scale=2e-4, size=(4, 10, 10))
        dark = np.random.normal(loc=0, scale=2e-4, size=(4, 10, 10))

        with h5py.File(self.test_dir + 'PynPoint_database.hdf5',
                       'w') as hdf_file:
            hdf_file.create_dataset('image_3d', data=image_3d)
            hdf_file.create_dataset('image_2d', data=image_2d)
            hdf_file.create_dataset('science', data=science)
            hdf_file.create_dataset('dark', data=dark)

        create_star_data(path=self.test_dir + 'images')
        create_config(self.test_dir + 'PynPoint_config.ini')

        self.pipeline = Pypeline(self.test_dir, self.test_dir, self.test_dir)