Beispiel #1
0
	def calcHArcWithSM(self, mundane, idprom, h, hcps, arc, aspect, asp=0.0):
		sm = secmotion.SecMotion(self.chart.time, self.chart.place, idprom, arc, self.chart.place.lat, self.chart.houses.ascmc2, self.options.topocentric)

		lonprom = sm.planet.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.LONG]
		pllat = sm.planet.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.LAT]
		raprom = sm.planet.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.RA]
		declprom = sm.planet.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.DECL]

		if not mundane:
			lonprom += asp
			lonprom = util.normalize(lonprom)
			latprom, raprom, declprom = 0.0, 0.0, 0.0
			if self.options.subzodiacal == primdirs.PrimDirs.SZPROMISSOR or self.options.subzodiacal == primdirs.PrimDirs.SZBOTH:
				if self.options.bianchini:
					val = self.getBianchini(pllat, chart.Chart.Aspects[aspect])
					if math.fabs(val) > 1.0:
						return False, 0.0
					latprom = math.degrees(math.asin(val))
				else:
					latprom = pllat

				#calc real(wahre)ra
#				raprom, declprom = util.getRaDecl(lonprom, latprom, self.chart.obl[0])
				raprom, declprom, dist = astrology.swe_cotrans(lonprom, latprom, 1.0, -self.chart.obl[0])
			else:
				raprom, declprom, distprom = astrology.swe_cotrans(lonprom, 0.0, 1.0, -self.chart.obl[0])

		ID = 0
		W = 1
		MD = 2
		UMD = 3
		EASTERN = 4

		pl = self.chart.planets.planets[0]

		#get zd of HC
		zdsig = pl.getZD(hcps[h][MD], self.chart.place.lat, 0.0, hcps[h][UMD])

		val = math.sin(math.radians(self.chart.place.lat))*math.sin(math.radians(zdsig))
		if math.fabs(val) > 1.0:
			return False, 0.0
		polesig = math.degrees(math.asin(val))

		val = math.tan(math.radians(declprom))*math.tan(math.radians(polesig))
		if math.fabs(val) > 1.0:
			return False, 0.0
		qprom = math.degrees(math.asin(val))
		wprom = 0.0
		if hcps[h][EASTERN]:
			wprom = raprom-qprom
		else:
			wprom = raprom+qprom
		wprom = util.normalize(wprom)

		return True, wprom-hcps[h][W]
Beispiel #2
0
	def calcProfPos(self, prof):
		hcs = [self.cusps[0]]
		for i in range(1, Houses.HOUSE_NUM+1):
			hcs.append(util.normalize(self.cusps[i]+prof.offs))

		#to tuple (which is a read-only list)
		self.cusps = tuple(hcs)

		self.ascmc = (util.normalize(self.ascmc[Houses.ASC]+prof.offs), util.normalize(self.ascmc[Houses.MC]+prof.offs), self.ascmc[Houses.ARMC], self.ascmc[Houses.VERTEX], self.ascmc[Houses.EQUASC], self.ascmc[Houses.COASC], self.ascmc[Houses.COASC2], self.ascmc[Houses.POLARASC])

		ascra, ascdecl, dist = astrology.swe_cotrans(self.ascmc[Houses.ASC], 0.0, 1.0, -self.obl)
		mcra, mcdecl, dist = astrology.swe_cotrans(self.ascmc[Houses.MC], 0.0, 1.0, -self.obl)

		self.ascmc2 = ((self.ascmc[Houses.ASC], 0.0, ascra, ascdecl), (self.ascmc[Houses.MC], 0.0, mcra, mcdecl))
Beispiel #3
0
    def __init__(self, ascmc2, pls, obl, placelat):
        ramc = ascmc2[houses.Houses.MC][houses.Houses.RA]
        aoasc = ramc + 90.0
        if aoasc >= 360.0:
            aoasc -= 360.0
        ramoon = pls.planets[astrology.SE_MOON].dataEqu[planets.Planet.RAEQU]
        rasun = pls.planets[astrology.SE_SUN].dataEqu[planets.Planet.RAEQU]
        adsun = 0.0
        self.mLoFvalid = False
        val = math.tan(math.radians(placelat)) * math.tan(
            math.radians(
                pls.planets[astrology.SE_SUN].dataEqu[planets.Planet.DECLEQU]))
        if math.fabs(val) <= 1.0:
            adsun = math.degrees(math.asin(val))
            self.mLoFvalid = True
        aosun = rasun - adsun
        if aosun < 0.0:
            aosun += 360.0
        raMLoF = aoasc + ramoon - aosun
        raMLoF = util.normalize(raMLoF)
        declMLoF = pls.planets[astrology.SE_MOON].dataEqu[
            planets.Planet.DECLEQU]
        lonMLoF, latMLoF, dist = astrology.swe_cotrans(raMLoF, declMLoF, 1.0,
                                                       obl)

        self.mfortune = (lonMLoF, latMLoF, raMLoF, declMLoF)

        self.speculum = placspec.PlacidianSpeculum(placelat, ascmc2, lonMLoF,
                                                   latMLoF, raMLoF, declMLoF)

        self.valid = self.mLoFvalid and self.speculum.valid
Beispiel #4
0
    def __init__(self, tjd_ut, flag, names, obl):

        self.data = []

        i = 0
        for k in names.iterkeys():
            self.data.append(['', '', 0.0, 0.0, 0.0, 0.0])
            ret, name, dat, serr = astrology.swe_fixstar_ut(
                ',' + k, tjd_ut, flag)

            nam = name[0].strip()
            nomnam = ''
            DELIMITER = ','
            if nam.find(DELIMITER) != -1:
                snam = nam.split(DELIMITER)
                nam = snam[0].strip()
                nomnam = snam[1].strip()

            self.data[i][FixStars.NAME] = nam
            self.data[i][FixStars.NOMNAME] = nomnam
            self.data[i][FixStars.LON] = dat[0]
            self.data[i][FixStars.LAT] = dat[1]
            ra, decl, dist = astrology.swe_cotrans(dat[0], dat[1], 1.0, -obl)
            self.data[i][FixStars.RA] = ra
            self.data[i][FixStars.DECL] = decl

            i += 1

        self.sort()
	def calcZodFixStars2HouseCusps(self):
		'''Calculates zodiacal directions of fixstars to HCs'''

		OFFS = primdirs.PrimDir.FIXSTAR

		for i in range(len(self.chart.fixstars.data)):
			if not self.options.pdfixstarssel[self.chart.fixstars.mixed[i]]:
				continue

			if self.abort.abort:
				return

			star = self.chart.fixstars.data[i]
			lonstar = star[fixstars.FixStars.LON]
			rastar = star[fixstars.FixStars.RA]
			declstar = star[fixstars.FixStars.DECL]

			if self.options.subzodiacal != primdirs.PrimDirs.SZPROMISSOR and self.options.subzodiacal != primdirs.PrimDirs.SZBOTH:
				rastar, declstar, dist = astrology.swe_cotrans(lonstar, 0.0, 1.0, -self.chart.obl[0])

			val = math.tan(math.radians(self.chart.place.lat))*math.tan(math.radians(declstar))
			if math.fabs(val) > 1.0:
				continue
			adstar = math.degrees(math.asin(val))

			dsa = 90.0+adstar
			nsa = 90.0-adstar

			self.toHCs(False, i+OFFS, rastar, dsa, nsa, chart.Chart.CONJUNCTIO)
Beispiel #6
0
	def calcFullAstronomicalProc(self, fort, da, oblN):#, raN, declN):
		raN = fort.fortune[Fortune.RA]
		declN = fort.fortune[Fortune.DECL]

		ksi = raN+da
		ksi = util.normalize(ksi)

		roblN = math.radians(oblN)
		rksi = math.radians(ksi)
		rdeclN = math.radians(declN)
		longSZ = 0.0
		if ksi == 90.0:
			longSZ = 90.0
		elif ksi == 270.0:
			longSZ = 270.0
		else:
			Fd = 0.0
			if math.cos(rksi) != 0.0:
				Fd = math.degrees(math.atan((math.cos(roblN)*math.sin(rksi)+math.sin(roblN)*math.tan(rdeclN))/math.cos(rksi)))

			if ksi >= 0.0 and ksi < 90.0:
				longSZ = Fd
			elif ksi > 90.0 and ksi < 270.0:
				longSZ = Fd+180.0
			elif ksi > 270.0 and ksi < 360.0:
				longSZ = Fd+360.0

			if longSZ <= 0.0:
				longSZ = Fd+360.0

		latSZ = math.degrees(math.asin(math.sin(rdeclN)*math.cos(roblN)-math.cos(rdeclN)*math.sin(rksi)*math.sin(roblN)))
		raSZ, declSZ, distSZ = astrology.swe_cotrans(longSZ, latSZ, 1.0, -oblN)

		self.fortune = [longSZ, latSZ, raSZ, declSZ]
Beispiel #7
0
	def __init__(self, tjd_ut, flag, names, obl):
		
		self.data = []

		i = 0
		for k in names.iterkeys():
			self.data.append(['', '', 0.0, 0.0, 0.0, 0.0])
			ret, name, dat, serr = astrology.swe_fixstar_ut(','+k, tjd_ut, flag)

			nam = name[0].strip()
			nomnam = ''
			DELIMITER = ','
			if nam.find(DELIMITER) != -1:
				snam = nam.split(DELIMITER)
				nam = snam[0].strip()
				nomnam = snam[1].strip()

			self.data[i][FixStars.NAME] = nam
			self.data[i][FixStars.NOMNAME] = nomnam
			self.data[i][FixStars.LON] = dat[0]
			self.data[i][FixStars.LAT] = dat[1]
			ra, decl, dist = astrology.swe_cotrans(dat[0], dat[1], 1.0, -obl)
			self.data[i][FixStars.RA] = ra
			self.data[i][FixStars.DECL] = decl

			i += 1

		self.sort()
Beispiel #8
0
    def calcCustomer2HouseCusps(self, mundane):
        '''Calculates directions of Customer-Promissor to intermediate house cusps'''

        lonpl = self.chart.cpd.speculums[primdirs.PrimDirs.PLACSPECULUM][
            customerpd.CustomerPD.LONG]
        rapl = self.chart.cpd.speculums[primdirs.PrimDirs.PLACSPECULUM][
            customerpd.CustomerPD.RA]
        dsa = self.chart.cpd.speculums[primdirs.PrimDirs.PLACSPECULUM][
            customerpd.CustomerPD.SA]
        nsa = self.chart.cpd.speculums[primdirs.PrimDirs.PLACSPECULUM][
            customerpd.CustomerPD.SA]

        if dsa < 0.0:
            dsa = 180.0 + dsa
            nsa *= -1
        else:
            nsa = 180.0 - dsa

        if not mundane and self.options.subzodiacal != primdirs.PrimDirs.SZPROMISSOR and self.options.subzodiacal != primdirs.PrimDirs.SZBOTH:
            rapl, declpl, dist = astrology.swe_cotrans(lonpl, 0.0, 1.0,
                                                       -self.chart.obl[0])
            val = math.tan(math.radians(self.chart.place.lat)) * math.tan(
                math.radians(declpl))
            if math.fabs(val) > 1.0:
                return
            adlat = math.degrees(math.asin(val))
            dsa = 90.0 + adlat
            nsa = 90.0 - adlat

        self.toHCs(mundane, primdirs.PrimDir.CUSTOMERPD, rapl, dsa, nsa,
                   chart.Chart.CONJUNCTIO)
Beispiel #9
0
    def calcZodFixStars2HouseCusps(self):
        '''Calculates zodiacal directions of fixstars to HCs'''

        OFFS = primdirs.PrimDir.FIXSTAR

        for i in range(len(self.chart.fixstars.data)):
            if not self.options.pdfixstarssel[self.chart.fixstars.mixed[i]]:
                continue

            if self.abort.abort:
                return

            star = self.chart.fixstars.data[i]
            lonstar = star[fixstars.FixStars.LON]
            rastar = star[fixstars.FixStars.RA]
            declstar = star[fixstars.FixStars.DECL]

            if self.options.subzodiacal != primdirs.PrimDirs.SZPROMISSOR and self.options.subzodiacal != primdirs.PrimDirs.SZBOTH:
                rastar, declstar, dist = astrology.swe_cotrans(
                    lonstar, 0.0, 1.0, -self.chart.obl[0])

            val = math.tan(math.radians(self.chart.place.lat)) * math.tan(
                math.radians(declstar))
            if math.fabs(val) > 1.0:
                continue
            adstar = math.degrees(math.asin(val))

            dsa = 90.0 + adstar
            nsa = 90.0 - adstar

            self.toHCs(False, i + OFFS, rastar, dsa, nsa,
                       chart.Chart.CONJUNCTIO)
Beispiel #10
0
    def calcAntiscia2HouseCuspsSub(self, mundane, pls, offs):
        #aspects of proms to HCs in Zodiacal!?

        for i in range(len(pls)):
            if not self.options.promplanets[i]:
                continue

            if self.abort.abort:
                return

            pl = pls[i]
            lonpl = pl.lon
            rapl = pl.ra
            declpl = pl.decl

            if not mundane and self.options.subzodiacal != primdirs.PrimDirs.SZPROMISSOR and self.options.subzodiacal != primdirs.PrimDirs.SZBOTH:
                rapl, declpl, dist = astrology.swe_cotrans(
                    lonpl, 0.0, 1.0, -self.chart.obl[0])

            val = math.tan(math.radians(self.chart.place.lat)) * math.tan(
                math.radians(declpl))
            if math.fabs(val) > 1.0:
                continue
            adlat = math.degrees(math.asin(val))
            dsa = 90.0 + adlat
            nsa = 90.0 - adlat

            self.toHCs(mundane, i + offs, rapl, dsa, nsa,
                       chart.Chart.CONJUNCTIO)
