1 from __future__
import division, absolute_import
7 __all__ = [
"instFromObs"]
10 """!Compute instrument position from observed coordinates
12 @param[in] targObs position of target in observed coordinates (a coordConv.PVTCoord)
13 @param[in] obj the object block; the following fields are read:
17 @param[in] taiDate TAI date at which to compute (MJD, sec)
20 - targInstXY: position of target in instrument coordinates (a tcc.base.ArrayPVT2) (deg)
21 i.e. a position in instrument X,Y relative to inst.iim_ctr, the center of the instrument
22 - targAzInstAng: angle of direction of increasing azimuth at target in instrument coordinates (a coordConv.PVT)
25 targBoreDist = obj.obsPos.angularSeparation(targObs)
26 boreToTargAzAng = obj.obsPos.orientationTo(targObs)
27 boreToTargInstAng = boreToTargAzAng + obj.objAzInstAng
28 if not boreToTargInstAng.isfinite()
and abs(targBoreDist.pos) < 1:
30 targObjXY = tcc.base.ArrayPVT2()
32 targObjXY[i] = obj.objInstXY[i].copy(taiDate)
33 return targObjXY, obj.objAzInstAng.copy(taiDate)
35 targObjXY = tcc.base.ArrayPVT2()
36 coordConv.xyFromPolar(targObjXY[0], targObjXY[1], targBoreDist, boreToTargInstAng, taiDate)
38 targInstXY = tcc.base.ArrayPVT2()
40 targInstXY[i] = targObjXY[i] + obj.objInstXY[i]
43 targToBoreAzAng = targObs.orientationTo(obj.obsPos)
44 targAzInstAng = coordConv.wrapCtr(boreToTargAzAng + 180.0 - targToBoreAzAng + obj.objAzInstAng)
45 return targInstXY, targAzInstAng
def instFromObs
Compute instrument position from observed coordinates.