コード例 #1
0
ファイル: regiomontanpd.py プロジェクト: kshravi86/Morinus
	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]
コード例 #2
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 = swisseph.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
コード例 #3
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 = swisseph.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 = swisseph.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
コード例 #4
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 = swisseph.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