casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
test_measures.py
Go to the documentation of this file.
00001 from __main__ import default
00002 from tasks import *
00003 from taskinit import *
00004 from tests.test_split import check_eq, datapath
00005 import unittest
00006 
00007 '''
00008 Unit tests for the measures tool.
00009 
00010 Features tested:
00011   1. me.cometdist
00012   2. me.cometangdiam
00013 '''
00014 
00015 class Ganymede(unittest.TestCase):
00016     """
00017     Base class for Ganymede tests.
00018     """
00019     def setUp(self):
00020         cometdir = os.getenv("CASAPATH").split()[0] + "/data/ephemerides/JPL-Horizons/"
00021         me.framecomet(cometdir + "Ganymede_55438-56292dUTC.tab")
00022         me.doframe(me.epoch("utc", "2011/01/03/17:00:00"))
00023         me.doframe(me.observatory("ALMA"))
00024 
00025     def tearDown(self):
00026         pass
00027 
00028 class me_test_cometdist(Ganymede):
00029     def test_cometdist(self):
00030         """Is the distance to Ganymede just right?"""
00031         check_eq(me.cometdist(), {'unit': 'AU', 'value': 5.1241}, 0.001)
00032             
00033 class me_test_cometangdiam(Ganymede):
00034     def test_cometangdiam(self):
00035         """Is Ganymede's angular diameter correct?"""
00036         check_eq(me.cometangdiam(), {'unit': 'rad', 'value': 6.868e-06},
00037                  1.0e-9)
00038 
00039 def suite():
00040     return [me_test_cometdist, me_test_cometangdiam]