def __init__(self, directory, filename="heterogeneity"): """ __init__(self, directory, filename="heterogeneity") """ #- Initialise directory from which to read and filename to write. ------------------------- self.directory = directory self.filename = filename #- Read drho from the "directory" and turn it into a zero model. -------------------------- self.d = m.ses3d_model() self.d.read(self.directory, "drho", "false") for k in range(self.d.nsubvol): self.d.m[k].v[:, :, :] = 0.0
def __init__(self, directory, filename="heterogeneity"): """ __init__(self, directory, filename="heterogeneity") """ #- Initialise directory from which to read and filename to write. ------------------------- self.directory = directory self.filename = filename #- Read drho from the "directory" and turn it into a zero model. -------------------------- self.d = m.ses3d_model() self.d.read(self.directory,"drho","false") for k in range(self.d.nsubvol): self.d.m[k].v[:,:,:] = 0.0
# List of events for which kernels are available. eventlist = [ "GCMT_event_NORTHERN_ITALY_Mag_4.9_2000-8-21-17", "GCMT_event_NORTHWESTERN_BALKAN_REGION_Mag_5.9_1980-5-18-20"] # Smoothing iterations. sigma = 3.0 # Test step lengths. gamma = [0.15, 0.5, 1.0] # Read current model. --------------------------------------------------------- print "read current model from directory " + dir_current_model csv = m.ses3d_model() csh = m.ses3d_model() rho = m.ses3d_model() cp = m.ses3d_model() csv.read(dir_current_model, 'dvsv') csh.read(dir_current_model, 'dvsh') rho.read(dir_current_model, 'drho') cp.read(dir_current_model, 'dvp') # Read gradients of the current iteration. ------------------------------------ # Initialisation. grad_csv = m.ses3d_model() grad_csh = m.ses3d_model() grad_rho = m.ses3d_model() grad_cp = m.ses3d_model()