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)
Exemplo n.º 2
0
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)
Exemplo n.º 3
0
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)
Exemplo n.º 4
0
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_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)
Exemplo n.º 7
0
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)
Exemplo n.º 8
0
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)
Exemplo n.º 9
0
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)
Exemplo n.º 10
0
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)
Exemplo n.º 11
0
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)
Exemplo n.º 12
0
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)
Exemplo n.º 13
0
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)
Exemplo n.º 14
0
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)
Exemplo n.º 15
0
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)
Exemplo n.º 16
0
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)
Exemplo n.º 17
0
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)
Exemplo n.º 18
0
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")])

    offsets = testutil.get_offsets()
    testutil.assert_tolerance(offsets[0],  0.315, tolerance=0.1)
    testutil.assert_tolerance(offsets[1], -0.150, tolerance=0.1)
Exemplo n.º 19
0
def test_gmos_north_extended_fuzzy_object():
    add_cursor_position(8.6, 98.0, "a")
    add_cursor_position(0.0, 0.0, "q")
    add_cursor_position(8.0, 14.0, "r")
    add_cursor_position(0.0, 0.0, "q")

    ret = main(["gacq_test", testutil.get_data_file_name("N20130716S0160.fits")])

    offsets = testutil.get_offsets()
    testutil.assert_tolerance(offsets[0],  0.328, tolerance=0.1)
    testutil.assert_tolerance(offsets[1], -0.442, tolerance=0.1)
Exemplo n.º 20
0
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(19.0, 16.0, "r")
    add_cursor_position(0.0, 0.0, "q")

    ret = main(["gacq_test", testutil.get_data_file_name("S20071017S0002.fits")])

    offsets = testutil.get_offsets()
    testutil.assert_tolerance(offsets[0],  0.235, tolerance=0.1)
    testutil.assert_tolerance(offsets[1], -0.920, tolerance=0.1)
Exemplo n.º 21
0
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)
Exemplo n.º 22
0
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")])

    offsets = testutil.get_offsets()
    testutil.assert_tolerance(offsets[0], 0.615, tolerance=0.1)
    testutil.assert_tolerance(offsets[1], 0.094, tolerance=0.1)
def test_move_object_far_to_slit():
    add_cursor_position(526.0, 1186.0, "a")
    add_cursor_position(0.0, 0.0, "q")
    add_cursor_position(0.0, 0.0, "q") # slit measurement is ok

    ret = main(["gacq_test", testutil.get_data_file_name("S20110804S0046.fits")]) # S20110804S0047.fits is the image of the slit

    offsets = testutil.get_offsets()

    testutil.assert_tolerance(offsets[0], -1.749, tolerance=0.1)
    testutil.assert_tolerance(offsets[1],  4.925, tolerance=0.005)
Exemplo n.º 24
0
def test_custom_center():
    add_cursor_position(489.07, 478.99, "a")
    add_cursor_position(512.00, 512.00, "c")
    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)
Exemplo n.º 25
0
def test_extra_cursor_coordinates_should_be_ignored():
    add_cursor_position(100.07, 100.99, "a")
    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_measuring_longslit_from_image():
    add_cursor_position(152.0, 144.0, "a")
    add_cursor_position(0.0, 0.0, "q")
    add_cursor_position(0.0, 0.0, "q") # slit measurement is ok

    ret = main(["gacq_test", testutil.get_data_file_name("N20111127S0001.fits")]) # N20111127S0002.fits is the image of the slit

    offsets = testutil.get_offsets()

    testutil.assert_tolerance(offsets[0], -0.210, tolerance=0.08)
    testutil.assert_tolerance(offsets[1],  0.342, tolerance=0.003)
def test_really_long_longslit_measuring():
    add_cursor_position(513.0, 1150.0, "a")
    add_cursor_position(0.0, 0.0, "q")
    add_cursor_position(0.0, 0.0, "q") # slit measurement is ok

    ret = main(["gacq_test", testutil.get_data_file_name("N20120216S0231.fits")]) # N20120216S0232 is the image of the slit

    offsets = testutil.get_offsets()

    testutil.assert_tolerance(offsets[0], -0.121, tolerance=0.06)
    testutil.assert_tolerance(offsets[1],  0.285, tolerance=0.02)
Exemplo n.º 28
0
def test_exact_star_location_should_escape_discarding_box():
    add_cursor_position(45.0, 61.0, "d")
    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_north_with_poor_mask_alignment():
    add_cursor_position(70.0,   77.0, "a")
    add_cursor_position(57.0,  276.0, "a")
    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.001)
    testutil.assert_tolerance(offsets[1],  1.927, tolerance=0.02)
    testutil.assert_tolerance(offsets[2], -0.120, tolerance=0.001)
Exemplo n.º 30
0
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)