def _get_knot_spacing(self):
"""Returns a list of knot locations based on the spline parameters
If the option `spacing` is 'lin', uses linear spacing
'log', uses log spacing
Places 'spline_N' knots between 'spline_min' and 'spline_max'
"""
space_key = self.get_option('spacing').lower()[:3]
if space_key == 'log':
vol = np.logspace(np.log10(self.get_option('spline_min')),
np.log10(self.get_option('spline_max')),
self.get_option('spline_N'))
elif space_key == 'lin':
vol = np.linspace(self.get_option('spline_min'),
self.get_option('spline_max'),
self.get_option('spline_N'))
else:
raise KeyError("{:} only `lin`ear and `log` spacing are"
"accepted".format(self.get_inform(1)))
# end
return vol
评论列表
文章目录