Пример #1
0
    def __init__(self, ra0_deg, dec0_deg):
        self.ra0_deg = ra0_deg
        self.dec0_deg = dec0_deg

        #Construct rotation matrix used to convert ra/dec into
        #angle relative to tangent point
        Rdec = rotate.declinationRotationMatrix(-self.dec0_deg)
        Rra = rotate.rightAscensionRotationMatrix(-self.ra0_deg)
        self.Rmatrix = np.dot(Rdec, Rra)

        #Check I created the matrix correctly.
        origin = rotate.vecFromRaDec(self.ra0_deg, self.dec0_deg)
        origin = np.dot(self.Rmatrix, origin)
        assert (np.fabs(origin[0] - 1) < 1e-9)
        assert (np.fabs(origin[1]) < 1e-9)
        assert (np.fabs(origin[2]) < 1e-9)
Пример #2
0
    def __init__(self, ra0_deg, dec0_deg):
        self.ra0_deg = ra0_deg
        self.dec0_deg = dec0_deg

        #Construct rotation matrix used to convert ra/dec into
        #angle relative to tangent point
        Rdec = rotate.declinationRotationMatrix(-self.dec0_deg)
        Rra = rotate.rightAscensionRotationMatrix(-self.ra0_deg)
        self.Rmatrix = np.dot(Rdec, Rra)


        #Check I created the matrix correctly.
        origin = rotate.vecFromRaDec(self.ra0_deg, self.dec0_deg)
        origin = np.dot(self.Rmatrix, origin)
        assert( np.fabs(origin[0] -1 ) < 1e-9)
        assert( np.fabs(origin[1]) < 1e-9)
        assert( np.fabs(origin[2]) < 1e-9)
Пример #3
0
    def __init__(self, ra0_deg, dec0_deg):
        Projection.__init__(self)
        self.ra0_deg = ra0_deg
        self.dec0_deg = dec0_deg

        self.ra0_deg = ra0_deg
        self.dec0_deg = dec0_deg

        #This projection assumes ra ranges from -180 to +180
        #if self.ra0_deg > 180:
            #self.ra0_deg -= 360

        #Construct rotation matrix used to convert ra/dec into
        #angle relative to tangent point
        Rdec = rotate.declinationRotationMatrix(-self.dec0_deg)
        Rra = rotate.rightAscensionRotationMatrix(-self.ra0_deg)
        self.Rmatrix = np.dot(Rra, Rdec)
Пример #4
0
    def __init__(self, ra0_deg, dec0_deg):
        Projection.__init__(self)
        self.ra0_deg = ra0_deg
        self.dec0_deg = dec0_deg

        self.ra0_deg = ra0_deg
        self.dec0_deg = dec0_deg

        #This projection assumes ra ranges from -180 to +180
        #if self.ra0_deg > 180:
        #self.ra0_deg -= 360

        #Construct rotation matrix used to convert ra/dec into
        #angle relative to tangent point
        Rdec = rotate.declinationRotationMatrix(-self.dec0_deg)
        Rra = rotate.rightAscensionRotationMatrix(-self.ra0_deg)
        self.Rmatrix = np.dot(Rra, Rdec)
Пример #5
0
    def getPointing(self, ra_deg, dec_deg, roll_deg, cartesian=False):
        """Compute a pointing model without changing the internal object pointing"""

        #Roll FOV
        Rrotate = r.rotateAboutVectorMatrix([1,0,0], roll_deg)  #Roll

        #Slew to ra/dec of zero
        Ra = r.rightAscensionRotationMatrix(ra_deg)
        Rd = r.declinationRotationMatrix(dec_deg)
        Rslew = np.dot(Ra, Rd)

        R = np.dot(Rslew, Rrotate)


        slew = self.origin*1
        for i, row in enumerate(self.origin):
            slew[i, 3:6] = np.dot(R, row[3:6])


        if cartesian is False:
            slew = self.getRaDecs(slew)
        return slew