Esempio n. 1
0
def test_chk_calibs_deimos():
    os.chdir(data_path(''))
    # 830G
    droot = os.path.join(os.environ['PYPEIT_DEV'],
                         'RAW_DATA/keck_deimos/830G_M_8600/')
    pargs = chk_for_calibs.parse_args([droot, '-s', 'keck_deimos'])
    answers, _ = chk_for_calibs.main(pargs)
    assert np.all(answers['pass'][:-1]), 'One or more failures!'

    # 600ZD
    droot = os.path.join(os.environ['PYPEIT_DEV'],
                         'RAW_DATA/keck_deimos/600ZD_M_7500/')
    pargs = chk_for_calibs.parse_args([droot, '-s', 'keck_deimos'])
    answers, _ = chk_for_calibs.main(pargs)
    assert np.all(answers['pass'][:-1]), 'One or more failures!'
Esempio n. 2
0
def test_chk_calibs_not():
    os.chdir(data_path(''))
    droot = os.path.join(os.environ['PYPEIT_DEV'],
                         'RAW_DATA/not_alfosc/grism4')
    droot += '/ALD'

    pargs = chk_for_calibs.parse_args([droot, '-s', 'not_alfosc'])
    answers, _ = chk_for_calibs.main(pargs)

    assert answers['pass'][0], 'One or more failures!'
Esempio n. 3
0
def test_setup_vlt_fors2():
    droot = os.path.join(os.environ['PYPEIT_DEV'], 'RAW_DATA/vlt_fors2/300I/')
    droot += '/FORS2'
    pargs = setup.parse_args(['-r', droot, '-s', 'vlt_fors2'])
    setup.main(pargs)

    cwd = os.getcwd()
    setup_dir = os.path.join(cwd, 'setup_files')
    assert os.path.isdir(setup_dir), 'No setup_files directory created'

    files = glob.glob(os.path.join(setup_dir, 'vlt_fors2*'))
    ext = [f.split('.')[-1] for f in files]
    expected = expected_file_extensions()
    assert np.all([e in ext for e in expected]), \
        'Did not find all setup file extensions: {0}'.format(expected)

    # Clean-up
    shutil.rmtree(setup_dir)

    # Now chk calib
    pargs = chk_for_calibs.parse_args([droot, '-s', 'vlt_fors2'])
    answers, ps = chk_for_calibs.main(pargs)
    assert answers['pass'][0], 'A must pass!'