Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rular099 committed Jun 29, 2020
1 parent 77c450f commit 6c64b28
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions geoist/inversion/pfmodel_ts.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ def load_data(self,pattern='*.txt',names=['lon','lat','g'],**kwargs):
self.orig_data['z'] = 0.0

def set_refer(self,refer_density):
self.constraints['refer'] = np.ones(self.nx*self.ny*self.ns)
self.refer_density = refer_density

def deg2xy(self):
Expand Down Expand Up @@ -450,9 +449,11 @@ def calc_log_prior_total_det(self,precision=1.0e-6):
return self.calc_log_prior_total_det_quiet(precision)

def calc_log_obs_det_quiet(self):
self.log_obs_det_val = np.log(self._weights['obs'])*len(self.orig_data)
self.log_obs_det_val = (self.nx*self.ny*self.ns*np.log(self.weights['refer'])
+np.log(self._weights['obs'])*len(self.orig_data))
if 'refer' in self._weights.keys():
self.log_obs_det_val = (self.nx*self.ny*self.ns*np.log(self.weights['refer'])
+np.log(self._weights['obs'])*len(self.orig_data))
else:
self.log_obs_det_val = np.log(self._weights['obs'])*len(self.orig_data)
return self.log_obs_det_val

@timeit
Expand Down

0 comments on commit 6c64b28

Please sign in to comment.