Exemplo n.º 1
0
def test_J2000T0AltAz_2():
    class Test:
        tt = 2458849.50000
        ut1 = 0.5

    loc = Topos('42.3583 N', '71.0636 W')
    alt, az = transform.J2000ToAltAz(Angle(hours=12), Angle(degrees=45), Test(), loc)
    assert alt.degrees != 0
    assert az.degrees != 0
Exemplo n.º 2
0
def test_J2000T0AltAz_1():
    class Test:
        tt = 2458849.50000
        ut1 = 0.5

    loc = Topos('42.3583 N', '71.0636 W')
    alt, az = transform.J2000ToAltAz(180, 180, Test(), loc)
    assert alt.degrees == 0
    assert az.degrees == 0
Exemplo n.º 3
0
    def generateDSOPath(self,
                        ra=0,
                        dec=0,
                        timeJD=0,
                        location=None,
                        numberPoints=0,
                        duration=0,
                        timeShift=0):
        """
        generateDSOPath calculates a list of model points along the desired path beginning
        at ra, dec coordinates, which is in time duration hours long and consists of
        numberPoints model points. TimeShift moves the pearl of points to an earlier or
        later point in time.

        :param ra:
        :param dec:
        :param timeJD:
        :param location:
        :param numberPoints:
        :param duration:
        :param timeShift:
        :return: True for test purpose
        """

        if numberPoints < 1:
            return False
        if duration == 0:
            return False
        if location is None:
            return False

        numberPoints = int(numberPoints)

        self.clearBuildP()
        for i in range(0, numberPoints):
            startPoint = ra.hours - i * duration / numberPoints - timeShift
            raCalc = skyfield.api.Angle(hours=startPoint)
            az, alt = transform.J2000ToAltAz(raCalc, dec, timeJD, location)
            if alt.degrees > 0:
                self.addBuildP((alt.degrees, az.degrees % 360))

        return True