Beispiel #11
0
	def __init__(self, ascmc2, pls, obl, placelat):
		ramc = ascmc2[houses.Houses.MC][houses.Houses.RA]
		aoasc = ramc+90.0
		if aoasc >= 360.0:
			aoasc -= 360.0
		ramoon = pls.planets[astrology.SE_MOON].dataEqu[planets.Planet.RAEQU]
		rasun = pls.planets[astrology.SE_SUN].dataEqu[planets.Planet.RAEQU]
		adsun = 0.0
		self.mLoFvalid = False
		val = math.tan(math.radians(placelat))*math.tan(math.radians(pls.planets[astrology.SE_SUN].dataEqu[planets.Planet.DECLEQU]))
		if math.fabs(val) <= 1.0:
			adsun = math.degrees(math.asin(val))
			self.mLoFvalid = True
		aosun = rasun-adsun
		if aosun < 0.0:
			aosun += 360.0
		raMLoF = aoasc+ramoon-aosun
		raMLoF = util.normalize(raMLoF)
		declMLoF = pls.planets[astrology.SE_MOON].dataEqu[planets.Planet.DECLEQU]
		lonMLoF, latMLoF, dist = astrology.swe_cotrans(raMLoF, declMLoF, 1.0, obl)

		self.mfortune = (lonMLoF, latMLoF, raMLoF, declMLoF)

		self.speculum = placspec.PlacidianSpeculum(placelat, ascmc2, lonMLoF, latMLoF, raMLoF, declMLoF)

		self.valid = self.mLoFvalid and self.speculum.valid
	def calcAntiscia2HouseCuspsSub(self, mundane, pls, offs):
		#aspects of proms to HCs in Zodiacal!?

		for i in range(len(pls)):
			if not self.options.promplanets[i]:
				continue

			if self.abort.abort:
				return

			pl = pls[i]
			lonpl = pl.lon
			rapl = pl.ra
			declpl = pl.decl
				
			if not mundane and self.options.subzodiacal != primdirs.PrimDirs.SZPROMISSOR and self.options.subzodiacal != primdirs.PrimDirs.SZBOTH:
				rapl, declpl, dist = astrology.swe_cotrans(lonpl, 0.0, 1.0, -self.chart.obl[0])

			val = math.tan(math.radians(self.chart.place.lat))*math.tan(math.radians(declpl))
			if math.fabs(val) > 1.0:
				continue
			adlat = math.degrees(math.asin(val))
			dsa = 90.0+adlat
			nsa = 90.0-adlat

			self.toHCs(mundane, i+offs, rapl, dsa, nsa, chart.Chart.CONJUNCTIO)
	def calc2HouseCusps(self, mundane):
		'''Calculates directions of Promissors to intermediate house cusps'''

		#aspects of proms to HCs in Zodiacal!?

		for i in range(len(self.chart.planets.planets)):
			if not self.options.promplanets[i]:
				continue

			if self.abort.abort:
				return

			pl = self.chart.planets.planets[i]
			rapl = pl.speculums[primdirs.PrimDirs.PLACSPECULUM][planets.Planet.RA]
			dsa = pl.speculums[primdirs.PrimDirs.PLACSPECULUM][planets.Planet.SA]
			nsa = pl.speculums[primdirs.PrimDirs.PLACSPECULUM][planets.Planet.SA]

			if dsa < 0.0:
				dsa = 180.0+dsa
				nsa *= -1
			else:
				nsa = 180.0-dsa
				
			if not mundane and self.options.subzodiacal != primdirs.PrimDirs.SZPROMISSOR and self.options.subzodiacal != primdirs.PrimDirs.SZBOTH:
				rapl, declpl, dist = astrology.swe_cotrans(pl.data[planets.Planet.LONG], 0.0, 1.0, -self.chart.obl[0])
				val = math.tan(math.radians(self.chart.place.lat))*math.tan(math.radians(declpl))
				if math.fabs(val) > 1.0:
					continue
				adlat = math.degrees(math.asin(val))
				dsa = 90.0+adlat
				nsa = 90.0-adlat

			self.toHCs(mundane, i, rapl, dsa, nsa, chart.Chart.CONJUNCTIO)
Beispiel #14
0
	def __init__(self, tjd_ut, pId, flag, lat = None, ascmc2 = None, raequasc = None, ecl = None, equ = None, nolat = False, obl = 0.0):
		self.pId = pId

		self.speculums = None

		if (ecl == None):
			rflag, self.data, serr = astrology.swe_calc_ut(tjd_ut, pId, flag)
			rflag, self.dataEqu, serr = astrology.swe_calc_ut(tjd_ut, pId, flag+astrology.SEFLG_EQUATORIAL)

			# data[0] : longitude
			# data[1] : latitude
			# data[2] : distance
			# data[3] : speed in long
			# data[4] : speed in lat
			# data[5] : speed in dist

			# if rflag < 0:
			#	print 'Error: %s' % serr

			self.name = astrology.swe_get_planet_name(pId)
		else:
			self.data = tuple(ecl)
			self.dataEqu = tuple(equ)
			self.name = 'DescNode'

		if nolat:
			self.data = (self.data[Planet.LONG], 0.0, self.data[Planet.DIST], self.data[Planet.SPLON], self.data[Planet.SPLAT], self.data[Planet.SPDIST])
			ra, decl, dist = astrology.swe_cotrans(self.data[Planet.LONG], 0.0, 1.0, -obl)
			self.dataEqu = (ra, decl, self.dataEqu[Planet.DISTEQU], self.dataEqu[Planet.SPRAEQU], self.dataEqu[Planet.SPDECLEQU], self.dataEqu[Planet.SPDISTEQU])

		if lat != None:
			#placspec.py and regiospec should be used instead, remove these!
			self.speculums = []
			self.computePlacidianSpeculum(lat, ascmc2)
			self.computeRegiomontanSpeculum(lat, ascmc2, raequasc)
Beispiel #15
0
    def calcProfPos(self, prof):
        hcs = [self.cusps[0]]
        for i in range(1, Houses.HOUSE_NUM + 1):
            hcs.append(util.normalize(self.cusps[i] + prof.offs))

        #to tuple (which is a read-only list)
        self.cusps = tuple(hcs)

        self.ascmc = (util.normalize(self.ascmc[Houses.ASC] + prof.offs),
                      util.normalize(self.ascmc[Houses.MC] + prof.offs),
                      self.ascmc[Houses.ARMC], self.ascmc[Houses.VERTEX],
                      self.ascmc[Houses.EQUASC], self.ascmc[Houses.COASC],
                      self.ascmc[Houses.COASC2], self.ascmc[Houses.POLARASC])

        ascra, ascdecl, dist = astrology.swe_cotrans(self.ascmc[Houses.ASC],
                                                     0.0, 1.0, -self.obl)
        mcra, mcdecl, dist = astrology.swe_cotrans(self.ascmc[Houses.MC], 0.0,
                                                   1.0, -self.obl)

        self.ascmc2 = ((self.ascmc[Houses.ASC], 0.0, ascra, ascdecl),
                       (self.ascmc[Houses.MC], 0.0, mcra, mcdecl))
Beispiel #16
0
	def calcFullAstronomicalProc(self, da, oblN, raN, declN, placelat, ascmc2, raequasc):
#		print '**** %s ****' % pl.name
		ksi = raN+da
		ksi = util.normalize(ksi)

#		print 'ksi=%f' % ksi
#		print 'declN=%f' % declN

		roblN = math.radians(oblN)
		rksi = math.radians(ksi)
		rdeclN = math.radians(declN)
		longSZ = 0.0
		if ksi == 90.0:
			longSZ = 90.0
		elif ksi == 270.0:
			longSZ = 270.0
		else:
#			print 'obl=%f' % oblN
			Fd = 0.0
			if math.cos(rksi) != 0.0:
				Fd = math.degrees(math.atan((math.cos(roblN)*math.sin(rksi)+math.sin(roblN)*math.tan(rdeclN))/math.cos(rksi)))
#				print 'rFd=%f' % math.radians(Fd)

			if ksi >= 0.0 and ksi < 90.0:
				longSZ = Fd
#				print 'First ksi'
			elif ksi > 90.0 and ksi < 270.0:
				longSZ = Fd+180.0
#				print 'Second ksi'
			elif ksi > 270.0 and ksi < 360.0:
				longSZ = Fd+360.0
#				print 'Third ksi'

			if longSZ <= 0.0:
#				print 'longSz<=0'
				longSZ = Fd+360.0
				
		longSZ = util.normalize(longSZ)##
#		print 'longSz=%f' % longSZ

		roblN = math.radians(oblN)
		rksi = math.radians(ksi)
		rdeclN = math.radians(declN)

		latSZ = math.degrees(math.asin(math.sin(rdeclN)*math.cos(roblN)-math.cos(rdeclN)*math.sin(rksi)*math.sin(roblN)))
		raSZ, declSZ, distSZ = astrology.swe_cotrans(longSZ, latSZ, 1.0, -oblN)

		self.data = (longSZ, latSZ, self.data[Planet.DIST], self.data[Planet.SPLON], self.data[Planet.SPLAT], self.data[Planet.SPDIST])
		self.dataEqu = (raSZ, declSZ, self.dataEqu[Planet.DISTEQU], self.dataEqu[Planet.SPRAEQU], self.dataEqu[Planet.SPDECLEQU], self.dataEqu[Planet.SPDISTEQU])

		self.speculums = []
		self.computePlacidianSpeculum(placelat, ascmc2)
		self.computeRegiomontanSpeculum(placelat, ascmc2, raequasc)
Beispiel #17
0
    def __init__(self,
                 tjd_ut,
                 pId,
                 flag,
                 lat=None,
                 ascmc2=None,
                 raequasc=None,
                 ecl=None,
                 equ=None,
                 nolat=False,
                 obl=0.0):
        self.pId = pId

        self.speculums = None

        if (ecl == None):
            rflag, self.data, serr = astrology.swe_calc_ut(tjd_ut, pId, flag)
            rflag, self.dataEqu, serr = astrology.swe_calc_ut(
                tjd_ut, pId, flag + astrology.SEFLG_EQUATORIAL)

            # data[0] : longitude
            # data[1] : latitude
            # data[2] : distance
            # data[3] : speed in long
            # data[4] : speed in lat
            # data[5] : speed in dist

            # if rflag < 0:
            #	print 'Error: %s' % serr

            self.name = astrology.swe_get_planet_name(pId)
        else:
            self.data = tuple(ecl)
            self.dataEqu = tuple(equ)
            self.name = 'DescNode'

        if nolat:
            self.data = (self.data[Planet.LONG], 0.0, self.data[Planet.DIST],
                         self.data[Planet.SPLON], self.data[Planet.SPLAT],
                         self.data[Planet.SPDIST])
            ra, decl, dist = astrology.swe_cotrans(self.data[Planet.LONG], 0.0,
                                                   1.0, -obl)
            self.dataEqu = (ra, decl, self.dataEqu[Planet.DISTEQU],
                            self.dataEqu[Planet.SPRAEQU],
                            self.dataEqu[Planet.SPDECLEQU],
                            self.dataEqu[Planet.SPDISTEQU])

        if lat != None:
            #placspec.py and regiospec should be used instead, remove these!
            self.speculums = []
            self.computePlacidianSpeculum(lat, ascmc2)
            self.computeRegiomontanSpeculum(lat, ascmc2, raequasc)
