def test_gmos_south_port_one(): add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("S20110804S0079.fits")]) offsets = testutil.get_offsets() testutil.assert_tolerance(offsets[0], 0.321, tolerance=0.02) testutil.assert_tolerance(offsets[1], -0.004, tolerance=0.01) testutil.assert_tolerance(offsets[2], 0.027, tolerance=0.002)
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)
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)
def test_gmos_N20130616S0089(): add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("N20130616S0089.fits")]) offsets = testutil.get_offsets() testutil.assert_tolerance(offsets[0], -0.219, tolerance=0.03) testutil.assert_tolerance(offsets[1], 0.102, tolerance=0.01) testutil.assert_tolerance(offsets[2], 0.010, tolerance=0.01)
def test_gmos_south_ifu_R_imaging(): add_cursor_position(302.0, 1160.0, "a") add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", "-v", testutil.get_data_file_name("S20090326S0024.fits")]) offsets = testutil.get_offsets() testutil.assert_tolerance(offsets[0], 2.471, tolerance=0.004) testutil.assert_tolerance(offsets[1], 1.035, tolerance=0.007)
def test_gmos_north_ifu_R_imaging_on_a_stamp(): add_cursor_position(154.0, 152.0, "a") add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("N20111126S0353.fits")]) offsets = testutil.get_offsets() testutil.assert_tolerance(offsets[0], 31.014, tolerance=0.040) testutil.assert_tolerance(offsets[1], -1.457, tolerance=0.006)
def test_move_single_object_to_center_of_slit(): add_cursor_position(498.0, 1146.0, "a") add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("N20060131S0014.fits")]) offsets = testutil.get_offsets() testutil.assert_tolerance(offsets[0], 1.994888, tolerance=0.02) testutil.assert_tolerance(offsets[1], 0.929106, tolerance=0.08)
def test_target_is_very_far_from_slit(): add_cursor_position(526.0, 1186.0, "r") add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("S00000000S0001.fits")]) offsets = testutil.get_offsets() testutil.assert_tolerance(offsets[0], -2.095, tolerance=0.02) testutil.assert_tolerance(offsets[1], 4.925, tolerance=0.005)
def test_gmos_south_longslit(): add_cursor_position(511.0, 1145.0, "a") add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("S20071017S0003.fits")]) offsets = testutil.get_offsets() testutil.assert_tolerance(offsets[0], -0.117, tolerance=0.06) testutil.assert_tolerance(offsets[1], 0.632, tolerance=0.06)
def test_bright_object_that_does_not_converge(): add_cursor_position(391.0, 539.0, "a") add_cursor_position(391.0, 539.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("N20060131S0011.fits")]) offsets = testutil.get_offsets() testutil.assert_almost_equals(offsets, (2.779, 0.672), places=2)
def test_cursor_coordinates_should_round_to_nearest_integer(): add_cursor_position(489.07, 478.99, "a") add_cursor_position(489.07, 478.99, "q") ret = main(["gacq_test", testutil.get_data_file_name("N20060131S0012.fits")]) offsets = testutil.get_offsets() testutil.assert_almost_equals(offsets, (2.661, -3.874), places=2)
def test_gmos_north_ignore_offsets_and_start_science(): add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("N20130419S0270.fits")]) # ignore offsets and start science immediately offsets = testutil.get_offsets() testutil.assert_tolerance(offsets[0], 0.019, tolerance=0.004) testutil.assert_tolerance(offsets[1], 0.073, tolerance=0.010) testutil.assert_tolerance(offsets[2], 0.005, tolerance=0.010)
def test_gmos_south_from_entire_field_of_view_with_exact_star_location(): add_cursor_position(45.0, 61.0, "x") add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("S20090422S0074.fits")]) offsets = testutil.get_offsets() testutil.assert_tolerance(offsets[0], 0.271, tolerance=0.019) testutil.assert_tolerance(offsets[1], -0.473, tolerance=0.006) testutil.assert_tolerance(offsets[2], -0.080, tolerance=0.002)
def test_gmos_N20130616S0090(): add_cursor_position(148.0, 158.0, "r") add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("N20130616S0090.fits")]) offsets = testutil.get_offsets() testutil.assert_tolerance(offsets[0], -0.032, tolerance=0.02) testutil.assert_tolerance(offsets[1], -0.015, tolerance=0.02) testutil.assert_tolerance(offsets[2], 0.001, tolerance=0.01)
def test_gmos_south_from_entire_field_of_view(): add_cursor_position(44.0, 64.0, "a") add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("S20090422S0074.fits")]) offsets = testutil.get_offsets() testutil.assert_tolerance(offsets[0], 0.271, tolerance=0.018) testutil.assert_tolerance(offsets[1], -0.473, tolerance=0.005) testutil.assert_tolerance(offsets[2], -0.080, tolerance=0.003)
def test_gmos_N20130616S0088(): add_cursor_position(300.0, 303.0, "a") add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("N20130616S0088.fits")]) offsets = testutil.get_offsets() testutil.assert_tolerance(offsets[0], 0.282, tolerance=0.01) testutil.assert_tolerance(offsets[1], -0.074, tolerance=0.01) testutil.assert_tolerance(offsets[2], -0.019, tolerance=0.02)
def test_gmos_north_7_boxes(): add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("N20111123S0033.fits")]) # ignore offsets and start science immediately offsets = testutil.get_offsets() testutil.assert_tolerance(offsets[0], -0.030, tolerance=0.03) testutil.assert_tolerance(offsets[1], -0.010, tolerance=0.006) testutil.assert_tolerance(offsets[2], 0.005, tolerance=0.002)
def test_old_gmos_north_with_3_boxes(): add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("N20060131S0015.fits")]) # ignore offsets and start science immediately, looks like the # errors in star/box positions offset each other offsets = testutil.get_offsets() testutil.assert_tolerance(offsets[0], 0.029, tolerance=0.014) testutil.assert_tolerance(offsets[1], 0.024, tolerance=0.008) testutil.assert_tolerance(offsets[2], -0.012, tolerance=0.003)
def test_7_box_monkey_test(): rand = Random(8799) for i in range(100): x = rand.choice(range(350)) y = rand.choice(range(350)) key = rand.choice(["a", "r", "e", "x", "b", "d"]) add_cursor_position(x, y, key) add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("N20111123S0033.fits")])
def test_gmos_south_off_center_boxes(): add_cursor_position(55.0, 58.0, "a") add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("S20071017S0001.fits")]) # higher tolerance for tough case, new python version gets it "more correct" than automaskdetect offsets = testutil.get_offsets() testutil.assert_tolerance(offsets[0], -0.512, tolerance=0.02) testutil.assert_tolerance(offsets[1], -0.381, tolerance=0.05) testutil.assert_tolerance(offsets[2], 0.135, tolerance=0.012)
def test_should_not_be_able_to_manually_specify_a_box(): add_cursor_position(98.0, 312.0, "a") add_cursor_position(96.0, 108.0, "a") add_cursor_position(100.0, 100.0, "b") add_cursor_position(298.0, 110.0, "a") add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", "--mosmasknum", "6", testutil.get_data_file_name("N20121108S0357.fits")]) offsets = testutil.get_offsets() testutil.assert_tolerance(offsets[0], 0.443, tolerance=0.02) testutil.assert_tolerance(offsets[1], -1.236, tolerance=0.01) testutil.assert_tolerance(offsets[2], 0.116, tolerance=0.004)
def test_gmos_north_with_poor_mask_alignment_discard_first_box(): add_cursor_position(70.0, 77.0, "a") add_cursor_position(57.0, 276.0, "a") add_cursor_position(70.0, 77.0, "d") add_cursor_position(262.0, 266.0, "a") add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", "--mosmasknum", "3", testutil.get_data_file_name("N20060131S0017.fits")]) offsets = testutil.get_offsets() testutil.assert_tolerance(offsets[0], 2.714, tolerance=0.06) testutil.assert_tolerance(offsets[1], 1.927, tolerance=0.3) testutil.assert_tolerance(offsets[2], -0.120, tolerance=0.021)
def test_gmos_north_ifu_R_flat(): add_cursor_position(9.0, 101.0, "a") add_cursor_position(0.0, 0.0, "q") add_cursor_position(10.0, 10.0, "r") add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("N20130717S0014.fits")])
def test_gmos_south_ifu_2_diffuse_object(): add_cursor_position(10.5, 106.0, "a") add_cursor_position(0.0, 0.0, "q") add_cursor_position(20.0, 10.0, "r") add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("S20130421S0035.fits")])
def test_gmos_south_ifu_2_flat(): add_cursor_position(7.0, 108.0, "a") add_cursor_position(0.0, 0.0, "q") add_cursor_position(20.0, 10.0, "r") add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("S20130110S0028.fits")])
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")])
def test_gmos_south_ifu_2_bright_star(): add_cursor_position(10.0, 108.0, "a") add_cursor_position(0.0, 0.0, "q") add_cursor_position(19.0, 13.0, "r") add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("S20130227S0313.fits")])
def test_gmos_north_ifu_2_flat(): add_cursor_position(10.3, 102.0, "a") add_cursor_position(0.0, 0.0, "q") add_cursor_position(20.0, 10.0, "r") add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("N20130606S0009.fits")])
def test_gmos_south_ifu_R(): add_cursor_position(9.0, 101.0, "a") add_cursor_position(0.0, 0.0, "q") add_cursor_position(10.0, 10.0, "r") add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("S20071017S0002.fits")])
def test_gmos_south_ifu_2_newer_flat(): add_cursor_position(11.0, 102.0, "a") add_cursor_position(0.0, 0.0, "q") add_cursor_position(20.0, 10.0, "r") add_cursor_position(0.0, 0.0, "q") ret = main(["gacq_test", testutil.get_data_file_name("S20130725S0014.fits")])