Esempio n. 1
0
 def recipe():
     return scopesim_grid(N1d=16,
                          border=50,
                          perturbation=2,
                          magnitude=lambda N: rng.uniform(18, 24, N),
                          custom_subpixel_psf=anisocado_psf,
                          seed=seed)
 def inner():
     # These imports are necessary to be able to execute in a forkserver context; it does not copy the full memory space, so
     # we'd have to rely on the target to know the imports
     from thesis_lib.testdata.recipes import scopesim_grid
     from thesis_lib.testdata.helpers import lowpass
     import numpy as np
     return scopesim_grid(seed=seed,
                          N1d=25,
                          perturbation=2.,
                          psf_transform=lowpass(),
                          magnitude=lambda N: np.random.uniform(18, 24, N))
Esempio n. 3
0
def test_grid_mean_devation(printer, generator_args):
    with work_in(Config.instance().scopesim_working_dir):
        img, table = scopesim_grid(**generator_args)

    xref, yref = table[INPUT_TABLE_NAMES[X]], table[INPUT_TABLE_NAMES[Y]]
    x, y = centroid_sources(img, xref, yref, box_size=7, centroid_func=centroid_quadratic)
    xdev_mean = np.mean(x-xref)
    ydev_mean = np.mean(y-yref)
    printer(f'{xdev_mean=} {ydev_mean=}')
    assert xdev_mean < 0.002
    assert ydev_mean < 0.002
Esempio n. 4
0
 def inner():
     # These imports are necessary to be able to execute in a forkserver context; it does not copy the full memory space, so
     # we'd have to rely on the target to know the imports
     from thesis_lib.testdata.recipes import scopesim_grid
     import numpy as np
     from thesis_lib.scopesim_helper import make_anisocado_model
     psf = make_anisocado_model(lowpass=5)
     return scopesim_grid(seed=seed,
                          N1d=10,
                          perturbation=2.,
                          custom_subpixel_psf=psf,
                          magnitude=lambda N: np.random.uniform(18, 24, N))
Esempio n. 5
0
def test_grid(printer, generator_args):
    with work_in(Config.instance().scopesim_working_dir):
        img, table = scopesim_grid(**generator_args)

    xref, yref = table[INPUT_TABLE_NAMES[X]], table[INPUT_TABLE_NAMES[Y]]
    x, y = centroid_sources(img, xref, yref, box_size=7, centroid_func=centroid_quadratic)

    xdev = np.abs(x-xref)
    ydev = np.abs(y-yref)
    printer(f'{xdev=}\n{ydev=}')

    #TODO this is pretty shit accuracy sometimes...
    assert np.all(np.abs(xdev) < 0.15)
    assert np.all(np.abs(ydev) < 0.15)