def test_recip(self): data = np.zeros((100, 100)) vmodel = np.zeros((100, 100)) data[0:50, :] += 100.0 data[50:, :] += 200.0 vmodel[0:50, :] += 1500.0 vmodel[50:, :] += 1800.0 dt = 0.001 dz = 1. out1 = depth_to_time(data, vmodel, dz, dt) v2 = depth_to_time(vmodel, vmodel, dz, dt) out2 = time_to_depth(out1, v2, dt, dz)
def test_timetodepth(self): data = np.zeros((100, 100)) vmodel = np.zeros((100, 100)) data[0:50, :] += 100.0 data[50:, :] += 200.0 vmodel[0:50, :] += 1500.0 vmodel[50:, :] += 5000.0 dt = 0.001 dz = 1.0 output = time_to_depth(data, vmodel, dt, dz, twt=False) face_change = np.floor(((49.5 * dt) * 1500.0) / dz) self.assertTrue((output[face_change + 1, 50] - output[face_change, 50]) == 100)
def test_timetodepth(self): data = np.zeros((100, 100)) vmodel = np.zeros((100, 100)) data[0:50, :] += 100.0 data[50:, :] += 200.0 vmodel[0:50, :] += 1500.0 vmodel[50:, :] += 5000.0 dt = 0.001 dz = 1.0 output = time_to_depth(data, vmodel, dt, dz, twt=False) face_change = int(np.floor(((49.5 * dt) * 1500.0) / dz)) self.assertTrue((output[face_change + 1, 50] - output[face_change, 50]) == 100)
def to_depth(self, v, dz=0.001): """ Convert Scan to depth domain. Args: v (ndarray): Interval velocities. Must be same shape as model. If None, then the model's own permittivities are used. dz (float): The new depth step or sampling interval, in m. Returns: Model. The depth-converted model, as a jeepr.Model instance. """ if self.domain != 'time': raise ScanError('You can only depth-convert a time scan.') params = copy.deepcopy(self.__dict__) arr = time_to_depth(self, v, dz=dz, dt=self.dt) basis = utils.srange(0, dz, arr.shape[0]) params['domain'] = 'depth' params['dz'] = dz params['dt'] = 0 return Scan(arr, params), basis