예제 #1
0
    def __init__(self,mindata,maxdata,range,anisotropy=None,azimuth=0.0,dip=0.0,plunge=0.0):
        self.mindata = mindata
        self.maxdata = maxdata
        self.range = range
        if anisotropy is None:
            anisotropy = np.ones(2)

        self.rotmat = make_rotation_matrix([azimuth,dip,plunge],anisotropy)
예제 #2
0
    def __init__(self,points,azimuth=0.0,dip=0.0,plunge=0.0,anisotropy=[1.0,1.0]):
        n,m = points.shape

        if m != 3:
            raise KrigingSetupException("points are not 3D")

        if len(anisotropy) != 2:
            raise KrigingSetupException("anisotropy must be 2 length array or list")

        #create rotmat
        rotmat = make_rotation_matrix([azimuth,dip,plunge],anisotropy)

        KDTree.__init__(self,points,rotmat.T)
예제 #3
0
    def __init__(self,
                 mindata,
                 maxdata,
                 range,
                 anisotropy=None,
                 azimuth=0.0,
                 dip=0.0,
                 plunge=0.0):
        self.mindata = mindata
        self.maxdata = maxdata
        self.range = range
        if anisotropy is None:
            anisotropy = np.ones(2)

        self.rotmat = make_rotation_matrix([azimuth, dip, plunge], anisotropy)
예제 #4
0
    def __init__(self,
                 points,
                 azimuth=0.0,
                 dip=0.0,
                 plunge=0.0,
                 anisotropy=[1.0, 1.0]):
        n, m = points.shape

        if m != 3:
            raise KrigingSetupException("points are not 3D")

        if len(anisotropy) != 2:
            raise KrigingSetupException(
                "anisotropy must be 2 length array or list")

        #create rotmat
        rotmat = make_rotation_matrix([azimuth, dip, plunge], anisotropy)

        KDTree.__init__(self, points, rotmat.T)
예제 #5
0
 def __init__(self,nugget=0.0):
     self.nugget = nugget
     self.structures = []
     self._default_rotmat = make_rotation_matrix([0.0,0.0,0.0])
예제 #6
0
 def __init__(self,structure_type,sill,ranges,angles=[0.0,0.0,0.0]):
     VariogramStructure.__init__(self,structure_type,sill,ranges,angles)
     self._rotmat = make_rotation_matrix(angles,self._ranges[1:]/self._ranges[0])
예제 #7
0
 def __init__(self,nugget=0.0):
     VariogramModel.__init__(self,nugget)
     self._default_rotmat = make_rotation_matrix([0.0,0.0,0.0])
예제 #8
0
def check_angles(dp, ds, azimuth, dip, atol, dtol, horizontal_bandwith,
                 vertical_bandwith, k, points):
    max_horizontal_limit = horizontal_bandwith * np.cos(
        np.radians(atol)) / np.sin(np.radians(atol))
    max_vertical_limit = vertical_bandwith * np.cos(np.radians(dtol)) / np.sin(
        np.radians(dtol))

    ok = np.empty(len(dp), dtype=np.bool)
    ok[:] = True

    rotmat = geometry.make_rotation_matrix([azimuth - 90, dip, 0])

    print "rotmat", rotmat
    print "dp", dp

    dp_rotated = np.dot(rotmat, dp.T).T

    print "dp_rotated", dp_rotated
    #now the vector "is" in the Y axis for easy calculations
    horizontal_size = dp_rotated[:, 0]
    vertical_size = dp_rotated[:, 2]

    #print "vertical_size",vertical_size

    #first filter: horizontal_bandwith
    indices = np.where(np.abs(horizontal_size) > horizontal_bandwith)[0]
    #report why
    for i in indices:
        print "pair", k, i, "was rejected by horizontal bw", horizontal_size[
            i], horizontal_bandwith

    ok[indices] = False

    #print "1",ok,horizontal_size,horizontal_bandwith

    #second filter: vertical_bandwith
    indices = np.where(ok)[0]
    if len(indices) == 0:  #quick return
        return ok

    indices2 = np.where(np.abs(vertical_size[indices]) > vertical_bandwith)[0]
    #report why
    for i in indices2:
        print "pair", k, indices[
            i], "was rejected by vertical bw", vertical_size[
                indices[i]], vertical_bandwith

    ok[indices[indices2]] = False
    #print "2",ok,vertical_size,vertical_bandwith

    #third filter: horizontal_angle_tolerance
    indices = np.where(ok)[0]
    if len(indices) == 0:  #quick return
        return ok

    horizontal_limit = np.sqrt(ds[indices] + horizontal_size[indices]**2)
    horizontal_angle = np.arctan(dp_rotated[indices, 0] /
                                 dp_rotated[indices, 1])

    indices2 = np.where(
        np.logical_and(horizontal_limit <= max_horizontal_limit,
                       np.abs(horizontal_angle) > np.radians(atol)))[0]
    ok[indices[indices2]] = False
    #report why
    for i in indices2:
        print "pair", k, indices[
            i], "was rejected by horizontal angle tolerance", np.degrees(
                horizontal_angle[i]), atol

    #print "3",ok,np.degrees(horizontal_angle),atol,horizontal_limit,max_horizontal_limit

    #forth filter: vertical_angle_tolerance
    indices = np.where(ok)[0]
    if len(indices) == 0:  #quick return
        return ok
    vertical_limit = np.sqrt(ds[indices] + vertical_size[indices]**2)
    vectical_angle = np.arctan(dp_rotated[indices, 2] / dp_rotated[indices, 1])

    indices2 = np.where(
        np.logical_and(vertical_limit <= max_vertical_limit,
                       np.abs(vectical_angle) > np.radians(dtol)))[0]
    #report why
    for i in indices2:
        print "pair", k, indices[
            i], "was rejected by vertical angle tolerance", np.degrees(
                vectical_angle[i]), dtol

    ok[indices[indices2]] = False
    print "4", ok, np.degrees(
        vectical_angle), dtol, max_vertical_limit, vertical_limit

    return ok
