Ejemplo n.º 1
0
def test_observatory_construction():
    r""" Constructor test """
    print("\n===== Begin test_observatory_construction")
    obs = Observatory()
    assert obs.get_telescope_name() == "Fake", error_msg("Wrong name for the fake observatory")
    obs = Observatory(telescope_id=4)
    assert obs.get_telescope_name() == "PARKES", error_msg("Wrong name for the Parkes observatory")
    assert obs.get_telescope_name_short() == "PK", \
        error_msg("Wrong short name for the Parkes observatory")
    obs = Observatory(telescope_name="GBT")
    assert obs.get_telescope_id() == 6, error_msg("Wrong Sigproc ID for the GBT observatory")
    print("===== End test_observatory_construction")
Ejemplo n.º 2
0
def test_observatory_procs():
    r""" Try the member functions with Parkes """
    print("\n===== Begin test_observatory_procs")
    obs = Observatory(telescope_id=4)
    print(obs.get_string())
    print(obs.get_telescope_name())
    print(obs.get_telescope_name_short())
    print(obs.get_telescope_id())
    print(obs.get_xyz_coords())
    print(obs.get_dish_diameter())
    print(obs.get_string())
    print("===== End test_observatory_procs")
Ejemplo n.º 3
0
def test_observatory_values():
    """ Observatory values test along with beam halfwidth calculation test"""
    obs = Observatory(telescope_id=0)
    assert obs.get_telescope_name() == 'Fake', error_msg("Incorrect name")
    assert obs.get_xyz_coords() == (0.0, 0.0,
                                    0.0), error_msg("Incorrect XYZ coords")

    gbt = Observatory(telescope_id=6)
    beam_halfwidth = gbt.calc_beam_halfwidth(100)
    assert (beam_halfwidth - 3710.19799582) < .0000001, error_msg(
        "Incorrect beam haflwidth calculation")

    print(gbt.__str__())
Ejemplo n.º 4
0
def test_observatory_values():
    r""" Observatory values test along with beam halfwidth calculation test"""
    print("\n===== Begin test_observatory_values")
    obs = Observatory(telescope_id=0)
    print(obs.get_string())
    assert obs.get_telescope_name() == 'Fake', error_msg("Incorrect telescope name")
    assert obs.get_xyz_coords() == [0.0, 0.0, 0.0], error_msg("Incorrect XYZ coords")

    gbt = Observatory(telescope_id=6)
    beam_halfwidth = gbt.calc_beam_halfwidth(100)
    assert (beam_halfwidth - 3710.19799582) < .0000001, \
        error_msg("Incorrect beam haflwidth calculation")
    print("===== End test_observatory_values")
Ejemplo n.º 5
0
def test_observatory_construction():
    """ Constructor test """
    obs = Observatory(telescope_id=0)
    assert obs.get_telescope_name() != None, error_msg(
        "Could not create observatory")