Beispiel #18
0
	def __init__(self, tjd_ut, flag, geolat, geolon, hsys, obl, ayanopt, ayan):
		if hsys in Houses.hsystems:
			self.hsys = hsys
		else:
			self.hsys = hsystems[0]

		self.obl = obl

		res, self.cusps, self.ascmc = astrology.swe_houses_ex(tjd_ut, flag, geolat, geolon, ord(self.hsys))

		##################
		if ayanopt != 0 and self.hsys == 'W':
			del self.cusps
			cusps = [0.0]
			sign = int(util.normalize(self.ascmc[Houses.ASC]-ayan))/30
			cusps.append(sign*30.0)
			for i in range(2, Houses.HOUSE_NUM+1):
				hc = util.normalize(cusps[i-1]+30.0)
				cusps.append(hc)

			#to tuple (which is a read-only list)
			self.cusps = tuple(cusps)
		##################

		ascra, ascdecl, dist = astrology.swe_cotrans(self.ascmc[Houses.ASC], 0.0, 1.0, -obl)				
		mcra, mcdecl, dist = astrology.swe_cotrans(self.ascmc[Houses.MC], 0.0, 1.0, -obl)
		self.ascmc2 = ((self.ascmc[Houses.ASC], 0.0, ascra, ascdecl), (self.ascmc[Houses.MC], 0.0, mcra, mcdecl))

		#zdAsc=90.0, zdMC=0.0
		#poleAsc=lat, poleMC=0.0
		qasc = math.degrees(math.asin(math.tan(math.radians(ascdecl))*math.tan(math.radians(geolat))))
		self.regioMPAsc = ascra-qasc
		self.regioMPMC = mcra

		self.cuspstmp = [[0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]
		for i in range(Houses.HOUSE_NUM):
			self.cuspstmp[i][0], self.cuspstmp[i][1], dist = astrology.swe_cotrans(self.cusps[i+1], 0.0, dist, -obl)
			
		self.cusps2 = ((self.cuspstmp[0][0], self.cuspstmp[0][1]), (self.cuspstmp[1][0], self.cuspstmp[1][1]), (self.cuspstmp[2][0], self.cuspstmp[2][1]), (self.cuspstmp[3][0], self.cuspstmp[3][1]), (self.cuspstmp[4][0], self.cuspstmp[4][1]), (self.cuspstmp[5][0], self.cuspstmp[5][1]), (self.cuspstmp[6][0], self.cuspstmp[6][1]), (self.cuspstmp[7][0], self.cuspstmp[7][1]), (self.cuspstmp[8][0], self.cuspstmp[8][1]), (self.cuspstmp[9][0], self.cuspstmp[9][1]), (self.cuspstmp[10][0], self.cuspstmp[10][1]), (self.cuspstmp[11][0], self.cuspstmp[11][1]))
Beispiel #19
0
	def __init__(self, pls, ascmc, lof, obl, ayanopt, ayan):
		self.obl = obl
		self.plantiscia = []
		self.plcontraant = []
		self.lofant = None
		self.lofcontraant = None
		self.ascmcant = []
		self.ascmccontraant = []

		self.ayanopt = ayanopt
		self.ayan = ayan

		plcants = []

		for i in range(planets.Planets.PLANETS_NUM):
			ant, cant = self.calc(pls[i].data[planets.Planet.LONG])
			lat = pls[i].data[planets.Planet.LAT]
			plcants.append((cant, lat))

#			raant, declant = util.getRaDecl(ant, lat, self.obl)
			raant, declant, dist = astrology.swe_cotrans(ant, lat, 1.0, -obl)
			self.plantiscia.append(Antiscion(Antiscion.ANTISCION, i, ant, lat, raant, declant))
			
		for i in range(planets.Planets.PLANETS_NUM):
#			raant, declant = util.getRaDecl(plcants[i][0], plcants[i][1], self.obl)
			raant, declant, dist = astrology.swe_cotrans(plcants[i][0], plcants[i][1], 1.0, -obl)
			self.plcontraant.append(Antiscion(Antiscion.CONTRAANT, i, plcants[i][0], plcants[i][1], raant, declant))

		ant, cant = self.calc(lof[fortune.Fortune.LON])
#		lat = lof[fortune.Fortune.LAT] #=0.0
		raant, declant, dist = astrology.swe_cotrans(ant, 0.0, 1.0, -self.obl)
		self.lofant = Antiscion(Antiscion.ANTISCION, Antiscion.LOF, ant, 0.0, raant, declant)
		raant, declant, dist = astrology.swe_cotrans(cant, 0.0, 1.0, -self.obl)
		self.lofcontraant = Antiscion(Antiscion.CONTRAANT, Antiscion.LOF, cant, 0.0, raant, declant)

		antasc, cantasc = self.calc(ascmc[houses.Houses.ASC])
		raantasc, declantasc, dist = astrology.swe_cotrans(antasc, 0.0, 1.0, -self.obl)
		self.ascmcant.append(Antiscion(Antiscion.ANTISCION, Antiscion.ASC, antasc, 0.0, raantasc, declantasc))

		antmc, cantmc = self.calc(ascmc[houses.Houses.MC])
		raantmc, declantmc, dist = astrology.swe_cotrans(antmc, 0.0, 1.0, -self.obl)
		self.ascmcant.append(Antiscion(Antiscion.ANTISCION, Antiscion.MC, antmc, 0.0, raantmc, declantmc))

		raantasc, declantasc, dist = astrology.swe_cotrans(cantasc, 0.0, 1.0, -self.obl)
		self.ascmccontraant.append(Antiscion(Antiscion.CONTRAANT, Antiscion.ASC, cantasc, 0.0, raantasc, declantasc))

		raantmc, declantmc, dist = astrology.swe_cotrans(cantmc, 0.0, 1.0, -self.obl)
		self.ascmccontraant.append(Antiscion(Antiscion.CONTRAANT, Antiscion.MC, cantmc, 0.0, raantmc, declantmc))
Beispiel #20
0
	def calcMundaneWithoutSM(self, da, obl, placelat, ascmc2, raequasc):
		ra = self.dataEqu[Planet.RAEQU]
		decl = self.dataEqu[Planet.DECLEQU]

		da *= -1
		ra += da

		ra = util.normalize(ra)

		lon, lat, dist = astrology.swe_cotrans(ra, decl, 1.0, obl)

		self.data = (lon, lat, self.data[Planet.DIST], self.data[Planet.SPLON], self.data[Planet.SPLAT], self.data[Planet.SPDIST])
		self.dataEqu = (ra, decl, self.dataEqu[Planet.DISTEQU], self.dataEqu[Planet.SPRAEQU], self.dataEqu[Planet.SPDECLEQU], self.dataEqu[Planet.SPDISTEQU])

		self.speculums = []
		self.computePlacidianSpeculum(placelat, ascmc2)
		self.computeRegiomontanSpeculum(placelat, ascmc2, raequasc)
Beispiel #21
0
	def __init__(self, londeg, lonmin, lonsec, latdeg, latmin, latsec, southern, placelat, ascmc2, obl, raequasc):
		self.londeg = londeg
		self.lonmin = lonmin
		self.lonsec = lonsec
		self.latdeg = latdeg
		self.latmin = latmin
		self.latsec = latsec
		self.southern = southern

		self.lon = londeg+lonmin/60.0+lonsec/3600.0
		self.lat = latdeg+latmin/60.0+latsec/3600.0

		if self.southern:
			self.lat *= -1

		self.ra, self.decl, dist = astrology.swe_cotrans(self.lon, self.lat, 1.0, -obl)

		self.speculums = []
		self.computePlacidianSpeculum(placelat, ascmc2)
		self.computeRegiomontanSpeculum(placelat, ascmc2, raequasc)
Beispiel #22
0
	def __init__(self, londeg, lonmin, lonsec, latdeg, latmin, latsec, southern, placelat, ascmc2, obl, raequasc):
		self.londeg = londeg
		self.lonmin = lonmin
		self.lonsec = lonsec
		self.latdeg = latdeg
		self.latmin = latmin
		self.latsec = latsec
		self.southern = southern

		self.lon = londeg+lonmin/60.0+lonsec/3600.0
		self.lat = latdeg+latmin/60.0+latsec/3600.0

		if self.southern:
			self.lat *= -1

		self.ra, self.decl, dist = astrology.swe_cotrans(self.lon, self.lat, 1.0, -obl)

		self.speculums = []
		self.computePlacidianSpeculum(placelat, ascmc2)
		self.computeRegiomontanSpeculum(placelat, ascmc2, raequasc)
Beispiel #23
0
	def __init__(self, typ, ascmc2, raequasc, pls, obl, placelat, abovehorizon):
		self.fortune = [0.0, 0.0, 0.0, 0.0]

		self.abovehorizon = abovehorizon	

		if typ == chart.Chart.LFMOONSUN:
			diff = pls.planets[astrology.SE_MOON].data[planets.Planet.LONG]-pls.planets[astrology.SE_SUN].data[planets.Planet.LONG]
			if diff < 0.0:
				diff += 360.0
			self.fortune[Fortune.LON] = ascmc2[houses.Houses.ASC][houses.Houses.LON]+diff
			if self.fortune[Fortune.LON] > 360.0:
				self.fortune[Fortune.LON] -= 360.0
		elif typ == chart.Chart.LFDSUNMOON:
			diff = 0.0
			if abovehorizon:
				diff = pls.planets[astrology.SE_SUN].data[planets.Planet.LONG]-pls.planets[astrology.SE_MOON].data[planets.Planet.LONG]
			else:
				diff = pls.planets[astrology.SE_MOON].data[planets.Planet.LONG]-pls.planets[astrology.SE_SUN].data[planets.Planet.LONG]

			if diff < 0.0:
				diff += 360.0
			self.fortune[Fortune.LON] = ascmc2[houses.Houses.ASC][houses.Houses.LON]+diff
			if self.fortune[Fortune.LON] > 360.0:
				self.fortune[Fortune.LON] -= 360.0
		elif typ == chart.Chart.LFDMOONSUN:
			diff = 0.0
			if abovehorizon:
				diff = pls.planets[astrology.SE_MOON].data[planets.Planet.LONG]-pls.planets[astrology.SE_SUN].data[planets.Planet.LONG]
			else:
				diff = pls.planets[astrology.SE_SUN].data[planets.Planet.LONG]-pls.planets[astrology.SE_MOON].data[planets.Planet.LONG]

			if diff < 0.0:
				diff += 360.0
			self.fortune[Fortune.LON] = ascmc2[houses.Houses.ASC][houses.Houses.LON]+diff
			if self.fortune[Fortune.LON] > 360.0:
				self.fortune[Fortune.LON] -= 360.0

		self.fortune[Fortune.RA], self.fortune[Fortune.DECL], distprom = astrology.swe_cotrans(self.fortune[Fortune.LON], 0.0, 1.0, -obl)

		self.speculum = placspec.PlacidianSpeculum(placelat, ascmc2, self.fortune[Fortune.LON], self.fortune[Fortune.LAT], self.fortune[Fortune.RA], self.fortune[Fortune.DECL])
		self.speculum2 = regiospec.RegiomontanianSpeculum(placelat, ascmc2, raequasc, self.fortune[Fortune.LON], self.fortune[Fortune.LAT], self.fortune[Fortune.RA], self.fortune[Fortune.DECL])
Beispiel #24
0
    def calcMundaneWithoutSM(self, da, obl, placelat, ascmc2, raequasc):
        ra = self.dataEqu[Planet.RAEQU]
        decl = self.dataEqu[Planet.DECLEQU]

        da *= -1
        ra += da

        ra = util.normalize(ra)

        lon, lat, dist = astrology.swe_cotrans(ra, decl, 1.0, obl)

        self.data = (lon, lat, self.data[Planet.DIST], self.data[Planet.SPLON],
                     self.data[Planet.SPLAT], self.data[Planet.SPDIST])
        self.dataEqu = (ra, decl, self.dataEqu[Planet.DISTEQU],
                        self.dataEqu[Planet.SPRAEQU],
                        self.dataEqu[Planet.SPDECLEQU],
                        self.dataEqu[Planet.SPDISTEQU])

        self.speculums = []
        self.computePlacidianSpeculum(placelat, ascmc2)
        self.computeRegiomontanSpeculum(placelat, ascmc2, raequasc)
Beispiel #25
0
    def calcFullAstronomicalProc(self, fort, da, oblN):  #, raN, declN):
        raN = fort.fortune[Fortune.RA]
        declN = fort.fortune[Fortune.DECL]

        ksi = raN + da
        ksi = util.normalize(ksi)

        roblN = math.radians(oblN)
        rksi = math.radians(ksi)
        rdeclN = math.radians(declN)
        longSZ = 0.0
        if ksi == 90.0:
            longSZ = 90.0
        elif ksi == 270.0:
            longSZ = 270.0
        else:
            Fd = 0.0
            if math.cos(rksi) != 0.0:
                Fd = math.degrees(
                    math.atan(
                        (math.cos(roblN) * math.sin(rksi) +
                         math.sin(roblN) * math.tan(rdeclN)) / math.cos(rksi)))

            if ksi >= 0.0 and ksi < 90.0:
                longSZ = Fd
            elif ksi > 90.0 and ksi < 270.0:
                longSZ = Fd + 180.0
            elif ksi > 270.0 and ksi < 360.0:
                longSZ = Fd + 360.0

            if longSZ <= 0.0:
                longSZ = Fd + 360.0

        latSZ = math.degrees(
            math.asin(
                math.sin(rdeclN) * math.cos(roblN) -
                math.cos(rdeclN) * math.sin(rksi) * math.sin(roblN)))
        raSZ, declSZ, distSZ = astrology.swe_cotrans(longSZ, latSZ, 1.0, -oblN)

        self.fortune = [longSZ, latSZ, raSZ, declSZ]
Beispiel #26
0
    def calc2HouseCusps(self, mundane):
        '''Calculates directions of Promissors to intermediate house cusps'''

        #aspects of proms to HCs in Zodiacal!?

        for i in range(len(self.chart.planets.planets)):
            if not self.options.promplanets[i]:
                continue

            if self.abort.abort:
                return

            pl = self.chart.planets.planets[i]
            rapl = pl.speculums[primdirs.PrimDirs.PLACSPECULUM][
                planets.Planet.RA]
            dsa = pl.speculums[primdirs.PrimDirs.PLACSPECULUM][
                planets.Planet.SA]
            nsa = pl.speculums[primdirs.PrimDirs.PLACSPECULUM][
                planets.Planet.SA]

            if dsa < 0.0:
                dsa = 180.0 + dsa
                nsa *= -1
            else:
                nsa = 180.0 - dsa

            if not mundane and self.options.subzodiacal != primdirs.PrimDirs.SZPROMISSOR and self.options.subzodiacal != primdirs.PrimDirs.SZBOTH:
                rapl, declpl, dist = astrology.swe_cotrans(
                    pl.data[planets.Planet.LONG], 0.0, 1.0, -self.chart.obl[0])
                val = math.tan(math.radians(self.chart.place.lat)) * math.tan(
                    math.radians(declpl))
                if math.fabs(val) > 1.0:
                    continue
                adlat = math.degrees(math.asin(val))
                dsa = 90.0 + adlat
                nsa = 90.0 - adlat

            self.toHCs(mundane, i, rapl, dsa, nsa, chart.Chart.CONJUNCTIO)
	def calcCustomer2HouseCusps(self, mundane):
		'''Calculates directions of Customer-Promissor to intermediate house cusps'''

		lonpl = self.chart.cpd.speculums[primdirs.PrimDirs.PLACSPECULUM][customerpd.CustomerPD.LONG]
		rapl = self.chart.cpd.speculums[primdirs.PrimDirs.PLACSPECULUM][customerpd.CustomerPD.RA]
		dsa = self.chart.cpd.speculums[primdirs.PrimDirs.PLACSPECULUM][customerpd.CustomerPD.SA]
		nsa = self.chart.cpd.speculums[primdirs.PrimDirs.PLACSPECULUM][customerpd.CustomerPD.SA]

		if dsa < 0.0:
			dsa = 180.0+dsa
			nsa *= -1
		else:
			nsa = 180.0-dsa
				
		if not mundane and self.options.subzodiacal != primdirs.PrimDirs.SZPROMISSOR and self.options.subzodiacal != primdirs.PrimDirs.SZBOTH:
			rapl, declpl, dist = astrology.swe_cotrans(lonpl, 0.0, 1.0, -self.chart.obl[0])
			val = math.tan(math.radians(self.chart.place.lat))*math.tan(math.radians(declpl))
			if math.fabs(val) > 1.0:
				return
			adlat = math.degrees(math.asin(val))
			dsa = 90.0+adlat
			nsa = 90.0-adlat

		self.toHCs(mundane, primdirs.PrimDir.CUSTOMERPD, rapl, dsa, nsa, chart.Chart.CONJUNCTIO)
Beispiel #28
0
	def calcArcWithSM(self, mundane, idprom, latprom, sig, sigasp, aspect, arc):
		sm = secmotion.SecMotion(self.chart.time, self.chart.place, idprom, arc, self.chart.place.lat, self.chart.houses.ascmc2, self.options.topocentric)
		lonprom = sm.planet.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.LONG]
		raprom = sm.planet.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.RA]
		declprom = sm.planet.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.DECL]
		if not mundane and self.options.subzodiacal != primdirs.PrimDirs.SZPROMISSOR and self.options.subzodiacal != primdirs.PrimDirs.SZBOTH:
			raprom, declprom, distprom = astrology.swe_cotrans(lonprom, 0.0, 1.0, -self.chart.obl[0])

		plsig = self.chart.planets.planets[sig]

		wprom, wsig = 0.0, 0.0
		if mundane or self.options.subzodiacal == primdirs.PrimDirs.SZSIGNIFICATOR or self.options.subzodiacal == primdirs.PrimDirs.SZBOTH: #mundane or zod with sig's latitude
			wsig = plsig.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.W]

			if sigasp == chart.Chart.CONJUNCTIO:
				val = math.tan(math.radians(declprom))*math.tan(math.radians(plsig.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.POLE]))
				if math.fabs(val) > 1.0:
					return False, 0.0
				qprom = math.degrees(math.asin(val))
				if plsig.eastern:
					wprom = raprom-qprom
				else:
					wprom = raprom+qprom
				wprom = util.normalize(wprom)
			else:
				if mundane:
					cmpap = plsig.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.CMP]+aspect
					cmpap = util.normalize(cmpap)

					zdap = math.fabs(cmpap-90.0)

					val = math.sin(math.radians(self.chart.place.lat))*math.sin(math.radians(zdap))
					if math.fabs(val) > 1.0:
						return False, 0.0
					poleap = math.degrees(math.asin(val))
					if (self.chart.place.lat < 0.0 and poleap > 0.0) or (self.chart.place.lat > 0.0 and poleap < 0.0):
						poleap *= -1

					val = math.sin(math.radians(self.chart.place.lat))*math.sin(math.radians(cmpap))
					if math.fabs(val) > 1.0:
						return False, 0.0
					declap = -math.degrees(math.asin(val))
					val = math.tan(math.radians(declap))*math.tan(math.radians(poleap))
					if math.fabs(val) > 1.0:
						return False, 0.0
					qap = math.degrees(math.asin(val))

					X = math.degrees(math.atan(math.cos(math.radians(self.chart.place.lat))*math.tan(math.radians(cmpap))))

					raap = 0.0
					if (cmpap >= 0.0 and cmpap < 90.0) or (cmpap > 270.0 and cmpap <= 360.0):
						raap = self.ramc+90.0+X
						wsig = raap-qap
					if (cmpap > 90.0 and cmpap < 270.0):
						raap = self.ramc-90.0+X
						wsig = raap+qap
					raap = util.normalize(raap)
					wsig = util.normalize(wsig)

					val = math.tan(math.radians(declprom))*math.tan(math.radians(poleap))
					if math.fabs(val) > 1.0:
						return False, 0.0
					qprom = math.degrees(math.asin(val))

					if (cmpap >= 0.0 and cmpap < 90.0) or (cmpap > 270.0 and cmpap <= 360.0):
						wprom = raprom-qprom
					if (cmpap > 90.0 and cmpap < 270.0):
						wprom = raprom+qprom
					wprom = util.normalize(wprom)
				else:#zodiacal with sig's latitude
					lonsig = plsig.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.LONG]+aspect
					lonsig = util.normalize(lonsig)
					latsig = plsig.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.LAT]

					if self.options.bianchini:
						val = self.getBianchini(latsig, chart.Chart.Aspects[sigasp])
						if math.fabs(val) > 1.0:
							return False, 0.0
						latsig = math.degrees(math.asin(val))

					ok, wsig, spole, seastern, md, umd = self.getZodW(plsig, lonsig, latsig)
					if not ok:
						return False, 0.0

					ok, wprom, ppole, seastern, md, umd = self.getZodW(plsig, lonprom, latprom, spole, seastern)
					if not ok:
						return False, 0.0
		else: #zodiacal
			lonsig = plsig.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.LONG]+aspect
			lonsig = util.normalize(lonsig)
			ok, wsig, spole, seastern, md, umd = self.getZodW(plsig, lonsig, 0.0)
			if not ok:
				return False, 0.0

			ok, wprom, ppole, seastern, md, umd = self.getZodW(plsig, lonprom, latprom, spole, seastern)
			if not ok:
				return False, 0.0

		arc = wprom-wsig

		return True, arc
