Skip to content

Commit 873a4f0

Browse files
committed
Morph rgrid change
1 parent f231a7c commit 873a4f0

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

docs/source/morphpy.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,12 @@ funcy: tuple (function, dict)
193193
funcx: tuple (function, dict)
194194
Apply a function to the x-axis of the (two-column) data.
195195

196+
This morph works fundamentally differently from the other grid morphs
197+
(e.g. stretch and squeeze) as it directly modifies the grid of the
198+
morph function.
199+
The other morphs maintain the original grid and apply the morphs by interpolating
200+
the function ***.
201+
196202
This morph applies the function funcx[0] with parameters given in funcx[1].
197203
The function funcx[0] take in as parameters both the abscissa and ordinate
198204
(i.e. take in at least two inputs with as many additional parameters as needed).

src/diffpy/morph/morphs/morphrgrid.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ 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)
5958
r_step_target = (self.x_target_in[-1] - self.x_target_in[0]) / (
6059
len(self.x_target_in) - 1
6160
)
@@ -67,7 +66,6 @@ def morph(self, x_morph, y_morph, x_target, y_target):
6766
self.x_target_in[-1] + r_step_target,
6867
self.x_morph_in[-1] + r_step_morph,
6968
)
70-
print(rmininc, rmaxinc, rstepinc)
7169
if self.rmin is None or self.rmin < rmininc:
7270
self.rmin = rmininc
7371
if self.rmax is None or self.rmax > rmaxinc:
@@ -80,7 +78,6 @@ def morph(self, x_morph, y_morph, x_target, y_target):
8078
self.x_morph_out = numpy.arange(
8179
self.rmin, self.rmax - epsilon, self.rstep
8280
)
83-
print((self.rmax - self.rmin) / self.rstep, len(self.x_morph_out))
8481
self.y_morph_out = numpy.interp(
8582
self.x_morph_out, self.x_morph_in, self.y_morph_in
8683
)

0 commit comments

Comments
 (0)