예제 #1
0
def test_hdu(env):
    rules, exposures = env
    hdus = [fits.open(exposure)[0] for exposure in exposures]
    pool = mkpool(hdus)
    assert isinstance(pool, AssociationPool)
    assert REQUIRED_PARAMS.issubset(pool.colnames)
    assert len(pool) == len(exposures)
예제 #2
0
def test_mkpool(exposures):
    pool = mkpool(exposures)
    assert isinstance(pool, AssociationPool)
    assert REQUIRED_PARAMS.issubset(pool.colnames)
    assert len(pool) == len(exposures)
    filenames = [filename for filename in pool['filename']]
    assert set(exposures) == set(filenames)
예제 #3
0
def mkpool_cmdline(exposures):
    """Create a pool with optional arguments from the commandline"""
    args = ['pool.csv']
    for column, value in OPT_COLS:
        args.append(f'--{column.replace("_", "-")}')
        args.append(f'{value}')
    for exposure in exposures:
        args.append(exposure)

    mkpool_args = from_cmdline(args)
    pool = mkpool(**mkpool_args)
    return pool
예제 #4
0
def mkpool_with_args(exposures):
    """Create a pool with all optional arguments specified"""
    kargs = {column: value for column, value in OPT_COLS}
    pool = mkpool(exposures, **kargs)

    return pool
예제 #5
0
def test_hdulist(exposures):
    hduls = [fits.open(exposure) for exposure in exposures]
    pool = mkpool(hduls)
    assert isinstance(pool, AssociationPool)
    assert REQUIRED_PARAMS.issubset(pool.colnames)
    assert len(pool) == len(exposures)