Beispiel #29
0
	def calcArcWithSM(self, mundane, idprom, latprom, sig, sigasp, aspect, arc):
		sm = secmotion.SecMotion(self.chart.time, self.chart.place, idprom, arc, self.chart.place.lat, self.chart.houses.ascmc2, self.options.topocentric)
		lonprom = sm.planet.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.LONG]
		raprom = sm.planet.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.RA]
		declprom = sm.planet.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.DECL]
		if not mundane and self.options.subzodiacal != primdirs.PrimDirs.SZPROMISSOR and self.options.subzodiacal != primdirs.PrimDirs.SZBOTH:
			raprom, declprom, distprom = astrology.swe_cotrans(lonprom, 0.0, 1.0, -self.chart.obl[0])

		plsig = self.chart.planets.planets[sig]

		wprom, wsig = 0.0, 0.0
		if mundane or self.options.subzodiacal == primdirs.PrimDirs.SZSIGNIFICATOR or self.options.subzodiacal == primdirs.PrimDirs.SZBOTH: #mundane or zod with sig's latitude
			wsig = plsig.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.W]

			if sigasp == chart.Chart.CONJUNCTIO:
				val = math.tan(math.radians(declprom))*math.tan(math.radians(plsig.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.POLE]))
				if math.fabs(val) > 1.0:
					return False, 0.0
				qprom = math.degrees(math.asin(val))
				if plsig.eastern:
					wprom = raprom-qprom
				else:
					wprom = raprom+qprom
				wprom = util.normalize(wprom)#
			else:
				if mundane:
					wsig += aspect
					wsig = util.normalize(wsig)
					med = math.fabs(self.ramc-wsig)

					if med > 180.0:
						med = 360.0-med
					icd = math.fabs(self.raic-wsig)
					if icd > 180.0:
						icd = 360.0-icd
					mdsig = med
					if icd < med:
						mdsig = icd

					val = math.tan(math.radians(declprom))*math.tan(math.radians(self.chart.place.lat))*math.sin(math.radians(mdsig))
					if math.fabs(val) > 1.0:
						return False, 0.0
					qprom = math.degrees(math.asin(val))

					eastern = True
					if self.ramc > self.raic:
						if wsig > self.raic and wsig < self.ramc:
							eastern = False
					else:
						if (wsig > self.raic and wsig < 360.0) or (wsig < self.ramc and wsig > 0.0):
							eastern = False

					if eastern:
						wprom = raprom-qprom
					else:
						wprom = raprom+qprom
					wprom = util.normalize(wprom)#
				else:#zodiacal with sig's latitude
					lonsig = plsig.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.LONG]+aspect
					lonsig = util.normalize(lonsig)
					latsig = plsig.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.LAT]

					if self.options.bianchini:
						val = self.getBianchini(latsig, chart.Chart.Aspects[sigasp])
						if math.fabs(val) > 1.0:
							return False, 0.0
						latsig = math.degrees(math.asin(val))

					ok, wsig, spole, seastern, md, umd = self.getZodW(plsig, lonsig, latsig)
					if not ok:
						return False, 0.0

					ok, wprom, ppole, seastern, md, umd = self.getZodW(plsig, lonprom, latprom, spole, seastern)
					if not ok:
						return False, 0.0
		else: #zodiacal
			lonsig = plsig.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.LONG]+aspect
			lonsig = util.normalize(lonsig)
			ok, wsig, spole, seastern, md, umd = self.getZodW(plsig, lonsig, 0.0)
			if not ok:
				return False, 0.0

			ok, wprom, ppole, seastern, md, umd = self.getZodW(plsig, lonprom, latprom, spole, seastern)
			if not ok:
				return False, 0.0

		arc = wprom-wsig

		return True, arc
Beispiel #30
0
    def __init__(self, chrt):
        self.time = chrt.time
        self.lon = chrt.planets.planets[astrology.SE_MOON].data[
            planets.Planet.LONG]

        self.flags = astrology.SEFLG_SPEED + astrology.SEFLG_SWIEPH

        #for topical almutens
        self.lons = []

        if not chrt.time.bc:
            lonsun = chrt.planets.planets[astrology.SE_SUN].data[
                planets.Planet.LONG]
            lonmoon = chrt.planets.planets[astrology.SE_MOON].data[
                planets.Planet.LONG]

            d, m, s = util.decToDeg(lonsun)
            lonsun = d + m / 60.0 + s / 3600.0
            d, m, s = util.decToDeg(lonmoon)
            lonmoon = d + m / 60.0 + s / 3600.0

            diff = lonmoon - lonsun
            self.newmoon, self.ready = self.isNewMoon(diff)

            if not self.ready:
                ok, self.time, self.ready = self.getDateHour(
                    self.time, chrt.place, self.newmoon)
                if not self.ready:
                    ok, self.time, self.ready = self.getDateMinute(
                        self.time, chrt.place, self.newmoon)
                    if not self.ready:
                        ok, self.time, self.ready = self.getDateSecond(
                            self.time, chrt.place, self.newmoon)

            hses = houses.Houses(self.time.jd, 0, chrt.place.lat,
                                 chrt.place.lon, chrt.options.hsys,
                                 chrt.obl[0], chrt.options.ayanamsha,
                                 chrt.ayanamsha)
            moon = planets.Planet(self.time.jd, astrology.SE_MOON, self.flags,
                                  chrt.place.lat, hses.ascmc2)
            if self.newmoon:
                self.lon = moon.data[planets.Planet.LONG]
            else:
                if chrt.options.syzmoon == options.Options.MOON:
                    self.lon = moon.data[planets.Planet.LONG]
                elif chrt.options.syzmoon == options.Options.ABOVEHOR:
                    if moon.abovehorizon:
                        self.lon = moon.data[planets.Planet.LONG]
                    else:
                        sun = planets.Planet(self.time.jd, astrology.SE_SUN,
                                             self.flags)
                        self.lon = sun.data[planets.Planet.LONG]
                else:
                    moon = planets.Planet(self.time.jd, astrology.SE_MOON,
                                          self.flags, chrt.place.lat,
                                          chrt.houses.ascmc2)
                    if moon.abovehorizon:
                        self.lon = moon.data[planets.Planet.LONG]
                    else:
                        sun = planets.Planet(self.time.jd, astrology.SE_SUN,
                                             self.flags)
                        self.lon = sun.data[planets.Planet.LONG]

        ra, decl, dist = astrology.swe_cotrans(self.lon, 0.0, 1.0,
                                               -chrt.obl[0])
        self.speculum = [self.lon, 0.0, ra, decl]

        #the other syzygy (i.e. if the syzygy was conjunction then calculate the opposition and vice versa)
        self.lon2 = chrt.planets.planets[astrology.SE_MOON].data[
            planets.Planet.LONG]
        if not chrt.time.bc:
            self.time2 = self.time
            ok, self.time2, self.ready2 = self.getDateHour(
                self.time2, chrt.place, not self.newmoon)
            if not self.ready2:
                ok, self.time2, self.ready2 = self.getDateMinute(
                    self.time2, chrt.place, not self.newmoon)
                if not self.ready2:
                    ok, self.time2, self.ready2 = self.getDateSecond(
                        self.time2, chrt.place, not self.newmoon)

            hses2 = houses.Houses(self.time2.jd, 0, chrt.place.lat,
                                  chrt.place.lon, chrt.options.hsys,
                                  chrt.obl[0], chrt.options.ayanamsha,
                                  chrt.ayanamsha)
            moon2 = planets.Planet(self.time2.jd, astrology.SE_MOON,
                                   self.flags, chrt.place.lat, hses2.ascmc2)
            if not self.newmoon:
                self.lon2 = moon2.data[planets.Planet.LONG]
            else:
                if chrt.options.syzmoon == options.Options.MOON:
                    self.lon2 = moon2.data[planets.Planet.LONG]
                elif chrt.options.syzmoon == options.Options.ABOVEHOR:
                    if moon2.abovehorizon:
                        self.lon2 = moon2.data[planets.Planet.LONG]
                    else:
                        sun2 = planets.Planet(self.time2.jd, astrology.SE_SUN,
                                              self.flags)
                        self.lon2 = sun2.data[planets.Planet.LONG]
                else:
                    moon2 = planets.Planet(self.time2.jd, astrology.SE_MOON,
                                           self.flags, chrt.place.lat,
                                           chrt.houses.ascmc2)
                    if moon2.abovehorizon:
                        self.lon2 = moon2.data[planets.Planet.LONG]
                    else:
                        sun2 = planets.Planet(self.time2.jd, astrology.SE_SUN,
                                              self.flags)
                        self.lon2 = sun2.data[planets.Planet.LONG]

            ra2, decl2, dist2 = astrology.swe_cotrans(self.lon2, 0.0, 1.0,
                                                      -chrt.obl[0])
            self.speculum2 = [self.lon2, 0.0, ra2, decl2]

            #for topical almutens
            self.lons.append(self.lon)  #Default
            if self.newmoon:  #Conjunction
                self.lons.append(self.lon)
            else:
                self.lons.append(self.lon2)
            #Moon in chart of Syzygy
            hses = houses.Houses(self.time.jd, 0, chrt.place.lat,
                                 chrt.place.lon, chrt.options.hsys,
                                 chrt.obl[0], chrt.options.ayanamsha,
                                 chrt.ayanamsha)
            moonSyz = planets.Planet(self.time.jd, astrology.SE_MOON,
                                     self.flags, chrt.place.lat, hses.ascmc2)
            hses2 = houses.Houses(self.time2.jd, 0, chrt.place.lat,
                                  chrt.place.lon, chrt.options.hsys,
                                  chrt.obl[0], chrt.options.ayanamsha,
                                  chrt.ayanamsha)
            moonSyz2 = planets.Planet(self.time2.jd, astrology.SE_MOON,
                                      self.flags, chrt.place.lat, hses2.ascmc2)
            if not self.newmoon:  #Opposition
                if moonSyz.abovehorizon:
                    self.lons.append(moonSyz.data[planets.Planet.LONG])
                else:
                    sun = planets.Planet(self.time.jd, astrology.SE_SUN,
                                         self.flags)
                    self.lons.append(sun.data[planets.Planet.LONG])
            else:
                if moonSyz2.abovehorizon:
                    self.lons.append(moonSyz2.data[planets.Planet.LONG])
                else:
                    sun2 = planets.Planet(self.time2.jd, astrology.SE_SUN,
                                          self.flags)
                    self.lons.append(sun2.data[planets.Planet.LONG])
            if not self.newmoon:  #OppositionRadix
                moon = planets.Planet(self.time.jd, astrology.SE_MOON,
                                      self.flags, chrt.place.lat,
                                      chrt.houses.ascmc2)
                if moon.abovehorizon:
                    self.lons.append(moon.data[planets.Planet.LONG])
                else:
                    sun = planets.Planet(self.time.jd, astrology.SE_SUN,
                                         self.flags)
                    self.lons.append(sun.data[planets.Planet.LONG])
            else:
                moon = planets.Planet(self.time2.jd, astrology.SE_MOON,
                                      self.flags, chrt.place.lat,
                                      chrt.houses.ascmc2)
                if moon.abovehorizon:
                    self.lons.append(moon.data[planets.Planet.LONG])
                else:
                    sun = planets.Planet(self.time.jd, astrology.SE_SUN,
                                         self.flags)
                    self.lons.append(sun.data[planets.Planet.LONG])
            if not self.newmoon:  #Opposition Moon
                self.lons.append(moonSyz.data[planets.Planet.LONG])
            else:
                self.lons.append(moonSyz2.data[planets.Planet.LONG])
    def onShowBtn(self, event):
        if (self.Validate() and self.sdate.Validate()):
            if util.checkDate(int(self.year.GetValue()),
                              int(self.month.GetValue()),
                              int(self.day.GetValue())):
                arc = 0.0
                date = 2000.5

                direct = self.positiverb.GetValue()
                if (self.arcrb.GetValue()):
                    arc = float(self.da.GetValue())
                    jd, age = self.calcTime(arc, direct)
                    y, m, d, h = astrology.swe_revjul(jd, 1)
                    ho, mi, se = util.decToDeg(h)
                    self.year.SetValue(str(y))
                    self.month.SetValue(str(m))
                    self.day.SetValue(str(d))

                    self.hour.SetValue(str(ho))
                    self.minute.SetValue(str(mi))
                    self.second.SetValue(str(se))
                else:
                    y = int(self.year.GetValue())
                    m = int(self.month.GetValue())
                    d = int(self.day.GetValue())
                    ho = int(self.hour.GetValue())
                    mi = int(self.minute.GetValue())
                    se = int(self.second.GetValue())
                    t = float(ho) + float(mi) / 60.0 + float(se) / 3600.0
                    calflag = astrology.SE_GREG_CAL
                    if self.chart.time.cal == chart.Time.JULIAN:
                        calflag = astrology.SE_JUL_CAL
                    jd = astrology.swe_julday(y, m, d, t, calflag)
                    if self.chart.time.jd >= jd:
                        dlgm = wx.MessageDialog(
                            None, mtexts.txts['TimeSmallerThanBirthTime'],
                            mtexts.txts['Error'], wx.OK | wx.ICON_EXCLAMATION)
                        dlgm.ShowModal()
                        dlgm.Destroy()
                        return False

                    arc = self.calcArc(jd, direct)
                    self.da.SetValue(str(arc))

                da = arc
                if not direct:
                    da *= -1

                pdinch = pdsinchart.PDsInChart(
                    self.chart, da)  #self.yz, mz, dz, tz ==> chart
                pdh, pdm, pds = util.decToDeg(pdinch.tz)
                cal = chart.Time.GREGORIAN
                if self.chart.time.cal == chart.Time.JULIAN:
                    cal = chart.Time.JULIAN
                tim = chart.Time(pdinch.yz, pdinch.mz, pdinch.dz, pdh, pdm,
                                 pds, self.chart.time.bc, cal,
                                 chart.Time.GREENWICH, True, 0, 0, False,
                                 self.chart.place, False)

                if not self.terrestrial:
                    if self.options.pdincharttyp == pdsinchartdlgopts.PDsInChartsDlgOpts.FROMMUNDANEPOS:
                        pdchart = chart.Chart(self.chart.name, self.chart.male,
                                              tim, self.chart.place,
                                              chart.Chart.PDINCHART, '',
                                              self.options,
                                              False)  #, proftype, nolat)
                        pdchartpls = chart.Chart(self.chart.name,
                                                 self.chart.male,
                                                 self.chart.time,
                                                 self.chart.place,
                                                 chart.Chart.PDINCHART, '',
                                                 self.options, False)

                        #modify planets ...
                        if self.options.primarydir == primdirs.PrimDirs.PLACIDIANSEMIARC or self.options.primarydir == primdirs.PrimDirs.PLACIDIANUNDERTHEPOLE:
                            pdchart.planets.calcMundaneProfPos(
                                pdchart.houses.ascmc2,
                                pdchartpls.planets.planets,
                                self.chart.place.lat, self.chart.obl[0])
                        else:
                            pdchart.houses = houses.Houses(
                                tim.jd, 0, pdchart.place.lat,
                                pdchart.place.lon, 'R', pdchart.obl[0],
                                self.options.ayanamsha, pdchart.ayanamsha)
                            pdchart.planets.calcRegioPDsInChartsPos(
                                pdchart.houses.ascmc2,
                                pdchartpls.planets.planets,
                                self.chart.place.lat, self.chart.obl[0])

                        #modify lof
                        if self.options.primarydir == primdirs.PrimDirs.PLACIDIANSEMIARC or self.options.primarydir == primdirs.PrimDirs.PLACIDIANUNDERTHEPOLE:
                            pdchart.fortune.calcMundaneProfPos(
                                pdchart.houses.ascmc2, pdchartpls.fortune,
                                self.chart.place.lat, self.chart.obl[0])
                        else:
                            pdchart.fortune.calcRegioPDsInChartsPos(
                                pdchart.houses.ascmc2, pdchartpls.fortune,
                                self.chart.place.lat, self.chart.obl[0])

                    elif self.options.pdincharttyp == pdsinchartdlgopts.PDsInChartsDlgOpts.FROMZODIACALPOS:
                        pdchart = chart.Chart(self.chart.name, self.chart.male,
                                              tim, self.chart.place,
                                              chart.Chart.PDINCHART, '',
                                              self.options, False,
                                              chart.Chart.YEAR, True)

                        pdchartpls = chart.Chart(
                            self.chart.name, self.chart.male, self.chart.time,
                            self.chart.place, chart.Chart.PDINCHART, '',
                            self.options, False, chart.Chart.YEAR, True)
                        #modify planets ...
                        if self.options.primarydir == primdirs.PrimDirs.PLACIDIANSEMIARC or self.options.primarydir == primdirs.PrimDirs.PLACIDIANUNDERTHEPOLE:
                            pdchart.planets.calcMundaneProfPos(
                                pdchart.houses.ascmc2,
                                pdchartpls.planets.planets,
                                self.chart.place.lat, self.chart.obl[0])
                        else:
                            pdchart.houses = houses.Houses(
                                tim.jd, 0, pdchart.place.lat,
                                pdchart.place.lon, 'R', pdchart.obl[0],
                                self.options.ayanamsha, pdchart.ayanamsha)
                            pdchart.planets.calcRegioPDsInChartsPos(
                                pdchart.houses.ascmc2,
                                pdchartpls.planets.planets,
                                self.chart.place.lat, self.chart.obl[0])

                        #modify lof
                        if self.options.primarydir == primdirs.PrimDirs.PLACIDIANSEMIARC or self.options.primarydir == primdirs.PrimDirs.PLACIDIANUNDERTHEPOLE:
                            pdchart.fortune.calcMundaneProfPos(
                                pdchart.houses.ascmc2, pdchartpls.fortune,
                                self.chart.place.lat, self.chart.obl[0])
                        else:
                            pdchart.fortune.calcRegioPDsInChartsPos(
                                pdchart.houses.ascmc2, pdchartpls.fortune,
                                self.chart.place.lat, self.chart.obl[0])

                    else:  #Full Astronomical Procedure
                        pdchart = chart.Chart(self.chart.name, self.chart.male,
                                              tim, self.chart.place,
                                              chart.Chart.PDINCHART, '',
                                              self.options,
                                              False)  #, proftype, nolat)

                        pdchartpls = chart.Chart(self.chart.name,
                                                 self.chart.male,
                                                 self.chart.time,
                                                 self.chart.place,
                                                 chart.Chart.PDINCHART, '',
                                                 self.options, False)

                        pdpls = pdchartpls.planets.planets
                        if self.options.pdinchartsecmotion:
                            pdpls = pdchart.planets.planets

                        raequasc, declequasc, dist = astrology.swe_cotrans(
                            pdchart.houses.ascmc[houses.Houses.EQUASC], 0.0,
                            1.0, -self.chart.obl[0])
                        pdchart.planets.calcFullAstronomicalProc(
                            da, self.chart.obl[0], pdpls, pdchart.place.lat,
                            pdchart.houses.ascmc2, raequasc)  #planets
                        pdchart.fortune.calcFullAstronomicalProc(
                            pdchartpls.fortune, da, self.chart.obl[0])
                else:
                    if self.options.pdinchartterrsecmotion:
                        pdchart = chart.Chart(self.chart.name, self.chart.male,
                                              tim, self.chart.place,
                                              chart.Chart.PDINCHART, '',
                                              self.options,
                                              False)  #, proftype, nolat)
                    else:
                        pdchart = chart.Chart(self.chart.name, self.chart.male,
                                              self.chart.time,
                                              self.chart.place,
                                              chart.Chart.PDINCHART, '',
                                              self.options,
                                              False)  #, proftype, nolat)
                        raequasc, declequasc, dist = astrology.swe_cotrans(
                            pdchart.houses.ascmc[houses.Houses.EQUASC], 0.0,
                            1.0, -self.chart.obl[0])
                        pdchart.planets.calcMundaneWithoutSM(
                            da, self.chart.obl[0], pdchart.place.lat,
                            pdchart.houses.ascmc2, raequasc)

                    pdchart.fortune.recalcForMundaneChart(
                        self.chart.fortune.fortune[fortune.Fortune.LON],
                        self.chart.fortune.fortune[fortune.Fortune.LAT],
                        self.chart.fortune.fortune[fortune.Fortune.RA],
                        self.chart.fortune.fortune[fortune.Fortune.DECL],
                        pdchart.houses.ascmc2, pdchart.raequasc,
                        pdchart.obl[0], pdchart.place.lat)

                keytxt = mtexts.typeListDyn[self.options.pdkeyd]
                if not self.options.pdkeydyn:
                    keytxt = mtexts.typeListStat[self.options.pdkeys]
                txtdir = mtexts.txts['D']
                if not direct:
                    txtdir = mtexts.txts['C']

                self.parent.change(
                    pdchart, y, m, d, ho, mi, se,
                    mtexts.typeListDirs[self.options.primarydir], keytxt,
                    txtdir, math.fabs(da))
            else:
                dlgm = wx.MessageDialog(
                    None, mtexts.txts['InvalidDate'] + ' (' +
                    self.year.GetValue() + '.' + self.month.GetValue() + '.' +
                    self.day.GetValue() + '.)', mtexts.txts['Error'],
                    wx.OK | wx.ICON_EXCLAMATION)
                dlgm.ShowModal()
                dlgm.Destroy()
	def calcHArcWithSM(self, mundane, idprom, h, arc, aspect, asp=0.0):
		sm = secmotion.SecMotion(self.chart.time, self.chart.place, idprom, arc, self.chart.place.lat, self.chart.houses.ascmc2, self.options.topocentric)
		lonprom = sm.planet.speculums[primdirs.PrimDirs.PLACSPECULUM][planets.Planet.LONG]
		pllat = sm.planet.speculums[primdirs.PrimDirs.PLACSPECULUM][planets.Planet.LAT]
		raprom = sm.planet.speculums[primdirs.PrimDirs.PLACSPECULUM][planets.Planet.RA]
		dsa = sm.planet.speculums[primdirs.PrimDirs.PLACSPECULUM][planets.Planet.SA]
		nsa = sm.planet.speculums[primdirs.PrimDirs.PLACSPECULUM][planets.Planet.SA]

		if dsa < 0.0:
			dsa = 180.0+dsa
			nsa *= -1
		else:
			nsa = 180.0-dsa

		if not mundane:
			lonprom += asp
			lonprom = util.normalize(lonprom)
			latprom, raprom, adprom = 0.0, 0.0, 0.0
			if self.options.subzodiacal == primdirs.PrimDirs.SZPROMISSOR or self.options.subzodiacal == primdirs.PrimDirs.SZBOTH:
				latprom = 0.0
				if self.options.bianchini:
					val = self.getBianchini(pllat, chart.Chart.Aspects[aspect])
					if math.fabs(val) > 1.0:
						return False, 0.0
					latprom = math.degrees(math.asin(val))
				else:
					latprom = pllat

				#calc real(wahre)ra and adlat
