Commit a5bf3bfd authored by Theo Steininger's avatar Theo Steininger
Browse files

Fixed EnsembleLikelihood

parent 24ff68bf
...@@ -49,7 +49,7 @@ class EnsembleLikelihood(Likelihood): ...@@ -49,7 +49,7 @@ class EnsembleLikelihood(Likelihood):
# compute quantities for OAS estimator # compute quantities for OAS estimator
mu = np.vdot(u_val, u_val)/n mu = np.vdot(u_val, u_val)/n
alpha = (np.einsum(u_val, [0, 1], u_val, [2, 0])**2).sum() alpha = (np.einsum(u_val, [0, 1], u_val, [2, 1])**2).sum()
numerator = alpha + mu**2 numerator = alpha + mu**2
denominator = (k + 1) / (alpha - (mu**2)/n) denominator = (k + 1) / (alpha - (mu**2)/n)
......
...@@ -27,7 +27,7 @@ class Observable(Field): ...@@ -27,7 +27,7 @@ class Observable(Field):
return self._ensemble_mean return self._ensemble_mean
def _to_hdf5(self, hdf5_group): def _to_hdf5(self, hdf5_group):
if hasattr(self, _ensemble_mean): if hasattr(self, '_ensemble_mean'):
return_dict = {'ensemble_mean': self._ensemble_mean} return_dict = {'ensemble_mean': self._ensemble_mean}
else: else:
return_dict = {} return_dict = {}
......
...@@ -35,7 +35,7 @@ class Hammurapy(Observer): ...@@ -35,7 +35,7 @@ class Hammurapy(Observer):
self.basic_parameters = {'B_ran_mem_lim': '6', self.basic_parameters = {'B_ran_mem_lim': '6',
'obs_shell_index_numb': '1', 'obs_shell_index_numb': '1',
'total_shell_numb': '3', 'total_shell_numb': '1',
'vec_size_R': '500', 'vec_size_R': '500',
'max_radius': '30', 'max_radius': '30',
'max_z': '15', 'max_z': '15',
...@@ -76,6 +76,7 @@ class Hammurapy(Observer): ...@@ -76,6 +76,7 @@ class Hammurapy(Observer):
errlog = temp_process.communicate()[1] errlog = temp_process.communicate()[1]
# check if there were some errors # check if there were some errors
if errlog == '': if errlog == '':
self.logger.debug("Successfully removed temporary folder.")
break break
else: else:
self.logger.warning('Could not delete %s' % path) self.logger.warning('Could not delete %s' % path)
...@@ -169,7 +170,7 @@ class Hammurapy(Observer): ...@@ -169,7 +170,7 @@ class Hammurapy(Observer):
parameter_dict = self.basic_parameters.copy() parameter_dict = self.basic_parameters.copy()
# set the parameters for a numerical run # set the parameters for a numerical run
parameter_dict['B_field_interp'] = 'F' parameter_dict['B_field_interp'] = 'T'
parameter_dict['use_B_analytic'] = 'F' parameter_dict['use_B_analytic'] = 'F'
self._build_parameter_dict( self._build_parameter_dict(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment