Example #1
0
 def test_ship_is_at_computed_location(self):
     difference_from_estimated_location = tc.distr2(self.trip1)
     for i, diff in enumerate(difference_from_estimated_location):
         if 0 < i < len(difference_from_estimated_location) - 1:
             self.assertAlmostEqual(diff, 0, delta=0.00001)
Example #2
0
 def test_misplaced_ob_out_by_1degree_times_coslat(self):
     difference_from_estimated_location = tc.distr2(self.trip2)
     self.assertAlmostEqual(
         difference_from_estimated_location[1], (2 * np.pi * 6371.0088) *
         np.cos(self.trip2.reps[1].lat() * np.pi / 180.) / 360.,
         delta=0.00001)
Example #3
0
 def test_last_entry_missing(self):
     difference_from_estimated_location = tc.distr2(self.trip1)
     self.assertEqual(difference_from_estimated_location[-1], None)