#				raprom, declprom = util.getRaDecl(lonprom, latprom, self.chart.obl[0])
				raprom, declprom, dist = astrology.swe_cotrans(lonprom, latprom, 1.0, -self.chart.obl[0])
				val = math.tan(math.radians(self.chart.place.lat))*math.tan(math.radians(declprom))
				if math.fabs(val) > 1.0:
					return False, 0.0
				adprom = math.degrees(math.asin(val))
			else:
				raprom, declprom, dist = astrology.swe_cotrans(lonprom, 0.0, 1.0, -self.chart.obl[0])
				val = math.tan(math.radians(self.chart.place.lat))*math.tan(math.radians(declprom))
				if math.fabs(val) > 1.0:
					return False, 0.0
				adprom = math.degrees(math.asin(val))

			dsa = 90.0+adprom
			nsa = 90.0-adprom

		#day-house, night-house length
		dh = dsa/3.0
		nh = nsa/3.0

		#ra rise, ra set
		rar = self.ramc+dsa
		ras = self.raic+nsa

		rar = util.normalize(rar)
		ras = util.normalize(ras)

		#ra housecusps
		rahcps = ((primdirs.PrimDir.HC2, rar+nh), (primdirs.PrimDir.HC3, rar+2*nh), (primdirs.PrimDir.HC5, self.raic+nh), (primdirs.PrimDir.HC6, self.raic+2*nh), (primdirs.PrimDir.HC8, ras+dh), (primdirs.PrimDir.HC9, ras+2*dh), (primdirs.PrimDir.HC11, self.ramc+dh), (primdirs.PrimDir.HC12, self.ramc+2*dh))

		rahcp = rahcps[h][1]
		rahcp = util.normalize(rahcp)

		arc = raprom-rahcp

		return True, arc
	def onShowBtn(self, event):
		if (self.Validate() and self.sdate.Validate()):
			if util.checkDate(int(self.year.GetValue()), int(self.month.GetValue()), int(self.day.GetValue())):
				arc = 0.0
				date = 2000.5				

				direct = self.positiverb.GetValue()
				if (self.arcrb.GetValue()):
					arc = float(self.da.GetValue())
					jd, age = self.calcTime(arc, direct)
					y, m, d, h = astrology.swe_revjul(jd, 1)
					ho, mi, se = util.decToDeg(h)
					self.year.SetValue(str(y))
					self.month.SetValue(str(m))
					self.day.SetValue(str(d))

					self.hour.SetValue(str(ho))
					self.minute.SetValue(str(mi))
					self.second.SetValue(str(se))
				else:
					y = int(self.year.GetValue())
					m = int(self.month.GetValue())
					d = int(self.day.GetValue())
					ho = int(self.hour.GetValue())
					mi = int(self.minute.GetValue())
					se = int(self.second.GetValue())
					t = float(ho)+float(mi)/60.0+float(se)/3600.0
					calflag = astrology.SE_GREG_CAL
					if self.chart.time.cal == chart.Time.JULIAN:
						calflag = astrology.SE_JUL_CAL
					jd = astrology.swe_julday(y, m, d, t, calflag)
					if self.chart.time.jd >= jd:
						dlgm = wx.MessageDialog(None, mtexts.txts['TimeSmallerThanBirthTime'], mtexts.txts['Error'], wx.OK|wx.ICON_EXCLAMATION)
						dlgm.ShowModal()		
						dlgm.Destroy()
						return False

					arc = self.calcArc(jd, direct)
					self.da.SetValue(str(arc))

				da = arc
				if not direct:
					da *= -1

				pdinch = pdsinchart.PDsInChart(self.chart, da) #self.yz, mz, dz, tz ==> chart
				pdh, pdm, pds = util.decToDeg(pdinch.tz)
				cal = chart.Time.GREGORIAN
				if self.chart.time.cal == chart.Time.JULIAN:
					cal = chart.Time.JULIAN
				tim = chart.Time(pdinch.yz, pdinch.mz, pdinch.dz, pdh, pdm, pds, self.chart.time.bc, cal, chart.Time.GREENWICH, True, 0, 0, False, self.chart.place, False)

				if not self.terrestrial:
					if self.options.pdincharttyp == pdsinchartdlgopts.PDsInChartsDlgOpts.FROMMUNDANEPOS:
						pdchart = chart.Chart(self.chart.name, self.chart.male, tim, self.chart.place, chart.Chart.PDINCHART, '', self.options, False)#, proftype, nolat)
						pdchartpls = chart.Chart(self.chart.name, self.chart.male, self.chart.time, self.chart.place, chart.Chart.PDINCHART, '', self.options, False)

						#modify planets ...
						if self.options.primarydir == primdirs.PrimDirs.PLACIDIANSEMIARC or self.options.primarydir == primdirs.PrimDirs.PLACIDIANUNDERTHEPOLE:
							pdchart.planets.calcMundaneProfPos(pdchart.houses.ascmc2, pdchartpls.planets.planets, self.chart.place.lat, self.chart.obl[0])
						else:
							pdchart.houses = houses.Houses(tim.jd, 0, pdchart.place.lat, pdchart.place.lon, 'R', pdchart.obl[0], self.options.ayanamsha, pdchart.ayanamsha)
							pdchart.planets.calcRegioPDsInChartsPos(pdchart.houses.ascmc2, pdchartpls.planets.planets, self.chart.place.lat, self.chart.obl[0])

						#modify lof
						if self.options.primarydir == primdirs.PrimDirs.PLACIDIANSEMIARC or self.options.primarydir == primdirs.PrimDirs.PLACIDIANUNDERTHEPOLE:
							pdchart.fortune.calcMundaneProfPos(pdchart.houses.ascmc2, pdchartpls.fortune, self.chart.place.lat, self.chart.obl[0])
						else:
							pdchart.fortune.calcRegioPDsInChartsPos(pdchart.houses.ascmc2, pdchartpls.fortune, self.chart.place.lat, self.chart.obl[0])

					elif self.options.pdincharttyp == pdsinchartdlgopts.PDsInChartsDlgOpts.FROMZODIACALPOS:
						pdchart = chart.Chart(self.chart.name, self.chart.male, tim, self.chart.place, chart.Chart.PDINCHART, '', self.options, False, chart.Chart.YEAR, True)

						pdchartpls = chart.Chart(self.chart.name, self.chart.male, self.chart.time, self.chart.place, chart.Chart.PDINCHART, '', self.options, False, chart.Chart.YEAR, True)
						#modify planets ...
						if self.options.primarydir == primdirs.PrimDirs.PLACIDIANSEMIARC or self.options.primarydir == primdirs.PrimDirs.PLACIDIANUNDERTHEPOLE:
							pdchart.planets.calcMundaneProfPos(pdchart.houses.ascmc2, pdchartpls.planets.planets, self.chart.place.lat, self.chart.obl[0])
						else:
							pdchart.houses = houses.Houses(tim.jd, 0, pdchart.place.lat, pdchart.place.lon, 'R', pdchart.obl[0], self.options.ayanamsha, pdchart.ayanamsha)
							pdchart.planets.calcRegioPDsInChartsPos(pdchart.houses.ascmc2, pdchartpls.planets.planets, self.chart.place.lat, self.chart.obl[0])

						#modify lof
						if self.options.primarydir == primdirs.PrimDirs.PLACIDIANSEMIARC or self.options.primarydir == primdirs.PrimDirs.PLACIDIANUNDERTHEPOLE:
							pdchart.fortune.calcMundaneProfPos(pdchart.houses.ascmc2, pdchartpls.fortune, self.chart.place.lat, self.chart.obl[0])
						else:
							pdchart.fortune.calcRegioPDsInChartsPos(pdchart.houses.ascmc2, pdchartpls.fortune, self.chart.place.lat, self.chart.obl[0])
	
					else:#Full Astronomical Procedure
						pdchart = chart.Chart(self.chart.name, self.chart.male, tim, self.chart.place, chart.Chart.PDINCHART, '', self.options, False)#, proftype, nolat)

						pdchartpls = chart.Chart(self.chart.name, self.chart.male, self.chart.time, self.chart.place, chart.Chart.PDINCHART, '', self.options, False)

						pdpls = pdchartpls.planets.planets
						if self.options.pdinchartsecmotion:
							pdpls = pdchart.planets.planets

						raequasc, declequasc, dist = astrology.swe_cotrans(pdchart.houses.ascmc[houses.Houses.EQUASC], 0.0, 1.0, -self.chart.obl[0])
						pdchart.planets.calcFullAstronomicalProc(da, self.chart.obl[0], pdpls, pdchart.place.lat, pdchart.houses.ascmc2, raequasc) #planets
						pdchart.fortune.calcFullAstronomicalProc(pdchartpls.fortune, da, self.chart.obl[0])
				else:
					if self.options.pdinchartterrsecmotion:
						pdchart = chart.Chart(self.chart.name, self.chart.male, tim, self.chart.place, chart.Chart.PDINCHART, '', self.options, False)#, proftype, nolat)
					else:
						pdchart = chart.Chart(self.chart.name, self.chart.male, self.chart.time, self.chart.place, chart.Chart.PDINCHART, '', self.options, False)#, proftype, nolat)
						raequasc, declequasc, dist = astrology.swe_cotrans(pdchart.houses.ascmc[houses.Houses.EQUASC], 0.0, 1.0, -self.chart.obl[0])
						pdchart.planets.calcMundaneWithoutSM(da, self.chart.obl[0], pdchart.place.lat, pdchart.houses.ascmc2, raequasc)

					pdchart.fortune.recalcForMundaneChart(self.chart.fortune.fortune[fortune.Fortune.LON], self.chart.fortune.fortune[fortune.Fortune.LAT], self.chart.fortune.fortune[fortune.Fortune.RA], self.chart.fortune.fortune[fortune.Fortune.DECL], pdchart.houses.ascmc2, pdchart.raequasc, pdchart.obl[0], pdchart.place.lat)

				keytxt = mtexts.typeListDyn[self.options.pdkeyd]
				if not self.options.pdkeydyn:
					keytxt = mtexts.typeListStat[self.options.pdkeys]
				txtdir = mtexts.txts['D']
				if not direct:
					txtdir = mtexts.txts['C']

				self.parent.change(pdchart, y, m, d, ho, mi, se, mtexts.typeListDirs[self.options.primarydir], keytxt, txtdir, math.fabs(da))
			else:
				dlgm = wx.MessageDialog(None, mtexts.txts['InvalidDate']+' ('+self.year.GetValue()+'.'+self.month.GetValue()+'.'+self.day.GetValue()+'.)', mtexts.txts['Error'], wx.OK|wx.ICON_EXCLAMATION)
				dlgm.ShowModal()		
				dlgm.Destroy()
	def calc(self, event, terrestrial):
		valid, pdnum = self.getPDNum(event)

		if valid:
			y, m, d, t = astrology.swe_revjul(self.pds.pds[pdnum].time, 1)
			ho, mi, se = util.decToDeg(t)

			da = self.pds.pds[pdnum].arc
			if not self.pds.pds[pdnum].direct:
				da *= -1

			pdinch = pdsinchart.PDsInChart(self.chart, da) #self.yz, mz, dz, tz ==> chart
			pdh, pdm, pds = util.decToDeg(pdinch.tz)
			cal = chart.Time.GREGORIAN
			if self.chart.time.cal == chart.Time.JULIAN:
				cal = chart.Time.JULIAN
			tim = chart.Time(pdinch.yz, pdinch.mz, pdinch.dz, pdh, pdm, pds, self.chart.time.bc, cal, chart.Time.GREENWICH, True, 0, 0, False, self.chart.place, False)
			if not terrestrial:
				if self.options.pdincharttyp == pdsinchartdlgopts.PDsInChartsDlgOpts.FROMMUNDANEPOS:
					pdchart = chart.Chart(self.chart.name, self.chart.male, tim, self.chart.place, chart.Chart.PDINCHART, '', self.options, False)#, proftype, nolat)
					pdchartpls = chart.Chart(self.chart.name, self.chart.male, self.chart.time, self.chart.place, chart.Chart.PDINCHART, '', self.options, False)
					#modify planets ...
					if self.options.primarydir == primdirs.PrimDirs.PLACIDIANSEMIARC or self.options.primarydir == primdirs.PrimDirs.PLACIDIANUNDERTHEPOLE:
						pdchart.planets.calcMundaneProfPos(pdchart.houses.ascmc2, pdchartpls.planets.planets, self.chart.place.lat, self.chart.obl[0])
					else:
						pdchart.houses = houses.Houses(tim.jd, 0, pdchart.place.lat, pdchart.place.lon, 'R', pdchart.obl[0], self.options.ayanamsha, pdchart.ayanamsha)
						pdchart.planets.calcRegioPDsInChartsPos(pdchart.houses.ascmc2, pdchartpls.planets.planets, self.chart.place.lat, self.chart.obl[0])

					#modify lof
					if self.options.primarydir == primdirs.PrimDirs.PLACIDIANSEMIARC or self.options.primarydir == primdirs.PrimDirs.PLACIDIANUNDERTHEPOLE:
						pdchart.fortune.calcMundaneProfPos(pdchart.houses.ascmc2, pdchartpls.fortune, self.chart.place.lat, self.chart.obl[0])
					else:
						pdchart.fortune.calcRegioPDsInChartsPos(pdchart.houses.ascmc2, pdchartpls.fortune, self.chart.place.lat, self.chart.obl[0])

				elif self.options.pdincharttyp == pdsinchartdlgopts.PDsInChartsDlgOpts.FROMZODIACALPOS:
					pdchart = chart.Chart(self.chart.name, self.chart.male, tim, self.chart.place, chart.Chart.PDINCHART, '', self.options, False, chart.Chart.YEAR, True)

					pdchartpls = chart.Chart(self.chart.name, self.chart.male, self.chart.time, self.chart.place, chart.Chart.PDINCHART, '', self.options, False, chart.Chart.YEAR, True)
					#modify planets ...
					if self.options.primarydir == primdirs.PrimDirs.PLACIDIANSEMIARC or self.options.primarydir == primdirs.PrimDirs.PLACIDIANUNDERTHEPOLE:
						pdchart.planets.calcMundaneProfPos(pdchart.houses.ascmc2, pdchartpls.planets.planets, self.chart.place.lat, self.chart.obl[0])
					else:
						pdchart.houses = houses.Houses(tim.jd, 0, pdchart.place.lat, pdchart.place.lon, 'R', pdchart.obl[0], self.options.ayanamsha, pdchart.ayanamsha)
						pdchart.planets.calcRegioPDsInChartsPos(pdchart.houses.ascmc2, pdchartpls.planets.planets, self.chart.place.lat, self.chart.obl[0])

					#modify lof
					if self.options.primarydir == primdirs.PrimDirs.PLACIDIANSEMIARC or self.options.primarydir == primdirs.PrimDirs.PLACIDIANUNDERTHEPOLE:
						pdchart.fortune.calcMundaneProfPos(pdchart.houses.ascmc2, pdchartpls.fortune, self.chart.place.lat, self.chart.obl[0])
					else:
						pdchart.fortune.calcRegioPDsInChartsPos(pdchart.houses.ascmc2, pdchartpls.fortune, self.chart.place.lat, self.chart.obl[0])
	
				else:#Full Astronomical Procedure
					pdchart = chart.Chart(self.chart.name, self.chart.male, tim, self.chart.place, chart.Chart.PDINCHART, '', self.options, False)#, proftype, nolat)

					pdchartpls = chart.Chart(self.chart.name, self.chart.male, self.chart.time, self.chart.place, chart.Chart.PDINCHART, '', self.options, False)

					pdpls = pdchartpls.planets.planets
					if self.options.pdinchartsecmotion:
						pdpls = pdchart.planets.planets

					raequasc, declequasc, dist = astrology.swe_cotrans(pdchart.houses.ascmc[houses.Houses.EQUASC], 0.0, 1.0, -self.chart.obl[0])
					pdchart.planets.calcFullAstronomicalProc(da, self.chart.obl[0], pdpls, pdchart.place.lat, pdchart.houses.ascmc2, raequasc) #planets
					pdchart.fortune.calcFullAstronomicalProc(pdchartpls.fortune, da, self.chart.obl[0]) 

			else:
				if self.options.pdinchartterrsecmotion:
					pdchart = chart.Chart(self.chart.name, self.chart.male, tim, self.chart.place, chart.Chart.PDINCHART, '', self.options, False)#, proftype, nolat)
				else:
					pdchart = chart.Chart(self.chart.name, self.chart.male, self.chart.time, self.chart.place, chart.Chart.PDINCHART, '', self.options, False)#, proftype, nolat)
					raequasc, declequasc, dist = astrology.swe_cotrans(pdchart.houses.ascmc[houses.Houses.EQUASC], 0.0, 1.0, -self.chart.obl[0])
					pdchart.planets.calcMundaneWithoutSM(da, self.chart.obl[0], pdchart.place.lat, pdchart.houses.ascmc2, raequasc)

				pdchart.fortune.recalcForMundaneChart(self.chart.fortune.fortune[fortune.Fortune.LON], self.chart.fortune.fortune[fortune.Fortune.LAT], self.chart.fortune.fortune[fortune.Fortune.RA], self.chart.fortune.fortune[fortune.Fortune.DECL], pdchart.houses.ascmc2, pdchart.raequasc, pdchart.obl[0], pdchart.place.lat)


			keytxt = mtexts.typeListDyn[self.options.pdkeyd]
			if not self.options.pdkeydyn:
				keytxt = mtexts.typeListStat[self.options.pdkeys]

			return True, y, m, d, ho, mi, se, t, mtexts.typeListDirs[self.options.primarydir], keytxt, self.pds.pds[pdnum].direct, math.fabs(da), pdchart

		else:
			return False, 2000, 1, 1, 1, 1, 1, 1.0, '', '', True, 0.0, None
