Пример #1
0
 def test_has_get_item(self):
     sm = SimpleMetadataMap()
     nt.assert_false(sm.has_item(self.small_tag[1], 1))
     with nt.assert_raises_regexp(
             RuntimeError,
             "Metadata map does not contain frame 1",
     ):
         sm.get_item(self.small_tag[1], 1)
Пример #2
0
 def setUp(self):
   self.meta_ = SimpleMetadataMap()
   self.geo_ = LocalGeoCS()
   self.small_tag = [
         mt.tags.VITAL_META_UNKNOWN,
         mt.tags.VITAL_META_UNIX_TIMESTAMP,
         mt.tags.VITAL_META_SLANT_RANGE,
         mt.tags.VITAL_META_MISSION_ID,
         mt.tags.VITAL_META_VIDEO_KEY_FRAME,
     ]
   self.loc1 = np.array([-73.759291, 42.849631])
   self.crs_ll = geodesy.SRID.lat_lon_WGS84
   self.geo_pt1_ = GeoPoint(self.loc1, self.crs_ll)
   self.geo_.geo_origin = self.geo_pt1_
Пример #3
0
    def test_properties(self):
      # modules.load_known_modules()
      # metadata property
      s = SFMConstraints(self.meta_, self.geo_)
      get_meta = s.metadata
      nt.assert_equal(get_meta.size(), 0)
      m = SimpleMetadataMap()
      s.metadata = m
      nt.assert_equal(s.metadata.size(), 0)

      # local_geo_property
      ret_geo = s.local_geo_cs
      np.testing.assert_array_almost_equal(ret_geo.geo_origin.location(self.crs_ll),
                                                                        self.geo_pt1_.location())
      s = SFMConstraints()
      s.local_geo_cs = self.geo_
      ret_geo = s.local_geo_cs
      np.testing.assert_array_almost_equal(ret_geo.geo_origin.location(self.crs_ll),
                                                                        self.geo_pt1_.location())
Пример #4
0
 def test_frames(self):
     sm = SimpleMetadataMap()
     frames = sm.frames()
     nt.ok_(isinstance(frames, set))
     nt.assert_set_equal(frames, set())
Пример #5
0
 def test_get_vector(self):
     sm = SimpleMetadataMap()
     vm = sm.get_vector(1)
     nt.ok_(isinstance(vm, list))
     nt.assert_list_equal(vm, [])
Пример #6
0
 def test_metadata(self):
     sm = SimpleMetadataMap()
     m = sm.metadata()
     nt.ok_(isinstance(m, dict))
Пример #7
0
 def test_size(self):
     sm = SimpleMetadataMap()
     nt.assert_equal(sm.size(), 0)
Пример #8
0
 def test_init(self):
     SimpleMetadataMap()