Пример #1
0
    def test_RFT_load( self ):
        rftFile = EclRFTFile(self.RFT_file)

        rft = rftFile[0]
        cell = rft.ijkget((32, 53, 0))
        self.assertIsInstance(cell, EclRFTCell)

        self.assertEqual(2, rftFile.size())
        self.assertEqual(0, rftFile.size(well="OP*"))
        self.assertEqual(0, rftFile.size(well="XXX"))
        self.assertEqual(1, rftFile.size(date=datetime.date(2000, 6, 1)))
        self.assertEqual(0, rftFile.size(date=datetime.date(2000, 6, 17)))

        cell = rft.ijkget((30, 20, 1880))
        self.assertIsNone(cell)

        for rft in rftFile:
            self.assertTrue(rft.is_RFT())
            self.assertFalse(rft.is_SEGMENT())
            self.assertFalse(rft.is_PLT())
            self.assertFalse(rft.is_MSW())

            for cell in rft:
                self.assertIsInstance(cell, EclRFTCell)

            cell0 = rft.iget_sorted(0)
            self.assertIsInstance(cell, EclRFTCell)
            rft.sort()

        for h in rftFile.headers:
            print h
            self.assertIsInstance( h[1] , datetime.date )
Пример #2
0
    def test_PLT(self):
        rft_file = EclRFTFile( self.createTestPath("Statoil/ECLIPSE/Heidrun/RFT/2C3_MR61.RFT"))

        rft0 = rft_file[0]
        rft1 = rft_file[1]
        rft2 = rft_file[2]
        rft3 = rft_file[3]

        self.assertTrue( rft0.is_RFT() )
        self.assertTrue( rft1.is_RFT() )
        self.assertTrue( rft2.is_PLT() )
        self.assertTrue( rft3.is_PLT() )

        self.assertEqual( len(rft0) , 42 )
        self.assertEqual( len(rft1) , 37 )
        self.assertEqual( len(rft2) , 42 )
        self.assertEqual( len(rft3) , 37 )

        self.assertFloatEqual( rft0[0].pressure ,  0.22919502E+03 )
        self.assertFloatEqual( rft0[0].depth    ,  0.21383721E+04)

        self.assertFloatEqual( rft1[0].pressure ,  0.22977950E+03 )
        self.assertFloatEqual( rft1[0].depth    ,  0.21384775E+04 )
        
        self.assertFloatEqual( rft2[0].pressure ,  0.19142435E+03 )
        self.assertFloatEqual( rft2[0].depth    ,  0.21383721E+04 )
Пример #3
0
    def test_RFT_load( self ):
        rftFile = EclRFTFile(self.RFT_file)

        rft = rftFile[0]
        cell = rft.ijkget((32, 53, 0))
        self.assertIsInstance(cell, EclRFTCell)

        self.assertEqual(2, rftFile.size())
        self.assertEqual(0, rftFile.size(well="OP*"))
        self.assertEqual(0, rftFile.size(well="XXX"))
        self.assertEqual(1, rftFile.size(date=datetime.date(2000, 6, 1)))
        self.assertEqual(0, rftFile.size(date=datetime.date(2000, 6, 17)))

        cell = rft.ijkget((30, 20, 1880))
        self.assertIsNone(cell)

        for rft in rftFile:
            self.assertTrue(rft.is_RFT())
            self.assertFalse(rft.is_SEGMENT())
            self.assertFalse(rft.is_PLT())
            self.assertFalse(rft.is_MSW())

            for cell in rft:
                self.assertIsInstance(cell, EclRFTCell)

            cell0 = rft.iget_sorted(0)
            self.assertIsInstance(cell, EclRFTCell)
            rft.sort()

        for h in rftFile.getHeaders():
            print(h)
            self.assertIsInstance( h[1] , datetime.date )
Пример #4
0
    def test_PLT_load( self ):
        pltFile = EclRFTFile(self.PLT_file)
        plt = pltFile[11]
        self.assertTrue(plt.is_PLT())
        self.assertFalse(plt.is_SEGMENT())
        self.assertFalse(plt.is_RFT())
        self.assertFalse(plt.is_MSW())

        for cell in plt:
            self.assertIsInstance(cell, EclPLTCell)
Пример #5
0
 def test_exceptions( self ):
     with self.assertRaises(IndexError):
         rftFile = EclRFTFile(self.RFT_file)
         rft = rftFile[100]