Ejemplo n.º 1
0
def test_JNowToJ2000_1():
    class Test:
        tt = 2458687
        ut1 = 1

    ra, dec = transform.JNowToJ2000(180, 180, Test())
    assert ra.hours == 0
    assert dec.degrees == 0
Ejemplo n.º 2
0
def test_JNowToJ2000_2():
    class Test:
        tt = 2458687
        ut1 = 1

    ra, dec = transform.JNowToJ2000(Angle(hours=12), Angle(degrees=180), Test())
    assert ra.hours != 0
    assert dec.degrees != 0
Ejemplo n.º 3
0
    def updatePointGUI(self, obs):
        """
        updatePointGUI update the gui upon events triggered be the reception of new data
        from the mount. the mount data is polled, so we use this signal as well for the
        update process.

        :param obs:
        :return:    True if ok for testing
        """

        if obs.Alt is not None:
            self.ui.ALT.setText('{0:5.2f}'.format(obs.Alt.degrees))
        else:
            self.ui.ALT.setText('-')

        if obs.Az is not None:
            self.ui.AZ.setText('{0:5.2f}'.format(obs.Az.degrees))
        else:
            self.ui.AZ.setText('-')

        ra = obs.raJNow
        dec = obs.decJNow
        if self.ui.checkJ2000.isChecked():
            if ra is not None and dec is not None and obs.timeJD is not None:
                ra, dec = transform.JNowToJ2000(ra, dec, obs.timeJD)

        if ra is not None:
            raFormat = '{0:02.0f}:{1:02.0f}:{2:02.0f}'
            val = ra.hms()
            raText = raFormat.format(*val)
            self.ui.RA.setText(raText)
            self.ui.RAfloat.setText(f'{ra.hours:3.4f}')
        else:
            self.ui.RA.setText('-')
            self.ui.RAfloat.setText('-')

        if dec is not None:
            decFormat = '{sign}{0:02.0f}:{1:02.0f}:{2:02.0f}'
            val = dec.signed_dms()[1:4]
            decText = decFormat.format(*val, sign='+' if dec.degrees > 0 else '-')
            self.ui.DEC.setText(decText)
            self.ui.DECfloat.setText(f'{dec.degrees:+3.4f}')
        else:
            self.ui.DEC.setText('-')
            self.ui.DECfloat.setText('-')

        if obs.pierside is not None:
            self.ui.pierside.setText('WEST' if obs.pierside == 'W' else 'EAST')
        else:
            self.ui.pierside.setText('-')

        if obs.haJNow is not None:
            haFormat = '{0:02.0f}:{1:02.0f}:{2:02.0f}'
            val = obs.haJNow.hms()
            haText = haFormat.format(*val)
            self.ui.HA.setText(haText)
            self.ui.HAfloat.setText(f'{obs.haJNow.hours:3.4f}')
        else:
            self.ui.HA.setText('-')
            self.ui.HAfloat.setText('-')

        return True