Exemplo n.º 1
0
    def test_multiple_rakes(self):
        strike, dip, rake = np.array(self.data).T

        lon, lat = smath.rake(strike, dip, rake)
        plunge, bearing = smath.geographic2plunge_bearing(lon, lat)
        newrake = smath.project_onto_plane(strike, dip, plunge, bearing)
        assert np.allclose(rake, newrake)
Exemplo n.º 2
0
    def test_multiple_rakes(self):
        strike, dip, rake = np.array(self.data).T

        lon, lat = smath.rake(strike, dip, rake)
        plunge, bearing = smath.geographic2plunge_bearing(lon, lat)
        newrake = smath.project_onto_plane(strike, dip, plunge, bearing)
        assert np.allclose(rake, newrake)
Exemplo n.º 3
0
    def test_offset_back_to_rake(self):
        for strike, dip, rake in self.data:
            # Displace the line perpendicular to the plane...
            line = smath.sph2cart(*smath.rake(strike, dip, rake))
            norm = smath.sph2cart(*smath.pole(strike, dip))
            line = np.array(line) + 0.5 * np.array(norm)

            # Project the "displaced" line back onto the plane...
            lon, lat = smath.cart2sph(*line)
            plunge, bearing = smath.geographic2plunge_bearing(lon, lat)
            newrake = smath.project_onto_plane(strike, dip, plunge, bearing)
            assert np.allclose(rake, newrake)
Exemplo n.º 4
0
    def test_offset_back_to_rake(self):
        for strike, dip, rake in self.data:
            # Displace the line perpendicular to the plane...
            line = smath.sph2cart(*smath.rake(strike, dip, rake))
            norm = smath.sph2cart(*smath.pole(strike, dip))
            line = np.array(line) + 0.5 * np.array(norm)

            # Project the "displaced" line back onto the plane...
            lon, lat = smath.cart2sph(*line)
            plunge, bearing = smath.geographic2plunge_bearing(lon, lat)
            newrake = smath.project_onto_plane(strike, dip, plunge, bearing)
            assert np.allclose(rake, newrake)
Exemplo n.º 5
0
 def test_rake_back_to_rakes(self):
     for strike, dip, rake in self.data:
         lon, lat = smath.rake(strike, dip, rake)
         plunge, bearing = smath.geographic2plunge_bearing(lon, lat)
         newrake = smath.project_onto_plane(strike, dip, plunge, bearing)
         assert np.allclose(rake, newrake)
Exemplo n.º 6
0
 def test_rake_back_to_rakes(self):
     for strike, dip, rake in self.data:
         lon, lat = smath.rake(strike, dip, rake)
         plunge, bearing = smath.geographic2plunge_bearing(lon, lat)
         newrake = smath.project_onto_plane(strike, dip, plunge, bearing)
         assert np.allclose(rake, newrake)