Ejemplo n.º 1
0
def zoeppritz(Rp0, Rp1, theta1):
    '''
    Wrapper around long zoeppritz funcion.
    
    :param Rp0:
    :param Rp1:
    :param theta1:
     
    '''
    return reflection.zoeppritz(Rp0.vp, Rp0.vs, Rp0.rho, Rp1.vp, Rp1.vs, Rp1.rho, theta1)    
Ejemplo n.º 2
0
    def test_wrapper( self ):
        """
        Tests the reflectivity wrapper function
        """
        
        theta = 15.0

        ref_wrap = rock_reflectivity( self.Rp0, self.Rp1,
                                      theta=theta,
                                      method=avo.zoeppritz )

        ref = avo.zoeppritz( self.vp0,self.vs0,self.rho0,
                             self.vp1, self.vs1, self.rho1,
                             theta )

        
        self.assertEqual( ref, ref_wrap )
Ejemplo n.º 3
0
    def test_shuey2(self):

        vp1 = 12250.
        vp2 = 11600.

        vs1 = 6200.
        vs2 = 6650.

        rho1 = 2.66
        rho2 = 2.34

        theta = np.arange(45)

        reflect = avo.shuey2(vp1, vs1, rho1, vp2, vs2, rho2, theta)
        reflect_zoep = avo.zoeppritz(vp1, vs1, rho1, vp2, vs2, rho2, theta)

        # See if it is within .1 of zoep for < 45 deg
        test = np.allclose(reflect, reflect_zoep, rtol=self.tolerance)
        self.assertTrue(test)
Ejemplo n.º 4
0
    def test_zoeppritz(self):

        vp1 = 12250.
        vp2 = 11600.

        vs1 = 6200.
        vs2 = 6650.

        rho1 = 2.66
        rho2 = 2.34

        theta = 40.


        reflect = avo.zoeppritz( vp1,vs1,rho1,vp2,vs2,rho2,theta )

        # Number manually verified using
        # spreadsheet from http://tbberge.com/id63.html
        self.assertAlmostEquals( reflect, -0.112236, places=3 )
Ejemplo n.º 5
0
    def test_get_reflectivity( self ):

        cmap = {rgb(150,100,100):self.Rp0, rgb( 100,150,100):self.Rp1}
        theta = 15.0
        data = np.zeros( (100,100,3 ) )

        data[:50,:,:] += [150,100,100]
        data[50:,:,:] += [100,150,100]

        reflectivity = \
          get_reflectivity( data, cmap, theta,
                            reflectivity_method=avo.zoeppritz )

        truth = avo.zoeppritz( self.vp0, self.vs0, self.rho0,
                               self.vp1, self.vs1, self.rho1,
                               theta )

        test = np.zeros( (100,100,1) )
        test[49,:,0] = truth

        self.assertTrue( np.array_equal( test, reflectivity ) )