def ignore_data(self, xmin=None, xmax=None, unit=None):
"""
Ignore the data points within range [xmin, xmax].
If xmin is None, then xmin=min(xdata);
if xmax is None, then xmax=max(xdata).
if unit is None, then assume the same unit as `self.xunit'.
"""
if unit is None:
unit = self.xunit
if xmin is not None:
xmin = self.convert_unit(xmin, unit=unit)
else:
xmin = np.min(self.xdata)
if xmax is not None:
xmax = self.convert_unit(xmax, unit=unit)
else:
xmax = np.max(self.xdata)
ignore_idx = np.logical_and(self.xdata >= xmin, self.xdata <= xmax)
self.mask[ignore_idx] = False
# reset `f_residual'
self.f_residual = None
评论列表
文章目录