Skip to content

Commit

Permalink
update gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
yusuke-takase committed Sep 17, 2024
1 parent a8ad3ca commit 1e96046
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ crosslinks_2407.zip/
crosslinks_2407_3yr.zip/
notebooks/__pycache__/
.ipynb_checkpoints/
__pycache__/
Binary file modified sbm/__pycache__/sbm.cpython-310.pyc
Binary file not shown.
11 changes: 7 additions & 4 deletions sbm/sbm.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,10 @@ def map_make(self, signal_fields, mdim):
# noise = self.generate_noise(seed)
b = self.coupled_fields# + noise
A = self.get_covmat(mdim)
x = np.empty_like(b)
x = np.zeros_like(b)
for i in range(b.shape[1]):
x[:,i] = np.linalg.solve(A[:,:,i], b[:,i])
if np.linalg.det(A[:,:,i]) != 0.0:
x[:,i] = np.linalg.solve(A[:,:,i], b[:,i])
if mdim == 2:
# Note that:
# x[0] = Q + iU
Expand All @@ -538,9 +539,10 @@ def solve(self):
assert self.coupled_fields is not None, "Couple the fields first"
b = self.coupled_fields
A = self.get_covmat(self.mdim)
x = np.empty_like(b)
x = np.zeros_like(b)
for i in range(b.shape[1]):
x[:,i] = np.linalg.solve(A[:,:,i], b[:,i])
if np.linalg.det(A[:,:,i]) != 0.0:
x[:,i] = np.linalg.solve(A[:,:,i], b[:,i])
if self.mdim == 2:
output_map = np.array([np.zeros_like(x[0].real), x[0].real, x[0].imag])
if self.mdim == 3:
Expand Down Expand Up @@ -615,6 +617,7 @@ def generate_noise(self, mdim, seed=None):
n_u = np.random.normal(loc=0., scale=self.noise_pdf[1], size=[self.npix])
if mdim == 2:
noise = np.array([
np.zeros_like(n_i),
n_q * self.covmat_inv[0,0,:].real,
n_u * self.covmat_inv[0,0,:].real,
])
Expand Down

0 comments on commit 1e96046

Please sign in to comment.