Example #1
0
 def rotation_ne_to_rt(self, in_channel_names, out_channel_names):
     
     angle = wrap(self.backazimuth + 180., -180., 180.)
     in_channels = [ self.get_channel(name) for name in in_channel_names ]
     out_channels = [
         Channel(out_channel_names[0], wrap(self.backazimuth+180., -180.,180.),  0., 1.),
         Channel(out_channel_names[1], wrap(self.backazimuth+270., -180.,180.),  0., 1.) ]
     return angle, in_channels, out_channels
Example #2
0
    def rotation_ne_to_rt(self, in_channel_names, out_channel_names):

        angle = wrap(self.backazimuth + 180., -180., 180.)
        in_channels = [self.get_channel(name) for name in in_channel_names]
        out_channels = [
            Channel(out_channel_names[0],
                    wrap(self.backazimuth + 180., -180., 180.), 0., 1.),
            Channel(out_channel_names[1],
                    wrap(self.backazimuth + 270., -180., 180.), 0., 1.)
        ]
        return angle, in_channels, out_channels
Example #3
0
    def guess_projections_to_rtu(self, out_channels=('R', 'T', 'U'), **kwargs):
        out_channels_ = [
            Channel(out_channels[0], wrap(self.backazimuth+180., -180.,180.),  0., 1.),
            Channel(out_channels[1], wrap(self.backazimuth+270., -180.,180.),  0., 1.),
            Channel(out_channels[2], 0.,  -90., 1.) ]
        
        proj = []
        for (m, in_channels, _) in self.guess_projections_to_enu( **kwargs ):
            phi = (self.backazimuth + 180.)*d2r
            r = num.array([[math.sin(phi),  math.cos(phi), 0.0],
                           [math.cos(phi), -math.sin(phi), 0.0],
                           [          0.0,            0.0, 1.0]])
            proj.append((num.dot(r,m), in_channels, out_channels_))

        return proj
Example #4
0
    def guess_projections_to_rtu(self,
                                 out_channels=('R', 'T', 'U'),
                                 backazimuth=None,
                                 **kwargs):
        if backazimuth is None:
            backazimuth = self.backazimuth
        out_channels_ = [
            Channel(out_channels[0], wrap(backazimuth + 180., -180., 180.), 0.,
                    1.),
            Channel(out_channels[1], wrap(backazimuth + 270., -180., 180.), 0.,
                    1.),
            Channel(out_channels[2], 0., -90., 1.)
        ]

        proj = []
        for (m, in_channels, _) in self.guess_projections_to_enu(**kwargs):
            phi = (backazimuth + 180.) * d2r
            r = num.array([[math.sin(phi), math.cos(phi), 0.0],
                           [math.cos(phi), -math.sin(phi), 0.0],
                           [0.0, 0.0, 1.0]])
            proj.append((num.dot(r, m), in_channels, out_channels_))

        return proj
Example #5
0
 def test_wrap(self):
     assert orthodrome.wrap(11, -10, 10) == -9
     assert orthodrome.wrap(10, -10, 10) == -10
     assert orthodrome.wrap(10.001, -10, 10) == -9.999
 def test_wrap(self):
     assert orthodrome.wrap(11, -10, 10) == -9
     assert orthodrome.wrap(10, -10, 10) == -10
     assert orthodrome.wrap(10.001, -10, 10) == -9.999