gavo.stc.spherc module

Spherical sky coordinates and helpers.

gavo.stc.spherc.cross(vec1, vec2)[source]

returns the cross product of two 3-vectors.

This should really be somewhere else…

gavo.stc.spherc.fk4ToFK5(sixTrans, svfk4)[source]

returns an FK5 2000 6-vector for an FK4 1950 6-vector.

The procedure used is described in Yallop et al, AJ 97, 274. E-terms of aberration are always removed from proper motions, regardless of whether the objects are within 10 deg of the pole.

gavo.stc.spherc.fk5ToFK4(sixTrans, svfk5)[source]

returns an FK4 1950 6-vector for an FK5 2000 6-vector.

This is basically a reversal of fk4ToFK5, except we’re always operating in slaComp mode here.

gavo.stc.spherc.fk5ToICRS(sixTrans, svFk5)[source]

returns a 6-vector in ICRS for a 6-vector in FK5 J2000.

gavo.stc.spherc.getPrecMatrix(fromEquinox, toEquinox, precTheory)[source]

returns a precession matrix in the IAU(1976) system.

fromEquinox and toEquinox are datetimes (in case of doubt, TT).

precTheory(fromEquinox, toEquinox) -> zeta, z, theta computes the precession angles. Defined in this module are prec_IAU1976 and prec_Newcomb, but you can provide your own. The angles must all be in rad.

gavo.stc.spherc.getTrafoFunction(srcTriple, dstTriple, sixTrans)[source]

returns a function that transforms 6-vectors from the system described by srcTriple to the one described by dstTriple.

The triples consist of (system, equinox, refpoint).

If no transformation function can be produced, the function raises an STCValueError.

sixTrans is a sphermath.SVConverter instance, used here for communication of input details and user preferences.

gavo.stc.spherc.icrsToFK5(sixTrans, svICRS)[source]

returns a 6-vector in FK5 J2000 for an ICRS 6-vector.

gavo.stc.spherc.nullTransform(sv, sixTrans)[source]
gavo.stc.spherc.prec_IAU1976(fromEquinox, toEquinox)[source]

returns the precession angles in the IAU 1976 system.

The expressions are those of Lieske, A&A 73, 282.

This function is for the precTheory argument of getPrecMatrix.

gavo.stc.spherc.prec_Newcomb(fromEquinox, toEquinox)[source]

returns the precession angles for the newcomp

This function is for the precTheory argument of getPrecMatrix.

The expressions are Kinoshita’s (1975)’s (SAOSR 364) This is somewhat at odds with Yallop’s choice of Andoyer in the FK4-FK5 machinery below, but that really shouldn’t matter.

gavo.stc.spherc.threeToSix(matrix)[source]

returns a 6-matrix from a 3-matrix suitable for precessing our 6-vectors.

gavo.stc.spherc.tupleMax(t1, t2)[source]

returns the element-wise maximum of two tuples:

gavo.stc.spherc.tupleMin(t1, t2)[source]

returns the element-wise minimum of two tuples: