def test_add_to_castcollection(self):
     cc = CastCollection(
             Cast(P=np.arange(100), T=np.random.rand(100), S=np.random.rand(100),
                  coordinates=(-17.42, 80.09)),
             Cast(P=np.arange(100), T=np.random.rand(100), S=np.random.rand(100),
                  coordinates=(-17.426, 80.112)),
             Cast(P=np.arange(100), T=np.random.rand(100), S=np.random.rand(100),
                  coordinates=(-17.45, 80.16)))
     cc.add_bathymetry(self.bathymetry)
     correctresult = np.array([92.93171145156435, 123.1639348135739, 150.2982311721252])
     depths = [c.properties["depth"] for c in cc]
     self.assertTrue(np.allclose(depths, correctresult))
     return
 def test_add_to_castcollection(self):
     cc = CastCollection(
             Cast(np.arange(100), T=np.random.rand(100), S=np.random.rand(100),
                  coords=(-17.42, 80.09)),
             Cast(np.arange(100), T=np.random.rand(100), S=np.random.rand(100),
                  coords=(-17.426, 80.112)),
             Cast(np.arange(100), T=np.random.rand(100), S=np.random.rand(100),
                  coords=(-17.45, 80.16)))
     cc.add_bathymetry(self.bathymetry)
     correctresult = np.array([92.61373822294766, 123.15924954803165,
                               150.24992416068667])
     depths = [c.properties["depth"] for c in cc]
     self.assertTrue(np.allclose(depths, correctresult))
     return
Exemple #3
0
 def test_add_to_castcollection(self):
     cc = CastCollection(
         Cast(P=np.arange(100),
              T=np.random.rand(100),
              S=np.random.rand(100),
              coordinates=(-17.42, 80.09)),
         Cast(P=np.arange(100),
              T=np.random.rand(100),
              S=np.random.rand(100),
              coordinates=(-17.426, 80.112)),
         Cast(P=np.arange(100),
              T=np.random.rand(100),
              S=np.random.rand(100),
              coordinates=(-17.45, 80.16)))
     cc.add_bathymetry(self.bathymetry)
     correctresult = np.array(
         [92.93171145156435, 123.1639348135739, 150.2982311721252])
     depths = [c.properties["depth"] for c in cc]
     self.assertTrue(np.allclose(depths, correctresult))
     return