Beispiel #35
0
    def calcHArcWithSM(self, mundane, idprom, h, arc, aspect, asp=0.0):
        sm = secmotion.SecMotion(self.chart.time, self.chart.place, idprom,
                                 arc, self.chart.place.lat,
                                 self.chart.houses.ascmc2,
                                 self.options.topocentric)
        lonprom = sm.planet.speculums[primdirs.PrimDirs.PLACSPECULUM][
            planets.Planet.LONG]
        pllat = sm.planet.speculums[primdirs.PrimDirs.PLACSPECULUM][
            planets.Planet.LAT]
        raprom = sm.planet.speculums[primdirs.PrimDirs.PLACSPECULUM][
            planets.Planet.RA]
        dsa = sm.planet.speculums[primdirs.PrimDirs.PLACSPECULUM][
            planets.Planet.SA]
        nsa = sm.planet.speculums[primdirs.PrimDirs.PLACSPECULUM][
            planets.Planet.SA]

        if dsa < 0.0:
            dsa = 180.0 + dsa
            nsa *= -1
        else:
            nsa = 180.0 - dsa

        if not mundane:
            lonprom += asp
            lonprom = util.normalize(lonprom)
            latprom, raprom, adprom = 0.0, 0.0, 0.0
            if self.options.subzodiacal == primdirs.PrimDirs.SZPROMISSOR or self.options.subzodiacal == primdirs.PrimDirs.SZBOTH:
                latprom = 0.0
                if self.options.bianchini:
                    val = self.getBianchini(pllat, chart.Chart.Aspects[aspect])
                    if math.fabs(val) > 1.0:
                        return False, 0.0
                    latprom = math.degrees(math.asin(val))
                else:
                    latprom = pllat

                #calc real(wahre)ra and adlat
#				raprom, declprom = util.getRaDecl(lonprom, latprom, self.chart.obl[0])
                raprom, declprom, dist = astrology.swe_cotrans(
                    lonprom, latprom, 1.0, -self.chart.obl[0])
                val = math.tan(math.radians(self.chart.place.lat)) * math.tan(
                    math.radians(declprom))
                if math.fabs(val) > 1.0:
                    return False, 0.0
                adprom = math.degrees(math.asin(val))
            else:
                raprom, declprom, dist = astrology.swe_cotrans(
                    lonprom, 0.0, 1.0, -self.chart.obl[0])
                val = math.tan(math.radians(self.chart.place.lat)) * math.tan(
                    math.radians(declprom))
                if math.fabs(val) > 1.0:
                    return False, 0.0
                adprom = math.degrees(math.asin(val))

            dsa = 90.0 + adprom
            nsa = 90.0 - adprom

        #day-house, night-house length
        dh = dsa / 3.0
        nh = nsa / 3.0

        #ra rise, ra set
        rar = self.ramc + dsa
        ras = self.raic + nsa

        rar = util.normalize(rar)
        ras = util.normalize(ras)

        #ra housecusps
        rahcps = ((primdirs.PrimDir.HC2, rar + nh), (primdirs.PrimDir.HC3,
                                                     rar + 2 * nh),
                  (primdirs.PrimDir.HC5,
                   self.raic + nh), (primdirs.PrimDir.HC6, self.raic + 2 * nh),
                  (primdirs.PrimDir.HC8, ras + dh),
                  (primdirs.PrimDir.HC9, ras + 2 * dh), (primdirs.PrimDir.HC11,
                                                         self.ramc + dh),
                  (primdirs.PrimDir.HC12, self.ramc + 2 * dh))

        rahcp = rahcps[h][1]
        rahcp = util.normalize(rahcp)

        arc = raprom - rahcp

        return True, arc
