示例#1
0
def unittests():
    GCUT.info('gc tithi')
    e = GCEarthData.EARTHDATA()
    e.longitude_deg = 27.0
    e.latitude_deg = 45.0
    e.tzone = 1.0
    vc = Today()
    vc2 = GCGregorianDate()
    vc3 = GCGregorianDate(date=vc)
    vc3.NextDay()

    if False:
        import io
        s = io.StringIO()
        clr = GCLocation.GCLocation()
        writeXml(s, clr, vc)
        GCUT.msg(s.getvalue())
        s.seek(0)
        writeGaurabdaTithiXml(s, clr, GCGaurabdaDate(2, 1, 512),
                              GCGaurabdaDate(20, 1, 514))
        GCUT.msg('writeGaurabdaTithiXml')
        GCUT.msg(s.getvalue())

        s = io.StringIO()
        writeGaurabdaNextTithiXml(s, clr, vc, GCGaurabdaDate(2, 1, 512))
        GCUT.msg('writeGaurabdaNextTithiXml')
        GCUT.msg(s.getvalue())

    print(GetTithiTimes(e, vc, 0.25))
def unittests():
    GCUT.info('daydata')
    e = GCEarthData.EARTHDATA()
    e.longitude_deg = 27.0
    e.latitude_deg = 45.0
    e.tzone = 1.0
    GCUT.msg('First day in year: ' + str(GetFirstDayOfYear(e, 2020)))
示例#3
0
 def GetEarthData(self):
     e = GCEarthData.EARTHDATA()
     e.dst = self.m_nTimezoneId
     e.latitude_deg = self.m_fLatitude
     e.longitude_deg = self.m_fLongitude
     e.tzone = self.m_fTimezone
     return e
def unittests():
    GCUT.info('yoga')
    e = GCEarthData.EARTHDATA()
    e.longitude_deg = 27.0
    e.latitude_deg = 45.0
    e.tzone = 1.0
    vc = Today()
    vc2 = GCGregorianDate()
    GetNextYogaStart(e, vc, vc2)
    print('Next yoga:', repr(vc2))
def unittests():
    GCUT.info('sundata')
    r1, r2 = CalculateKala(0.25, 0.75, 0, KalaType.KT_ABHIJIT)
    GCUT.msg('abhijit on sunday {} {}'.format(r1, r2))
    s = SUNDATA()
    e = GCEarthData.EARTHDATA()
    e.longitude_deg = 27.0
    e.latitude_deg = 45.0
    e.tzone = 1.0
    vc = GCGregorianDate.Today()
    s.SunCalc(vc, e)
    GCUT.msg(str(repr(s)))
def unittests():
    GCUT.info('moon data')
    ed = GCEarthData.EARTHDATA()
    ed.longitude_deg = 20.0
    ed.latitude_deg = 45.0
    ed.tzone = 1.0
    vc = GCGregorianDate.GCGregorianDate(2000, 1, 1, 0.5)
    GCUT.msg('Moon distance: ' + str(MoonDistance(vc.GetJulianComplete())))
    nd = GetNextRise(ed, vc, True)
    GCUT.msg('Next rise: ' + repr(nd))
    nd = GetNextRise(ed, vc, False)
    GCUT.msg('Next set: ' + repr(nd))
    a, b = GetNextMoonRasi(ed, vc)
    GCUT.msg('next moon rasi: {} {}'.format(a, b))
    a, b = CalcMoonTimes(ed, vc, 1.0)
    GCUT.msg('moon times: {} {}'.format(repr(a), repr(b)))
def unittests():
    GCUT.info('conjunctions')
    b = IsConjunction(10, 11, 12, 20)
    GCUT.val(b, True, 'is conjunction')

    e = GCEarthData.EARTHDATA()
    e.longitude_deg = 27.0
    e.latitude_deg = 45.0
    e.tzone = 1.0
    vc = Today()
    vc2 = GCGregorianDate(date=vc)
    vc3 = GCGregorianDate(date=vc)

    l = GetPrevConjunction(vc2, e)
    GCUT.msg('Conjunction on: {}'.format(repr(vc2)))
    vc2.Set(vc)
    l = GetNextConjunctionEx(vc2, vc3, True, e)
    GCUT.msg('Conjunction on: {}'.format(repr(vc3)))