Skip to content

Commit 73a70a5

Browse files
committed
mean estimator pixel_size pass-through
1 parent ce27fa3 commit 73a70a5

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/aspire/reconstruction/estimator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ def estimate(self, b_coef=None, x0=None, tol=1e-5, regularizer=0):
144144
b_coef = self.src_backward()
145145
est_coef = self.conj_grad(b_coef, x0=x0, tol=tol, regularizer=regularizer)
146146
est = Coef(self.basis, est_coef).evaluate()
147+
est.pixel_size = self.src.pixel_size
147148

148149
return est
149150

tests/test_mean_estimator.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def sim(L, dtype):
5656
],
5757
dtype=dtype,
5858
seed=SEED,
59+
pixel_size=1,
5960
)
6061

6162
sim = sim.cache() # precompute images
@@ -104,6 +105,9 @@ def test_estimate(sim, estimator, mask):
104105
est / np.linalg.norm(est), vol / np.linalg.norm(vol), atol=0.1
105106
)
106107

108+
# Check pixel_size pass-through
109+
np.testing.assert_array_equal(sim.pixel_size, estimate.pixel_size)
110+
107111

108112
def test_adjoint(sim, basis, estimator):
109113
"""

0 commit comments

Comments
 (0)