Beispiel #1
0
def setup_module():
    file_in = os.path.dirname(__file__) + "/PynPoint_database.hdf5"

    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(file_in, "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()

    filename = os.path.dirname(__file__) + "/PynPoint_config.ini"
    create_config(filename)
Beispiel #2
0
def setup_module():
    create_star_data(path=os.path.dirname(__file__) + "/",
                     npix_x=100,
                     npix_y=100,
                     x0=[50, 50, 50, 50],
                     y0=[50, 50, 50, 50],
                     parang_start=[0., 5., 10., 15.],
                     parang_end=[5., 10., 15., 20.])

    create_config(os.path.dirname(__file__) + "/PynPoint_config.ini")
Beispiel #3
0
def setup_module():
    test_dir = os.path.dirname(__file__) + "/"

    create_star_data(path=test_dir,
                     npix_x=100,
                     npix_y=102,
                     x0=[25, 75, 75, 25],
                     y0=[75, 75, 25, 25],
                     parang_start=[0., 25., 50., 75.],
                     parang_end=[25., 50., 75., 100.])

    filename = os.path.dirname(__file__) + "/PynPoint_config.ini"
    create_config(filename)
Beispiel #4
0
def setup_module():
    create_fake(file_start=os.path.dirname(__file__)+"/image",
                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_config(os.path.dirname(__file__)+"/PynPoint_config.ini")
Beispiel #5
0
def setup_module():
    test_dir = os.path.dirname(__file__) + "/"

    os.makedirs(test_dir + "adi")
    os.makedirs(test_dir + "dark")
    os.makedirs(test_dir + "flat")

    # SCIENCE

    create_fake(file_start=test_dir + 'adi/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]
    parang = [[0., 0.], [0., 0.], [0., 0.], [0., 0.]]

    np.random.seed(2)

    for j, n in enumerate(ndit):
        image = np.random.normal(loc=0, scale=2e-4, size=(n, 100, 100))

        filename = test_dir + 'dark/dark' + str(j + 1).zfill(2) + '.fits'
        create_fits(filename, image, ndit[j], 0, parang[j], 0., 0.)

    # FLAT

    ndit = [3, 3, 5, 5]
    parang = [[0., 0.], [0., 0.], [0., 0.], [0., 0.]]

    np.random.seed(3)

    for j, n in enumerate(ndit):
        image = np.random.normal(loc=1, scale=1e-2, size=(n, 100, 100))

        filename = test_dir + 'flat/flat' + str(j + 1).zfill(2) + '.fits'
        create_fits(filename, image, ndit[j], 0, parang[j], 0., 0.)

    filename = os.path.dirname(__file__) + "/PynPoint_config.ini"
    create_config(filename)
Beispiel #6
0
def setup_module():
    test_dir = os.path.dirname(__file__) + "/"

    create_fake(file_start=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=10.,
                contrast=1e-2)

    filename = os.path.dirname(__file__) + "/PynPoint_config.ini"
    create_config(filename)
Beispiel #7
0
def setup_module():
    file_in = os.path.dirname(__file__) + "/PynPoint_database.hdf5"

    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(file_in, "w")
    h5f.create_dataset("images", data=images)
    h5f.create_dataset("dark", data=dark)
    h5f.create_dataset("flat", data=flat)
    h5f.close()

    filename = os.path.dirname(__file__) + "/PynPoint_config.ini"
    create_config(filename)
Beispiel #8
0
def setup_module():
    test_dir = os.path.dirname(__file__)+"/"

    os.makedirs(test_dir+"dither")
    os.makedirs(test_dir+"star")
    os.makedirs(test_dir+"sky")

    create_fake(file_start=test_dir+"dither/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(file_start=test_dir+"star/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(file_start=test_dir+"sky/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_config(os.path.dirname(__file__)+"/PynPoint_config.ini")
Beispiel #9
0
def setup_module():
    file_in = os.path.dirname(__file__) + "/images.fits"

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

    hdu = fits.PrimaryHDU()
    header = hdu.header
    header['INSTRUME'] = "IMAGER"
    header['HIERARCH ESO DET EXP NO'] = 1
    header['HIERARCH ESO DET NDIT'] = 10
    header['HIERARCH ESO INS PIXSCALE'] = 0.01
    header['HIERARCH ESO ADA POSANG'] = 10.
    header['HIERARCH ESO ADA POSANG END'] = 20.
    header['HIERARCH ESO SEQ CUMOFFSETX'] = 5.
    header['HIERARCH ESO SEQ CUMOFFSETY'] = 5.
    hdu.data = images
    hdu.writeto(file_in)

    filename = os.path.dirname(__file__) + "/PynPoint_config.ini"
    create_config(filename)