def __call__(self, sat_pos, args=(), **kwds):
"""
Return the definite integral of *self.fun*(pos, *args*[0],
..., *args*[-1]) for the line of site from *stn_pos* to
*sat_pos* (a :class:`PyPosition`) where pos is a
:class:`PyPosition` on the line of site (and note the
integration bounds on h defined in __init__). The remaining
*kwds* are passed to the quadrature routine (:py:func:`quad`).
"""
diff = NP.array(sat_pos.xyz) - NP.array(self.stn_pos.xyz)
S_los = NP.linalg.norm(diff) / 1e3
def pos(s):
"""
Return the ECEF vector a distance *s* along the line-of-site (in
[km]).
"""
return PyPosition(*(NP.array(self.stn_pos.xyz) + (s / S_los) * diff))
# determine integration bounds
# distance along of line of site at which the geodetic height
# is self.height1
s1 = minimize_scalar(lambda l: (pos(l).height / 1e3 - self.height1)**2,
bounds=[0, S_los],
method='Bounded').x
# distance along of line of site at which the geodetic height
# is self.height2
s2 = minimize_scalar(lambda l: (pos(l).height / 1e3 - self.height2)**2,
bounds=[0, S_los],
method='Bounded').x
def wrapper(s, *args):
return self.fun(pos(s), *args)
return quad(wrapper, s1, s2, args=args, **kwds)[0]
评论列表
文章目录