def __init__(self, Z_map, extrapolate0=False):
"""
Construct a cubic-spline 3-D E-M transfer function interpolater
using the information in *Z_map* returned from
:func:`parse_xml` as the function samples. If *extrapolate0*,
then 0s are inserted in the transfer function response where
extrapolation would occur (this happens when transfer function
response is requested at frequencies outside the range
provided in the .XML file record).
"""
self.Z_map = Z_map
periods = Z_map.keys()
self.f = NP.array([1/x for x in periods[::-1]])
self.omega = 2 * math.pi * self.f
self.Zxx_interp = CubicSpline(self.omega, [x[0, 0] for x in Z_map.values()[::-1]],
extrapolate=False)
self.Zxy_interp = CubicSpline(self.omega, [x[0, 1] for x in Z_map.values()[::-1]],
extrapolate=False)
self.Zyx_interp = CubicSpline(self.omega, [x[1, 0] for x in Z_map.values()[::-1]],
extrapolate=False)
self.Zyy_interp = CubicSpline(self.omega, [x[1, 1] for x in Z_map.values()[::-1]],
extrapolate=False)
self.key_map = {'xx': self.Zxx_interp,
'xy': self.Zxy_interp,
'yx': self.Zyx_interp,
'yy': self.Zyy_interp}
self.extrapolate0 = extrapolate0
评论列表
文章目录