Exemple #1
0
    def assign_mahodaya_ardhodaya(self):
        for d, daily_panchaanga in enumerate(self.daily_panchaangas):

            # MAHODAYAM
            # Can also refer youtube video https://youtu.be/0DBIwb7iaLE?list=PL_H2LUtMCKPjh63PRk5FA3zdoEhtBjhzj&t=6747
            # 4th pada of vyatipatam, 1st pada of Amavasya, 2nd pada of Shravana, Suryodaya, Bhanuvasara = Ardhodayam
            # 4th pada of vyatipatam, 1st pada of Amavasya, 2nd pada of Shravana, Suryodaya, Somavasara = Mahodayam
            sunrise_zodiac = NakshatraDivision(
                daily_panchaanga.jd_sunrise,
                ayanaamsha_id=self.computation_system.ayanaamsha_id)
            sunset_zodiac = NakshatraDivision(
                daily_panchaanga.jd_sunset,
                ayanaamsha_id=self.computation_system.ayanaamsha_id)
            if daily_panchaanga.lunar_month_sunrise.index in [
                    10, 11
            ] and daily_panchaanga.sunrise_day_angas.tithi_at_sunrise.index == 30 or tithi.get_tithi(
                    daily_panchaanga.jd_sunrise).index == 30:
                if sunrise_zodiac.get_anga(zodiac.AngaType.NAKSHATRA).index == 17 or \
                    sunset_zodiac.get_anga(zodiac.AngaType.NAKSHATRA).index == 17 and \
                    sunrise_zodiac.get_anga(zodiac.AngaType.NAKSHATRA).index == 22 or \
                    sunset_zodiac.get_anga(zodiac.AngaType.NAKSHATRA).index == 22:
                    if daily_panchaanga.date.get_weekday() == 1:
                        festival_name = 'mahOdaya-puNyakAlaH'
                        self.panchaanga.add_festival(
                            fest_id=festival_name,
                            date=self.daily_panchaangas[d].date)
                        # logging.debug('* %d-%02d-%02d> %s!' % (y, m, dt, festival_name))
                    elif daily_panchaanga.date.get_weekday() == 0:
                        festival_name = 'ardhOdaya-puNyakAlaH'
                        self.panchaanga.add_festival(
                            fest_id=festival_name,
                            date=self.daily_panchaangas[d].date)
Exemple #2
0
def test_get_anga():

  nd = NakshatraDivision(jd=time.ist_timezone.local_time_to_julian_day(Date(2018, 7, 14)), ayanaamsha_id=Ayanamsha.CHITRA_AT_180)
  assert nd.get_anga(
    anga_type=AngaType.TITHI).index == 1

  nd = NakshatraDivision(jd=time.ist_timezone.local_time_to_julian_day(Date(2018, 7, 14, 6, 1)), ayanaamsha_id=Ayanamsha.CHITRA_AT_180)
  assert nd.get_anga(
    anga_type=AngaType.TITHI).index == 2

  nd = NakshatraDivision(jd=time.ist_timezone.local_time_to_julian_day(Date(2018, 7, 13)), ayanaamsha_id=Ayanamsha.CHITRA_AT_180)
  assert nd.get_anga(
    anga_type=AngaType.TITHI).index == 30
  assert nd.get_anga(
    anga_type=AngaType.SIDEREAL_MONTH).index == 3

  # Just before meSha sankrAnti
  assert NakshatraDivision(jd=time.ist_timezone.local_time_to_julian_day(Date(2018, 4, 13)), ayanaamsha_id=Ayanamsha.CHITRA_AT_180).get_anga(
    anga_type=AngaType.SIDEREAL_MONTH).index == 12


  # 5:6:0.00 UT on December 23, 1981
  nd = NakshatraDivision(2444961.7125, ayanaamsha_id=Ayanamsha.CHITRA_AT_180)
  assert nd.get_anga(AngaType.NAKSHATRA).index == 16
  assert nd.get_anga(AngaType.TITHI).index == 28
  assert nd.get_anga(AngaType.YOGA).index == 8
  assert nd.get_anga(AngaType.KARANA).index == 55
  assert nd.get_solar_raashi().index == 9