def check_angles(dp,ds,azimuth,dip,atol,dtol,horizontal_bandwith,vertical_bandwith,k,points):
    max_horizontal_limit = horizontal_bandwith * np.cos(np.radians(atol)) / np.sin(np.radians(atol))
    max_vertical_limit = vertical_bandwith * np.cos(np.radians(dtol)) / np.sin(np.radians(dtol))
    
    ok = np.empty(len(dp),dtype=np.bool)
    ok[:] = True
    
    rotmat = geometry.make_rotation_matrix([azimuth-90,dip,0])
    
    print "rotmat",rotmat
    print "dp",dp
    
    dp_rotated = np.dot(rotmat,dp.T).T
    
    print "dp_rotated",dp_rotated
    #now the vector "is" in the Y axis for easy calculations
    horizontal_size = dp_rotated[:,0]
    vertical_size = dp_rotated[:,2]
    
    #print "vertical_size",vertical_size
    
    #first filter: horizontal_bandwith
    indices = np.where(np.abs(horizontal_size) > horizontal_bandwith)[0]
    #report why
    for i in indices:
        print "pair",k,i,"was rejected by horizontal bw",horizontal_size[i],horizontal_bandwith
        
    ok[indices] = False
    
    #print "1",ok,horizontal_size,horizontal_bandwith
    
    #second filter: vertical_bandwith
    indices = np.where(ok)[0]
    if len(indices) == 0: #quick return
        return ok
    
    indices2 = np.where(np.abs(vertical_size[indices]) > vertical_bandwith)[0]
    #report why
    for i in indices2:
        print "pair",k,indices[i],"was rejected by vertical bw",vertical_size[indices[i]],vertical_bandwith

    ok[indices[indices2]] = False
    #print "2",ok,vertical_size,vertical_bandwith
    
    #third filter: horizontal_angle_tolerance
    indices = np.where(ok)[0]
    if len(indices) == 0: #quick return
        return ok

    horizontal_limit = np.sqrt(ds[indices]+horizontal_size[indices]**2)
    horizontal_angle = np.arctan(dp_rotated[indices,0]/dp_rotated[indices,1])
    
    indices2 = np.where(np.logical_and(horizontal_limit <= max_horizontal_limit,np.abs(horizontal_angle) > np.radians(atol)))[0]
    ok[indices[indices2]] = False
    #report why
    for i in indices2:
        print "pair",k,indices[i],"was rejected by horizontal angle tolerance",np.degrees(horizontal_angle[i]),atol

    #print "3",ok,np.degrees(horizontal_angle),atol,horizontal_limit,max_horizontal_limit

    #forth filter: vertical_angle_tolerance
    indices = np.where(ok)[0]
    if len(indices) == 0: #quick return
        return ok
    vertical_limit = np.sqrt(ds[indices]+vertical_size[indices]**2)
    vectical_angle = np.arctan(dp_rotated[indices,2]/dp_rotated[indices,1])
    
    indices2 = np.where(np.logical_and(vertical_limit <= max_vertical_limit,np.abs(vectical_angle) > np.radians(dtol)))[0]
    #report why
    for i in indices2:
        print "pair",k,indices[i],"was rejected by vertical angle tolerance",np.degrees(vectical_angle[i]),dtol


    ok[indices[indices2]] = False
    print "4",ok,np.degrees(vectical_angle),dtol,max_vertical_limit,vertical_limit
    
    return ok
예제 #10
0
 def __init__(self,nugget=0.0):
     self.nugget = nugget
     self.structures = []
     self._default_rotmat = make_rotation_matrix([0.0,0.0,0.0])
     self._maxcov = None
예제 #11
0
 def __init__(self,structure_type,sill,ranges,angles=[0.0,0.0,0.0]):
     VariogramStructure.__init__(self,structure_type,sill,ranges,angles)
     self._rotmat = make_rotation_matrix(angles,self._ranges[1:]/self._ranges[0])
예제 #12
0
 def __init__(self,nugget=0.0):
     VariogramModel.__init__(self,nugget)
     self._default_rotmat = make_rotation_matrix([0.0,0.0,0.0])