Commit 8b8f89f2 authored by Maximilian Schanner's avatar Maximilian Schanner
Browse files

Number of points for better resolution

parent 2a695ecb
......@@ -64,7 +64,7 @@ def xyz2rpt(x, y, z):
def intensity(posterior, mu_dips, cov_dips, r_ref, r_at=REARTH,
n_samps=10000, n_points=1001,
n_samps=50000, n_points=1001,
ret_samps=False):
""" Calculate the pdf of the dipole intensity, by sampling and
kde-smoothing.
......@@ -115,7 +115,7 @@ def intensity(posterior, mu_dips, cov_dips, r_ref, r_at=REARTH,
return points, pdf
def location(posterior, mu_dips, cov_dips, n_points=1000,
def location(posterior, mu_dips, cov_dips, n_points=10000,
bounds=[[0., np.deg2rad(30)], [0, 2*np.pi]]):
""" From the posterior and corresponding dipole coefficients, calculate
the pdf of the dipole location
......@@ -128,7 +128,7 @@ def location(posterior, mu_dips, cov_dips, n_points=1000,
The dipole coefficients from the integration
cov_coeffs : array-like of shape (N, 3, 3)
The corresponding covariance matrices
n_points : int (optional, default is 1000)
n_points : int (optional, default is 10000)
The (approximate) number of gridpoints to evaluate the location on
bounds : 2x2 array-like (optional,
default is [[0., np.deg2rad(30)],
......@@ -287,7 +287,7 @@ def coeffs(posterior, mu_coeffs, cov_coeffs, r_ref, r_at=REARTH):
gm_weights = posterior / posterior.sum()
ens = sample_GM(gm_weights.flatten(), mu_coeffs, cov_coeffs,
n_samps=10000)
n_samps=50000)
err_16, err_84 = np.percentile(ens, (16, 84), axis=1)
mean = (mu_coeffs.T * gm_weights.flatten()).sum(axis=1)
......@@ -339,7 +339,7 @@ def spectrum(posterior, mu_coeffs, cov_coeffs, r_ref, r_at=REARTH):
gm_weights = posterior / posterior.sum()
ens = sample_GM(gm_weights.flatten(), mu_coeffs, cov_coeffs,
n_samps=10000)
n_samps=50000)
# 1st two moments of mixture
mean = np.sum(mu_coeffs * gm_weights.flatten()[:, None], axis=0)
......
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