示例#1
0
 def testLatitudeWithinLowBound(self):
     try:
         Correction(Angle.parse('-89d59.9'), Angle.parse('0d0.0'),
                    Angle.parse('1d0.0'), Angle.parse('0d0.0'),
                    Angle.parse('0d0.0'))
     except ValueError:
         self.fail('latitude within bounds raised exception')
示例#2
0
 def testLongitudeWithinHighBound(self):
     try:
         Correction(Angle.parse('0d0.0'), Angle.parse('359d59.9'),
                    Angle.parse('1d0.0'), Angle.parse('0d0.0'),
                    Angle.parse('0d0.0'))
     except ValueError:
         self.fail('longitude within bounds raised exception')
示例#3
0
 def testCorrectedAzimuth(self):
     self.assertEquals(
         '0d36.8',
         str(
             Correction(Angle.parse('89d20.1'), Angle.parse('154d5.4'),
                        Angle.parse('37d17.4'), Angle.parse('35d59.7'),
                        Angle.parse('74d35.3')).correctedAzimuth()))
示例#4
0
 def testLatitudeOutOfLowBound(self):
     try:
         Correction(Angle.parse('-90d0.0'), Angle.parse('0d0.0'),
                    Angle.parse('1d0.0'), Angle.parse('0d0.0'),
                    Angle.parse('0d0.0'))
         self.fail('latitude out of bounds didn\'t raise exception')
     except ValueError:
         sys.exc_clear()
示例#5
0
 def testHorizonInvalid(self):
     for i in ('foobar', 'Foobar', 'natificial'):
         try:
             AdjustedAltitude(Angle.parse('30d30.0'), horizon=i)
             self.fail('invalid horizon %s didn\'t raise exception' % i)
         except ValueError:
             sys.exc_clear()
示例#6
0
 def testHorizonValid(self):
     for i in ('artificial', 'natural', 'Artificial', 'NaTuRaL'):
         try:
             AdjustedAltitude(Angle.parse('30d30.0'), horizon=i)
         except ValueError as e:
             self.fail('valid horizon %s raised exception: %s' %
                       (i, str(e)))
示例#7
0
 def testIntermediateDistance(self):
     self.assertAlmostEquals(
         -0.789,
         Correction(Angle.parse('16d32.3'), Angle.parse('95d41.6'),
                    Angle.parse('13d42.3'), Angle.parse('-53d38.4'),
                    Angle.parse('74d35.3')).intermediateDistance(), 3)
示例#8
0
文件: AngleTest.py 项目: jzg0028/CSSE
 def testMinutesCommutativeNegative(self):
     i = -1.0
     while i < 0.0:
         self.assertAlmostEquals(i, float(Angle.parse(str(Angle(i)))))
         i += 0.01
示例#9
0
文件: AngleTest.py 项目: jzg0028/CSSE
 def testGetMinutes(self):
     self.assertEquals('0d60.1', str(Angle.parse('0d60.1')))
示例#10
0
 def testNominal1(self):
     self.assertEquals(
         '45d11.9',
         str(
             AdjustedAltitude(Angle.parse('45d15.2'), 6.0, 1010, 71,
                              'natural')))
示例#11
0
 def testNominal0(self):
     self.assertEquals(
         '29d59.9',
         str(
             AdjustedAltitude(Angle.parse('30d1.5'), 19.0, 1000, 85,
                              'artificial')))
示例#12
0
 def testCorrectedDistance(self):
     self.assertEquals(
         3950,
         Correction(Angle.parse('16d32.3'), Angle.parse('95d41.6'),
                    Angle.parse('13d42.3'), Angle.parse('-53d38.4'),
                    Angle.parse('74d35.3')).correctedDistance())
示例#13
0
文件: AngleTest.py 项目: jzg0028/CSSE
 def testDegreesCommutativePositive(self):
     i = 0.0
     while i < 360.0:
         self.assertAlmostEquals(i, float(Angle.parse(str(Angle(i)))))
         i += 1.0
示例#14
0
 def testTemperatureHighBound(self):
     try:
         AdjustedAltitude(Angle.parse('30d30.0'), temperature=121)
         self.fail('temperature high bound didn\'t raise exception')
     except ValueError:
         sys.exc_clear()
示例#15
0
 def testPressureHighBound(self):
     try:
         AdjustedAltitude(Angle.parse('30d30.0'), pressure=1101)
         self.fail('pressure high bound didn\'t raise exception')
     except ValueError:
         sys.exc_clear()
示例#16
0
 def testHeightLowBound(self):
     try:
         AdjustedAltitude(Angle.parse('30d30.0'), height=-0.1)
         self.fail('height low bound didn\'t raise exception')
     except ValueError:
         sys.exc_clear()
示例#17
0
 def testMinutesHighBound(self):
     try:
         AdjustedAltitude(Angle.parse('0d60.1'))
         self.fail('minute high bound didn\'t raise exception')
     except ValueError:
         sys.exc_clear()
示例#18
0
 def testObservationHighBound(self):
     try:
         AdjustedAltitude(Angle.parse('90d0.1'))
         self.fail('observation high bound didn\'t raise exception')
     except ValueError:
         sys.exc_clear()
示例#19
0
 def testObservationLowBound(self):
     try:
         AdjustedAltitude(Angle.parse('0d0.0'))
         self.fail('observation low bound didn\'t raise exception')
     except ValueError:
         sys.exc_clear()
示例#20
0
文件: AngleTest.py 项目: jzg0028/CSSE
 def testParse(self):
     self.assertEquals('359d0.0', str(Angle.parse('359d0.0')))