import sys import testutil from nose import with_setup from gacq import main from userinterface import add_cursor_position, clear_cursor_positions @with_setup(testutil.setup_io("2"), clear_cursor_positions) def test_gmos_north_ifu_2_imaging(): add_cursor_position(516.0, 1154.0, "a") add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("N20120122S0030.fits")]) offsets = testutil.get_offsets() testutil.assert_tolerance(offsets[0], 29.013, tolerance=0.004) testutil.assert_tolerance(offsets[1], -1.457, tolerance=0.01) @with_setup(testutil.setup_io("2"), clear_cursor_positions) def test_gmos_north_ifu_2_imaging_exact_center(): add_cursor_position(516.0, 1154.0, "a") add_cursor_position(716.0, 1144.0, "c") add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("N20120122S0030.fits")]) offsets = testutil.get_offsets() testutil.assert_tolerance(offsets[0], 29.017, tolerance=0.002) testutil.assert_tolerance(offsets[1], -1.396, tolerance=0.01)
from nose import with_setup from nose.tools import raises import testutil from gacq import main from userinterface import add_cursor_position, clear_cursor_positions @with_setup(testutil.setup_io("yes"), clear_cursor_positions) def test_gmos_south_with_a_weird_artifact(): add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("S20130114S0062.fits")]) offsets = testutil.get_offsets() testutil.assert_tolerance(offsets[0], -0.028, tolerance=0.004) testutil.assert_tolerance(offsets[1], 0.171, tolerance=0.01) testutil.assert_tolerance(offsets[2], 0.015, tolerance=0.008) @with_setup(testutil.setup_io("yes"), clear_cursor_positions) def test_gmos_south_with_a_weird_artifact_discard_top_left(): add_cursor_position(20.0, 150.0, "d") add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("S20130114S0062.fits")]) offsets = testutil.get_offsets() testutil.assert_tolerance(offsets[0], -0.028, tolerance=0.008) testutil.assert_tolerance(offsets[1], 0.171, tolerance=0.053) testutil.assert_tolerance(offsets[2], 0.015, tolerance=0.026) @raises(SystemExit)
from nose import with_setup from nose.tools import raises import testutil from integratedfieldunit import main from userinterface import add_cursor_position, clear_cursor_positions @with_setup(testutil.setup_io(""), clear_cursor_positions) def test_gmos_north_ifu_R(): add_cursor_position(10.5, 101.5, "a") add_cursor_position(0.0, 0.0, "q") add_cursor_position(9.6, 11.2, "r") add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("N20111126S0354.fits")]) @with_setup(testutil.setup_io(""), clear_cursor_positions) def test_gmos_north_ifu_2(): add_cursor_position(12.0, 97.0, "a") add_cursor_position(0.0, 0.0, "q") add_cursor_position(19.0, 14.0, "r") add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("N20120122S0031.fits")]) @with_setup(testutil.setup_io(""), clear_cursor_positions) def test_gmos_north_long_object(): add_cursor_position(12.0, 99.0, "a") add_cursor_position(0.0, 0.0, "q") add_cursor_position(9.0, 13.0, "r") add_cursor_position(0.0, 0.0, "q")