Skip to content

Commit 556ec57

Browse files
committed
Move epsilon
1 parent 077b09c commit 556ec57

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/diffpy/morph/morphs/morphrgrid.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def morph(self, x_morph, y_morph, x_target, y_target):
5555
"""Resample arrays onto specified grid."""
5656
Morph.morph(self, x_morph, y_morph, x_target, y_target)
5757
rmininc = max(self.x_target_in[0], self.x_morph_in[0])
58+
print(self.x_morph_out)
5859
r_step_target = (self.x_target_in[-1] - self.x_target_in[0]) / (
5960
len(self.x_target_in) - 1
6061
)
@@ -66,6 +67,7 @@ def morph(self, x_morph, y_morph, x_target, y_target):
6667
self.x_target_in[-1] + r_step_target,
6768
self.x_morph_in[-1] + r_step_morph,
6869
)
70+
print(rmininc, rmaxinc, rstepinc)
6971
if self.rmin is None or self.rmin < rmininc:
7072
self.rmin = rmininc
7173
if self.rmax is None or self.rmax > rmaxinc:
@@ -78,6 +80,7 @@ def morph(self, x_morph, y_morph, x_target, y_target):
7880
self.x_morph_out = numpy.arange(
7981
self.rmin, self.rmax - epsilon, self.rstep
8082
)
83+
print((self.rmax - self.rmin) / self.rstep, len(self.x_morph_out))
8184
self.y_morph_out = numpy.interp(
8285
self.x_morph_out, self.x_morph_in, self.y_morph_in
8386
)

src/diffpy/morph/refine.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ def _residual(self, pvals):
100100
diff_length = len(rvec) - self.res_length
101101
rvec = list(rvec)
102102
for _ in range(diff_length):
103+
# Remove the largest residuals since the larger overlapping
104+
# grid means we are likely closer to the target
103105
rvec.pop(max(rvec))
104106
rvec = array(rvec)
105107

0 commit comments

Comments
 (0)