Beispiel #36
0
	def calcArcWithSM(self, mundane, idprom, latprom, sig, sigasp, aspect, arc):
		sm = secmotion.SecMotion(self.chart.time, self.chart.place, idprom, arc, self.chart.place.lat, self.chart.houses.ascmc2, self.options.topocentric)
		lonprom = sm.planet.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.LONG]
		raprom = sm.planet.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.RA]
		declprom = sm.planet.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.DECL]
		if not mundane and self.options.subzodiacal != primdirs.PrimDirs.SZPROMISSOR and self.options.subzodiacal != primdirs.PrimDirs.SZBOTH:
			raprom, declprom, distprom = astrology.swe_cotrans(lonprom, 0.0, 1.0, -self.chart.obl[0])

		plsig = self.chart.planets.planets[sig]

		wprom, wsig = 0.0, 0.0
		if mundane or self.options.subzodiacal == primdirs.PrimDirs.SZSIGNIFICATOR or self.options.subzodiacal == primdirs.PrimDirs.SZBOTH: #mundane or zod with sig's latitude
			wsig = plsig.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.W]

			if sigasp == chart.Chart.CONJUNCTIO:
				val = math.tan(math.radians(declprom))*math.tan(math.radians(plsig.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.POLE]))
				if math.fabs(val) > 1.0:
					return False, 0.0
				qprom = math.degrees(math.asin(val))
				if plsig.eastern:
					wprom = raprom-qprom
				else:
					wprom = raprom+qprom
				wprom = util.normalize(wprom)
			else:
				if mundane:
					cmpap = plsig.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.CMP]+aspect
					cmpap = util.normalize(cmpap)

					zdap = math.fabs(cmpap-90.0)

					val = math.sin(math.radians(self.chart.place.lat))*math.sin(math.radians(zdap))
					if math.fabs(val) > 1.0:
						return False, 0.0
					poleap = math.degrees(math.asin(val))
					if (self.chart.place.lat < 0.0 and poleap > 0.0) or (self.chart.place.lat > 0.0 and poleap < 0.0):
						poleap *= -1

					val = math.sin(math.radians(self.chart.place.lat))*math.sin(math.radians(cmpap))
					if math.fabs(val) > 1.0:
						return False, 0.0
					declap = -math.degrees(math.asin(val))
					val = math.tan(math.radians(declap))*math.tan(math.radians(poleap))
					if math.fabs(val) > 1.0:
						return False, 0.0
					qap = math.degrees(math.asin(val))

					X = math.degrees(math.atan(math.cos(math.radians(self.chart.place.lat))*math.tan(math.radians(cmpap))))

					raap = 0.0
					if (cmpap >= 0.0 and cmpap < 90.0) or (cmpap > 270.0 and cmpap <= 360.0):
						raap = self.ramc+90.0+X
						wsig = raap-qap
					if (cmpap > 90.0 and cmpap < 270.0):
						raap = self.ramc-90.0+X
						wsig = raap+qap
					raap = util.normalize(raap)
					wsig = util.normalize(wsig)

					val = math.tan(math.radians(declprom))*math.tan(math.radians(poleap))
					if math.fabs(val) > 1.0:
						return False, 0.0
					qprom = math.degrees(math.asin(val))

					if (cmpap >= 0.0 and cmpap < 90.0) or (cmpap > 270.0 and cmpap <= 360.0):
						wprom = raprom-qprom
					if (cmpap > 90.0 and cmpap < 270.0):
						wprom = raprom+qprom
					wprom = util.normalize(wprom)
				else:#zodiacal with sig's latitude
					lonsig = plsig.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.LONG]+aspect
					lonsig = util.normalize(lonsig)
					latsig = plsig.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.LAT]

					if self.options.bianchini:
						val = self.getBianchini(latsig, chart.Chart.Aspects[sigasp])
						if math.fabs(val) > 1.0:
							return False, 0.0
						latsig = math.degrees(math.asin(val))

					ok, wsig, spole, seastern, md, umd = self.getZodW(plsig, lonsig, latsig)
					if not ok:
						return False, 0.0

					ok, wprom, ppole, seastern, md, umd = self.getZodW(plsig, lonprom, latprom, spole, seastern)
					if not ok:
						return False, 0.0
		else: #zodiacal
			lonsig = plsig.speculums[primdirs.PrimDirs.REGIOSPECULUM][planets.Planet.LONG]+aspect
			lonsig = util.normalize(lonsig)
			ok, wsig, spole, seastern, md, umd = self.getZodW(plsig, lonsig, 0.0)
			if not ok:
				return False, 0.0

			ok, wprom, ppole, seastern, md, umd = self.getZodW(plsig, lonprom, latprom, spole, seastern)
			if not ok:
				return False, 0.0

		arc = wprom-wsig

		return True, arc
Beispiel #37
0
	def create(self):
		hflag = 0
		fsflag = 0
		pflag = astrology.SEFLG_SWIEPH+astrology.SEFLG_SPEED
		astflag = astrology.SEFLG_SWIEPH
		self.ayanamsha = 0.0
		if self.options.ayanamsha != 0:
			astrology.swe_set_sid_mode(self.options.ayanamsha-1, 0, 0)
			self.ayanamsha = astrology.swe_get_ayanamsa_ut(self.time.jd)

		if self.options.topocentric:
			pflag += astrology.SEFLG_TOPOCTR

		self.houses = houses.Houses(self.time.jd, hflag, self.place.lat, self.place.lon, self.options.hsys, self.obl[0], self.options.ayanamsha, self.ayanamsha)

		self.raequasc, declequasc, dist = astrology.swe_cotrans(self.houses.ascmc[houses.Houses.EQUASC], 0.0, 1.0, -self.obl[0])
		self.planets = planets.Planets(self.time.jd, self.options.meannode, pflag, self.place.lat, self.houses.ascmc2, self.raequasc, self.nolat, self.obl[0])

		self.abovehorizonwithorb = self.isAboveHorizonWithOrb()

		abovehor = self.planets.planets[astrology.SE_SUN].abovehorizon
		if self.options.usedaynightorb:
			abovehor = self.abovehorizonwithorb

		self.fortune = fortune.Fortune(self.options.lotoffortune, self.houses.ascmc2, self.raequasc, self.planets, self.obl[0], self.place.lat, abovehor)

		self.munfortune = None
		self.parts = None
		self.fixstars = None
		self.midpoints = None
		self.riseset = None
		self.zodpars = None
		self.antiscia = None
		self.antzodpars = None
		self.cpd = None
		self.cpd2 = None
		self.syzygy = None
		self.almutens = None
		mdsun = self.planets.planets[astrology.SE_SUN].speculums[0][planets.Planet.MD]
		sasun = self.planets.planets[astrology.SE_SUN].speculums[0][planets.Planet.SA]
		if self.full:
			self.munfortune = munfortune.MundaneFortune(self.houses.ascmc2, self.planets, self.obl[0], self.place.lat)
			self.syzygy = syzygy.Syzygy(self)
			self.parts = arabicparts.ArabicParts(self.options.arabicparts, self.houses.ascmc, self.planets, self.houses, self.houses.cusps, self.fortune, self.syzygy, self.options)
			self.fixstars = fixstars.FixStars(self.time.jd, fsflag, self.options.fixstars, self.obl[0])
			self.midpoints = midpoints.MidPoints(self.planets)
			self.riseset = riseset.RiseSet(self.time.jd, self.time.cal, self.place.lon, self.place.lat, self.place.altitude, self.planets)
			self.zodpars = zodpars.ZodPars(self.planets, self.obl[0])
			self.antiscia = antiscia.Antiscia(self.planets.planets, self.houses.ascmc, self.fortune.fortune, self.obl[0], self.options.ayanamsha, self.ayanamsha)
			self.antzodpars = antzodpars.AntZodPars(self.antiscia.plantiscia, self.antiscia.plcontraant, self.obl[0])
			self.almutens = almutens.Almutens(self)
			if self.options.pdcustomer:
				self.cpd = customerpd.CustomerPD(self.options.pdcustomerlon[0], self.options.pdcustomerlon[1], self.options.pdcustomerlon[2], self.options.pdcustomerlat[0], self.options.pdcustomerlat[1], self.options.pdcustomerlat[2], self.options.pdcustomersouthern, self.place.lat, self.houses.ascmc2, self.obl[0], self.raequasc)
			if self.options.pdcustomer2:
				self.cpd2 = customerpd.CustomerPD(self.options.pdcustomer2lon[0], self.options.pdcustomer2lon[1], self.options.pdcustomer2lon[2], self.options.pdcustomer2lat[0], self.options.pdcustomer2lat[1], self.options.pdcustomer2lat[2], self.options.pdcustomer2southern, self.place.lat, self.houses.ascmc2, self.obl[0], self.raequasc)

		astrology.swe_close()

		self.calcAspMatrix()

		if self.fixstars != None:
			self.calcFixStarAspMatrix()
Beispiel #38
0
	def __init__(self, chrt):
		self.time = chrt.time
		self.lon = chrt.planets.planets[astrology.SE_MOON].data[planets.Planet.LONG]

		self.flags = astrology.SEFLG_SPEED+astrology.SEFLG_SWIEPH

		#for topical almutens
		self.lons = []

		if not chrt.time.bc:
			lonsun = chrt.planets.planets[astrology.SE_SUN].data[planets.Planet.LONG]
			lonmoon = chrt.planets.planets[astrology.SE_MOON].data[planets.Planet.LONG]

			d, m, s = util.decToDeg(lonsun)
			lonsun = d+m/60.0+s/3600.0
			d, m, s = util.decToDeg(lonmoon)
			lonmoon = d+m/60.0+s/3600.0

			diff = lonmoon-lonsun
			self.newmoon, self.ready = self.isNewMoon(diff)

			if not self.ready:
				ok, self.time, self.ready = self.getDateHour(self.time, chrt.place, self.newmoon)
				if not self.ready:
					ok, self.time, self.ready = self.getDateMinute(self.time, chrt.place, self.newmoon)
					if not self.ready:
						ok, self.time, self.ready = self.getDateSecond(self.time, chrt.place, self.newmoon)

			hses = houses.Houses(self.time.jd, 0, chrt.place.lat, chrt.place.lon, chrt.options.hsys, chrt.obl[0], chrt.options.ayanamsha, chrt.ayanamsha)
			moon = planets.Planet(self.time.jd, astrology.SE_MOON, self.flags, chrt.place.lat, hses.ascmc2)
			if self.newmoon:
				self.lon = moon.data[planets.Planet.LONG]
			else:
				if chrt.options.syzmoon == options.Options.MOON:
					self.lon = moon.data[planets.Planet.LONG]
				elif chrt.options.syzmoon == options.Options.ABOVEHOR:
					if moon.abovehorizon:
						self.lon = moon.data[planets.Planet.LONG]
					else:
						sun = planets.Planet(self.time.jd, astrology.SE_SUN, self.flags)
						self.lon = sun.data[planets.Planet.LONG]
				else:
					moon = planets.Planet(self.time.jd, astrology.SE_MOON, self.flags, chrt.place.lat, chrt.houses.ascmc2)
					if moon.abovehorizon:
						self.lon = moon.data[planets.Planet.LONG]
					else:
						sun = planets.Planet(self.time.jd, astrology.SE_SUN, self.flags)
						self.lon = sun.data[planets.Planet.LONG]

		ra, decl, dist = astrology.swe_cotrans(self.lon, 0.0, 1.0, -chrt.obl[0])
		self.speculum = [self.lon, 0.0, ra, decl]

		#the other syzygy (i.e. if the syzygy was conjunction then calculate the opposition and vice versa)
		self.lon2 = chrt.planets.planets[astrology.SE_MOON].data[planets.Planet.LONG]
		if not chrt.time.bc:
			self.time2 = self.time
			ok, self.time2, self.ready2 = self.getDateHour(self.time2, chrt.place, not self.newmoon)
			if not self.ready2:
				ok, self.time2, self.ready2 = self.getDateMinute(self.time2, chrt.place, not self.newmoon)
				if not self.ready2:
					ok, self.time2, self.ready2 = self.getDateSecond(self.time2, chrt.place, not self.newmoon)

			hses2 = houses.Houses(self.time2.jd, 0, chrt.place.lat, chrt.place.lon, chrt.options.hsys, chrt.obl[0], chrt.options.ayanamsha, chrt.ayanamsha)
			moon2 = planets.Planet(self.time2.jd, astrology.SE_MOON, self.flags, chrt.place.lat, hses2.ascmc2)
			if not self.newmoon:
				self.lon2 = moon2.data[planets.Planet.LONG]
			else:
				if chrt.options.syzmoon == options.Options.MOON:
					self.lon2 = moon2.data[planets.Planet.LONG]
				elif chrt.options.syzmoon == options.Options.ABOVEHOR:
					if moon2.abovehorizon:
						self.lon2 = moon2.data[planets.Planet.LONG]
					else:
						sun2 = planets.Planet(self.time2.jd, astrology.SE_SUN, self.flags)
						self.lon2 = sun2.data[planets.Planet.LONG]
				else:
					moon2 = planets.Planet(self.time2.jd, astrology.SE_MOON, self.flags, chrt.place.lat, chrt.houses.ascmc2)
					if moon2.abovehorizon:
						self.lon2 = moon2.data[planets.Planet.LONG]
					else:
						sun2 = planets.Planet(self.time2.jd, astrology.SE_SUN, self.flags)
						self.lon2 = sun2.data[planets.Planet.LONG]

			ra2, decl2, dist2 = astrology.swe_cotrans(self.lon2, 0.0, 1.0, -chrt.obl[0])
			self.speculum2 = [self.lon2, 0.0, ra2, decl2]

			#for topical almutens
			self.lons.append(self.lon)#Default
			if self.newmoon: #Conjunction
				self.lons.append(self.lon)
			else:
				self.lons.append(self.lon2)
			#Moon in chart of Syzygy
			hses = houses.Houses(self.time.jd, 0, chrt.place.lat, chrt.place.lon, chrt.options.hsys, chrt.obl[0], chrt.options.ayanamsha, chrt.ayanamsha)
			moonSyz = planets.Planet(self.time.jd, astrology.SE_MOON, self.flags, chrt.place.lat, hses.ascmc2)
			hses2 = houses.Houses(self.time2.jd, 0, chrt.place.lat, chrt.place.lon, chrt.options.hsys, chrt.obl[0], chrt.options.ayanamsha, chrt.ayanamsha)
			moonSyz2 = planets.Planet(self.time2.jd, astrology.SE_MOON, self.flags, chrt.place.lat, hses2.ascmc2)
			if not self.newmoon: #Opposition
				if moonSyz.abovehorizon:
					self.lons.append(moonSyz.data[planets.Planet.LONG])
				else:
					sun = planets.Planet(self.time.jd, astrology.SE_SUN, self.flags)
					self.lons.append(sun.data[planets.Planet.LONG])
			else:
				if moonSyz2.abovehorizon:
					self.lons.append(moonSyz2.data[planets.Planet.LONG])
				else:
					sun2 = planets.Planet(self.time2.jd, astrology.SE_SUN, self.flags)
					self.lons.append(sun2.data[planets.Planet.LONG])
			if not self.newmoon: #OppositionRadix
				moon = planets.Planet(self.time.jd, astrology.SE_MOON, self.flags, chrt.place.lat, chrt.houses.ascmc2)
				if moon.abovehorizon:
					self.lons.append(moon.data[planets.Planet.LONG])
				else:
					sun = planets.Planet(self.time.jd, astrology.SE_SUN, self.flags)
					self.lons.append(sun.data[planets.Planet.LONG])
			else:
				moon = planets.Planet(self.time2.jd, astrology.SE_MOON, self.flags, chrt.place.lat, chrt.houses.ascmc2)
				if moon.abovehorizon:
					self.lons.append(moon.data[planets.Planet.LONG])
				else:
					sun = planets.Planet(self.time.jd, astrology.SE_SUN, self.flags)
					self.lons.append(sun.data[planets.Planet.LONG])
			if not self.newmoon: #Opposition Moon
				self.lons.append(moonSyz.data[planets.Planet.LONG])
			else:
				self.lons.append(moonSyz2.data[planets.Planet.LONG])
	def calcZodPromAsps2HCs(self):
		'''Calclucates zodiacal directions of the aspects of promissors to housecusps'''

		NODES = 2

		SINISTER = 0
		DEXTER = 1

		for p in range(len(self.chart.planets.planets)-NODES):
			if not self.options.promplanets[p]:
				continue

			plprom = self.chart.planets.planets[p]
			pllat = plprom.speculums[primdirs.PrimDirs.PLACSPECULUM][planets.Planet.LAT]
#			raprom = plprom.speculums[primdirs.PrimDirs.PLACSPECULUM][planets.Planet.RA]
#			adprom = plprom.speculums[primdirs.PrimDirs.PLACSPECULUM][planets.Planet.ADLAT]

			for psidx in range(chart.Chart.CONJUNCTIO+1, chart.Chart.OPPOSITIO+1):
				if not self.options.pdaspects[psidx]:
					continue

				if self.abort.abort:
					return

				for k in range(DEXTER+1):
					aspect = chart.Chart.Aspects[psidx]
					if k == DEXTER:
						if psidx == chart.Chart.OPPOSITIO:
							break

						aspect *= -1

					lon = plprom.data[planets.Planet.LONG]+aspect
					lon = util.normalize(lon)
					raprom, adprom = 0.0, 0.0
					if self.options.subzodiacal == primdirs.PrimDirs.SZPROMISSOR or self.options.subzodiacal == primdirs.PrimDirs.SZBOTH:
						latprom = 0.0
						if self.options.bianchini:
							val = self.getBianchini(pllat, chart.Chart.Aspects[psidx])
							if math.fabs(val) > 1.0:
								continue
							latprom = math.degrees(math.asin(val))
						else:
							latprom = pllat

						#calc real(wahre)ra and adlat
#						raprom, declprom = util.getRaDecl(lon, latprom, self.chart.obl[0])
						raprom, declprom, dist = astrology.swe_cotrans(lon, latprom, 1.0, -self.chart.obl[0])
						val = math.tan(math.radians(self.chart.place.lat))*math.tan(math.radians(declprom))
						if math.fabs(val) > 1.0:
							continue
						adprom = math.degrees(math.asin(val))
					else:
						raprom, declprom, dist = astrology.swe_cotrans(lon, 0.0, 1.0, -self.chart.obl[0])
						val = math.tan(math.radians(self.chart.place.lat))*math.tan(math.radians(declprom))
						if math.fabs(val) > 1.0:
							continue
						adprom = math.degrees(math.asin(val))

					dsa = 90.0+adprom
					nsa = 90.0-adprom
					self.toHCs(False, p, raprom, dsa, nsa, psidx, aspect)
Beispiel #40
0
    def __init__(self, typ, ascmc2, raequasc, pls, obl, placelat,
                 abovehorizon):
        self.fortune = [0.0, 0.0, 0.0, 0.0]

        self.abovehorizon = abovehorizon

        if typ == chart.Chart.LFMOONSUN:
            diff = pls.planets[astrology.SE_MOON].data[
                planets.Planet.LONG] - pls.planets[astrology.SE_SUN].data[
                    planets.Planet.LONG]
            if diff < 0.0:
                diff += 360.0
            self.fortune[Fortune.LON] = ascmc2[houses.Houses.ASC][
                houses.Houses.LON] + diff
            if self.fortune[Fortune.LON] > 360.0:
                self.fortune[Fortune.LON] -= 360.0
        elif typ == chart.Chart.LFDSUNMOON:
            diff = 0.0
            if abovehorizon:
                diff = pls.planets[astrology.SE_SUN].data[
                    planets.Planet.LONG] - pls.planets[astrology.SE_MOON].data[
                        planets.Planet.LONG]
            else:
                diff = pls.planets[astrology.SE_MOON].data[
                    planets.Planet.LONG] - pls.planets[astrology.SE_SUN].data[
                        planets.Planet.LONG]

            if diff < 0.0:
                diff += 360.0
            self.fortune[Fortune.LON] = ascmc2[houses.Houses.ASC][
                houses.Houses.LON] + diff
            if self.fortune[Fortune.LON] > 360.0:
                self.fortune[Fortune.LON] -= 360.0
        elif typ == chart.Chart.LFDMOONSUN:
            diff = 0.0
            if abovehorizon:
                diff = pls.planets[astrology.SE_MOON].data[
                    planets.Planet.LONG] - pls.planets[astrology.SE_SUN].data[
                        planets.Planet.LONG]
            else:
                diff = pls.planets[astrology.SE_SUN].data[
                    planets.Planet.LONG] - pls.planets[astrology.SE_MOON].data[
                        planets.Planet.LONG]

            if diff < 0.0:
                diff += 360.0
            self.fortune[Fortune.LON] = ascmc2[houses.Houses.ASC][
                houses.Houses.LON] + diff
            if self.fortune[Fortune.LON] > 360.0:
                self.fortune[Fortune.LON] -= 360.0

        self.fortune[Fortune.RA], self.fortune[
            Fortune.DECL], distprom = astrology.swe_cotrans(
                self.fortune[Fortune.LON], 0.0, 1.0, -obl)

        self.speculum = placspec.PlacidianSpeculum(placelat, ascmc2,
                                                   self.fortune[Fortune.LON],
                                                   self.fortune[Fortune.LAT],
                                                   self.fortune[Fortune.RA],
                                                   self.fortune[Fortune.DECL])
        self.speculum2 = regiospec.RegiomontanianSpeculum(
            placelat, ascmc2, raequasc, self.fortune[Fortune.LON],
            self.fortune[Fortune.LAT], self.fortune[Fortune.RA],
            self.fortune[Fortune.DECL])
Beispiel #41
0
    def __init__(self, pls, ascmc, lof, obl, ayanopt, ayan):
        self.obl = obl
        self.plantiscia = []
        self.plcontraant = []
        self.lofant = None
        self.lofcontraant = None
        self.ascmcant = []
        self.ascmccontraant = []

        self.ayanopt = ayanopt
        self.ayan = ayan

        plcants = []

        for i in range(planets.Planets.PLANETS_NUM):
            ant, cant = self.calc(pls[i].data[planets.Planet.LONG])
            lat = pls[i].data[planets.Planet.LAT]
            plcants.append((cant, lat))

            #			raant, declant = util.getRaDecl(ant, lat, self.obl)
            raant, declant, dist = astrology.swe_cotrans(ant, lat, 1.0, -obl)
            self.plantiscia.append(
                Antiscion(Antiscion.ANTISCION, i, ant, lat, raant, declant))

        for i in range(planets.Planets.PLANETS_NUM):
            #			raant, declant = util.getRaDecl(plcants[i][0], plcants[i][1], self.obl)
            raant, declant, dist = astrology.swe_cotrans(
                plcants[i][0], plcants[i][1], 1.0, -obl)
            self.plcontraant.append(
                Antiscion(Antiscion.CONTRAANT, i, plcants[i][0], plcants[i][1],
                          raant, declant))

        ant, cant = self.calc(lof[fortune.Fortune.LON])
        #		lat = lof[fortune.Fortune.LAT] #=0.0
        raant, declant, dist = astrology.swe_cotrans(ant, 0.0, 1.0, -self.obl)
        self.lofant = Antiscion(Antiscion.ANTISCION, Antiscion.LOF, ant, 0.0,
                                raant, declant)
        raant, declant, dist = astrology.swe_cotrans(cant, 0.0, 1.0, -self.obl)
        self.lofcontraant = Antiscion(Antiscion.CONTRAANT, Antiscion.LOF, cant,
                                      0.0, raant, declant)

        antasc, cantasc = self.calc(ascmc[houses.Houses.ASC])
        raantasc, declantasc, dist = astrology.swe_cotrans(
            antasc, 0.0, 1.0, -self.obl)
        self.ascmcant.append(
            Antiscion(Antiscion.ANTISCION, Antiscion.ASC, antasc, 0.0,
                      raantasc, declantasc))

        antmc, cantmc = self.calc(ascmc[houses.Houses.MC])
        raantmc, declantmc, dist = astrology.swe_cotrans(
            antmc, 0.0, 1.0, -self.obl)
        self.ascmcant.append(
            Antiscion(Antiscion.ANTISCION, Antiscion.MC, antmc, 0.0, raantmc,
                      declantmc))

        raantasc, declantasc, dist = astrology.swe_cotrans(
            cantasc, 0.0, 1.0, -self.obl)
        self.ascmccontraant.append(
            Antiscion(Antiscion.CONTRAANT, Antiscion.ASC, cantasc, 0.0,
                      raantasc, declantasc))

        raantmc, declantmc, dist = astrology.swe_cotrans(
            cantmc, 0.0, 1.0, -self.obl)
        self.ascmccontraant.append(
            Antiscion(Antiscion.CONTRAANT, Antiscion.MC, cantmc, 0.0, raantmc,
                      declantmc))
Beispiel #42
0
    def calcFullAstronomicalProc(self, da, oblN, raN, declN, placelat, ascmc2,
                                 raequasc):
        #		print '**** %s ****' % pl.name
        ksi = raN + da
        ksi = util.normalize(ksi)

        #		print 'ksi=%f' % ksi
        #		print 'declN=%f' % declN

        roblN = math.radians(oblN)
        rksi = math.radians(ksi)
        rdeclN = math.radians(declN)
        longSZ = 0.0
        if ksi == 90.0:
            longSZ = 90.0
        elif ksi == 270.0:
            longSZ = 270.0
        else:
            #			print 'obl=%f' % oblN
            Fd = 0.0
            if math.cos(rksi) != 0.0:
                Fd = math.degrees(
                    math.atan(
                        (math.cos(roblN) * math.sin(rksi) +
                         math.sin(roblN) * math.tan(rdeclN)) / math.cos(rksi)))
#				print 'rFd=%f' % math.radians(Fd)

            if ksi >= 0.0 and ksi < 90.0:
                longSZ = Fd
#				print 'First ksi'
            elif ksi > 90.0 and ksi < 270.0:
                longSZ = Fd + 180.0
#				print 'Second ksi'
            elif ksi > 270.0 and ksi < 360.0:
                longSZ = Fd + 360.0
#				print 'Third ksi'

            if longSZ <= 0.0:
                #				print 'longSz<=0'
                longSZ = Fd + 360.0

        longSZ = util.normalize(longSZ)  ##
        #		print 'longSz=%f' % longSZ

        roblN = math.radians(oblN)
        rksi = math.radians(ksi)
        rdeclN = math.radians(declN)

        latSZ = math.degrees(
            math.asin(
                math.sin(rdeclN) * math.cos(roblN) -
                math.cos(rdeclN) * math.sin(rksi) * math.sin(roblN)))
        raSZ, declSZ, distSZ = astrology.swe_cotrans(longSZ, latSZ, 1.0, -oblN)

        self.data = (longSZ, latSZ, self.data[Planet.DIST],
                     self.data[Planet.SPLON], self.data[Planet.SPLAT],
                     self.data[Planet.SPDIST])
        self.dataEqu = (raSZ, declSZ, self.dataEqu[Planet.DISTEQU],
                        self.dataEqu[Planet.SPRAEQU],
                        self.dataEqu[Planet.SPDECLEQU],
                        self.dataEqu[Planet.SPDISTEQU])

        self.speculums = []
        self.computePlacidianSpeculum(placelat, ascmc2)
        self.computeRegiomontanSpeculum(placelat, ascmc2, raequasc)
Beispiel #43
0
    def __init__(self, tjd_ut, flag, geolat, geolon, hsys, obl, ayanopt, ayan):
        if hsys in Houses.hsystems:
            self.hsys = hsys
        else:
            self.hsys = hsystems[0]

        self.obl = obl

        res, self.cusps, self.ascmc = astrology.swe_houses_ex(
            tjd_ut, flag, geolat, geolon, ord(self.hsys))

        ##################
        if ayanopt != 0 and self.hsys == 'W':
            del self.cusps
            cusps = [0.0]
            sign = int(util.normalize(self.ascmc[Houses.ASC] - ayan)) / 30
            cusps.append(sign * 30.0)
            for i in range(2, Houses.HOUSE_NUM + 1):
                hc = util.normalize(cusps[i - 1] + 30.0)
                cusps.append(hc)

            #to tuple (which is a read-only list)
            self.cusps = tuple(cusps)
        ##################

        ascra, ascdecl, dist = astrology.swe_cotrans(self.ascmc[Houses.ASC],
                                                     0.0, 1.0, -obl)
        mcra, mcdecl, dist = astrology.swe_cotrans(self.ascmc[Houses.MC], 0.0,
                                                   1.0, -obl)
        self.ascmc2 = ((self.ascmc[Houses.ASC], 0.0, ascra, ascdecl),
                       (self.ascmc[Houses.MC], 0.0, mcra, mcdecl))

        #zdAsc=90.0, zdMC=0.0
        #poleAsc=lat, poleMC=0.0
        qasc = math.degrees(
            math.asin(
                math.tan(math.radians(ascdecl)) *
                math.tan(math.radians(geolat))))
        self.regioMPAsc = ascra - qasc
        self.regioMPMC = mcra

        self.cuspstmp = [[0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0],
                         [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0],
                         [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]
        for i in range(Houses.HOUSE_NUM):
            self.cuspstmp[i][0], self.cuspstmp[i][
                1], dist = astrology.swe_cotrans(self.cusps[i + 1], 0.0, dist,
                                                 -obl)

        self.cusps2 = ((self.cuspstmp[0][0],
                        self.cuspstmp[0][1]), (self.cuspstmp[1][0],
                                               self.cuspstmp[1][1]),
                       (self.cuspstmp[2][0],
                        self.cuspstmp[2][1]), (self.cuspstmp[3][0],
                                               self.cuspstmp[3][1]),
                       (self.cuspstmp[4][0],
                        self.cuspstmp[4][1]), (self.cuspstmp[5][0],
                                               self.cuspstmp[5][1]),
                       (self.cuspstmp[6][0],
                        self.cuspstmp[6][1]), (self.cuspstmp[7][0],
                                               self.cuspstmp[7][1]),
                       (self.cuspstmp[8][0],
                        self.cuspstmp[8][1]), (self.cuspstmp[9][0],
                                               self.cuspstmp[9][1]),
                       (self.cuspstmp[10][0],
                        self.cuspstmp[10][1]), (self.cuspstmp[11][0],
                                                self.cuspstmp[11][1]))
Beispiel #44
0
    def calcZodPromAsps2HCs(self):
        '''Calclucates zodiacal directions of the aspects of promissors to housecusps'''

        NODES = 2

        SINISTER = 0
        DEXTER = 1

        for p in range(len(self.chart.planets.planets) - NODES):
            if not self.options.promplanets[p]:
                continue

            plprom = self.chart.planets.planets[p]
            pllat = plprom.speculums[primdirs.PrimDirs.PLACSPECULUM][
                planets.Planet.LAT]
            #			raprom = plprom.speculums[primdirs.PrimDirs.PLACSPECULUM][planets.Planet.RA]
            #			adprom = plprom.speculums[primdirs.PrimDirs.PLACSPECULUM][planets.Planet.ADLAT]

            for psidx in range(chart.Chart.CONJUNCTIO + 1,
                               chart.Chart.OPPOSITIO + 1):
                if not self.options.pdaspects[psidx]:
                    continue

                if self.abort.abort:
                    return

                for k in range(DEXTER + 1):
                    aspect = chart.Chart.Aspects[psidx]
                    if k == DEXTER:
                        if psidx == chart.Chart.OPPOSITIO:
                            break

                        aspect *= -1

                    lon = plprom.data[planets.Planet.LONG] + aspect
                    lon = util.normalize(lon)
                    raprom, adprom = 0.0, 0.0
                    if self.options.subzodiacal == primdirs.PrimDirs.SZPROMISSOR or self.options.subzodiacal == primdirs.PrimDirs.SZBOTH:
                        latprom = 0.0
                        if self.options.bianchini:
                            val = self.getBianchini(pllat,
                                                    chart.Chart.Aspects[psidx])
                            if math.fabs(val) > 1.0:
                                continue
                            latprom = math.degrees(math.asin(val))
                        else:
                            latprom = pllat

                        #calc real(wahre)ra and adlat
#						raprom, declprom = util.getRaDecl(lon, latprom, self.chart.obl[0])
                        raprom, declprom, dist = astrology.swe_cotrans(
                            lon, latprom, 1.0, -self.chart.obl[0])
                        val = math.tan(math.radians(
                            self.chart.place.lat)) * math.tan(
                                math.radians(declprom))
                        if math.fabs(val) > 1.0:
                            continue
                        adprom = math.degrees(math.asin(val))
                    else:
                        raprom, declprom, dist = astrology.swe_cotrans(
                            lon, 0.0, 1.0, -self.chart.obl[0])
                        val = math.tan(math.radians(
                            self.chart.place.lat)) * math.tan(
                                math.radians(declprom))
                        if math.fabs(val) > 1.0:
                            continue
                        adprom = math.degrees(math.asin(val))

                    dsa = 90.0 + adprom
                    nsa = 90.0 - adprom
                    self.toHCs(False, p, raprom, dsa, nsa, psidx, aspect)