• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python util.decToDeg函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中util.decToDeg函数的典型用法代码示例。如果您正苦于以下问题:Python decToDeg函数的具体用法?Python decToDeg怎么用?Python decToDeg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了decToDeg函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: getDateSecond

	def getDateSecond(self, tim, place, newmoonorig):
		h, m, s = util.decToDeg(tim.time) 
		y, mo, d = tim.year, tim.month, tim.day
		y, mo, d, h, m = util.addMins(y, mo, d, h, m, 1)

		tim = chart.Time(y, mo, d, h, m, s, False, tim.cal, chart.Time.GREENWICH, True, 0, 0, False, place, False)

		while True:
			h, m, s = util.decToDeg(tim.time) 
			y, mo, d = tim.year, tim.month, tim.day
			y, mo, d, h, m, s = util.subtractSecs(y, mo, d, h, m, s, 1)
			if y == 0:
				y = 1
				tim = chart.Time(y, mo, d, h, m, s, False, tim.cal, chart.Time.GREENWICH, True, 0, 0, False, place, False)
				return True, tim, True

			tim = chart.Time(y, mo, d, h, m, s, False, tim.cal, chart.Time.GREENWICH, True, 0, 0, False, place, False)

			sun = planets.Planet(tim.jd, astrology.SE_SUN, self.flags)
			moon = planets.Planet(tim.jd, astrology.SE_MOON, self.flags)
			lonsun = sun.data[planets.Planet.LONG]
			lonmoon = 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
			newmoon, ready = self.isNewMoon(diff)
			if newmoon != newmoonorig or ready:
				return True, tim, ready

		return False, tim
开发者ID:roycewells,项目名称:ktz-astrology,代码行数:34,代码来源:syzygy.py


示例2: load

	def load(self, li):
		idx = 1
		for it in li:
			dirtxt = u'E'
			lon = it[geonames.Geonames.LON]
			if lon < 0.0:
				dirtxt = u'W'
				lon *= -1
			d, m, s = util.decToDeg(lon)
			lontxt = str(d).zfill(2)+dirtxt+str(m).zfill(2)

			dirtxt = u'N'
			lat = it[geonames.Geonames.LAT]
			if lat < 0.0:
				dirtxt = u'S'
				lat *= -1
			d, m, s = util.decToDeg(lat)
			lattxt = str(d).zfill(2)+dirtxt+str(m).zfill(2)

			gmtoffs = it[geonames.Geonames.GMTOFFS]
			signtxt = u'+'
			if gmtoffs < 0.0:
				signtxt = u'-'
				gmtoffs *= -1

			frac = int((gmtoffs-int(gmtoffs))*60.0)
			gmtoffstxt = signtxt+str(int(gmtoffs))+u':'+str(frac).zfill(2)

			self.placedata[idx] = (it[geonames.Geonames.NAME], it[geonames.Geonames.COUNTRYNAME], lontxt, lattxt, gmtoffstxt, str(it[geonames.Geonames.ALTITUDE]))
			idx += 1
开发者ID:roycewells,项目名称:ktz-astrology,代码行数:30,代码来源:placeslistdlg.py


示例3: printMidPoints

	def printMidPoints(self, mids):
		pls = ('Sun', 'Moon', 'Mercury', 'Venus', 'Mars', 'Jupiter', 'Saturn', 'Uranus', 'Neptune', 'Pluto', 'AscNode', 'DescNode')

		for x in mids:
			d,m,s = util.decToDeg(x.m)
			dl,ml,sl = util.decToDeg(x.lat)
			print "%s-%s: %d %d'%d\"  %d %d'%d\"" % (pls[x.p1], pls[x.p2], d,m,s, dl, ml, sl)
开发者ID:roycewells,项目名称:ktz-astrology,代码行数:7,代码来源:midpoints.py


示例4: drawline

	def drawline(self, draw, x, y, clr, idx):
		#bottom horizontal line
		draw.line((x, y+self.LINE_HEIGHT, x+self.TABLE_WIDTH, y+self.LINE_HEIGHT), fill=clr)

		#vertical lines
		offs = (0, self.SMALL_CELL_WIDTH, self.BIG_CELL_WIDTH, self.CELL_WIDTH, self.CELL_WIDTH, self.CELL_WIDTH, self.CELL_WIDTH, self.CELL_WIDTH)

		OFFS = 2
		BOR = commonwnd.CommonWnd.BORDER
		summa = 0
		txtclr = (0,0,0)
		if not self.bw:
			txtclr = self.options.clrtexts
		for i in range(self.COLUMN_NUM+OFFS):#+1 is the leftmost column
			draw.line((x+summa+offs[i], y, x+summa+offs[i], y+self.LINE_HEIGHT), fill=clr)

			d, m, s = 0, 0, 0
			if i >= fixstars.FixStars.LON+OFFS:
				d,m,s = util.decToDeg(self.chart.fixstars.data[idx][i-OFFS])

			if i == 1:
				txt = str(idx+1)+'.'
				w,h = draw.textsize(txt, self.fntText)
				draw.text((x+summa+(offs[i]-w)/2, y+(self.LINE_HEIGHT-h)/2), txt, fill=txtclr, font=self.fntText)
			elif i == fixstars.FixStars.NAME+OFFS or i == fixstars.FixStars.NOMNAME+OFFS:
				txt = self.chart.fixstars.data[idx][i-OFFS]
				w,h = draw.textsize(txt, self.fntText)
				draw.text((x+summa+(offs[i]-w)/2, y+(self.LINE_HEIGHT-h)/2), txt, fill=txtclr, font=self.fntText)
			elif i == fixstars.FixStars.LON+OFFS:
				if self.options.ayanamsha != 0:
					lona = self.chart.fixstars.data[idx][i-OFFS]-self.chart.ayanamsha
					lona = util.normalize(lona)
					d,m,s = util.decToDeg(lona)
				sign = d/chart.Chart.SIGN_DEG
				pos = d%chart.Chart.SIGN_DEG
				wsp,hsp = draw.textsize(' ', self.fntText)
				txtsign = self.signs[sign]
				wsg,hsg = draw.textsize(txtsign, self.fntMorinus)
				txt = (str(pos)).rjust(2)+self.deg_symbol+(str(m)).zfill(2)+"'"+(str(s)).zfill(2)+'"'
				w,h = draw.textsize(txt, self.fntText)
				offset = (offs[i]-(w+wsp+wsg))/2
				draw.text((x+summa+offset, y+(self.LINE_HEIGHT-h)/2), txt, fill=txtclr, font=self.fntText)
				draw.text((x+summa+offset+w+wsp, y+(self.LINE_HEIGHT-h)/2), txtsign, fill=txtclr, font=self.fntMorinus)
			elif i == fixstars.FixStars.LAT+OFFS or i == fixstars.FixStars.DECL+OFFS:
				sign = ''
				if self.chart.fixstars.data[idx][i-2] < 0.0:
					sign = '-'
				txt = sign+(str(d)).rjust(2)+self.deg_symbol+(str(m)).zfill(2)+"'"+(str(s)).zfill(2)+'"'
				w,h = draw.textsize(txt, self.fntText)
				draw.text((x+summa+(offs[i]-w)/2, y+(self.LINE_HEIGHT-h)/2), txt, fill=txtclr, font=self.fntText)
			elif i == fixstars.FixStars.RA+OFFS:
				txt = str(d)+self.deg_symbol+(str(m)).zfill(2)+"'"+(str(s)).zfill(2)+'"'
				if self.options.intime:
					d,m,s = util.decToDeg( self.chart.fixstars.data[idx][i-2]/15.0)
					txt = (str(d)).rjust(2)+':'+(str(m)).zfill(2)+":"+(str(s)).zfill(2)
				w,h = draw.textsize(txt, self.fntText)
				draw.text((x+summa+(offs[i]-w)/2, y+(self.LINE_HEIGHT-h)/2), txt, fill=txtclr, font=self.fntText)

			summa += offs[i]
开发者ID:Alwnikrotikz,项目名称:morinus-astro,代码行数:59,代码来源:fixstarswnd.py


示例5: fillFields

	def fillFields(self, it):
		self.birthplace.SetValue(it[geonames.Geonames.NAME])

		#lon
		east = True
		lon = it[geonames.Geonames.LON]
		if lon < 0.0:
			east = False
			lon *= -1
			
		d, m, s = util.decToDeg(lon)
		self.londeg.SetValue(str(d))
		self.lonmin.SetValue(str(m))
		if east:
			self.placerbE.SetValue(True)
		else:
			self.placerbW.SetValue(True)

		#lat
		north = True
		lat = it[geonames.Geonames.LAT]
		if lat < 0.0:
			north = False
			lat *= -1
			
		d, m, s = util.decToDeg(lat)
		self.latdeg.SetValue(str(d))
		self.latmin.SetValue(str(m))
		if north:
			self.placerbN.SetValue(True)
		else:
			self.placerbS.SetValue(True)

		#zone
		plus = True
		gmtoffs = it[geonames.Geonames.GMTOFFS]
		if gmtoffs < 0.0:
			plus = False
			gmtoffs *= -1

		gmtoffshour = int(gmtoffs)
		gmtoffsmin = int((gmtoffs-gmtoffshour)*60.0)

		self.zhour.SetValue(str(gmtoffshour))
		self.zminute.SetValue(str(gmtoffsmin))
		
		val = 0
		if not plus:
			val = 1
		self.pluscb.SetStringSelection(PlacesDlg.PLUSCHOICES[val])

		#altitude
		alt = int(it[geonames.Geonames.ALTITUDE])
		if alt < 0:
			alt = 0

		self.alt.SetValue(str(alt))
开发者ID:Alwnikrotikz,项目名称:morinus-astro,代码行数:57,代码来源:placesdlg.py


示例6: drawlinelof

	def drawlinelof(self, draw, x, y, name, data, clr, idx):
		#bottom horizontal line
		draw.line((x, y+self.LINE_HEIGHT, x+self.TABLE_WIDTH_ARABIAN, y+self.LINE_HEIGHT), fill=clr)

		#vertical lines
		offs = (0, self.CELL_WIDTH, self.CELL_WIDTH, self.CELL_WIDTH, self.CELL_WIDTH, self.CELL_WIDTH)

		BOR = commonwnd.CommonWnd.BORDER
		summa = 0
		txtclr = (0,0,0)
		if not self.bw:
			txtclr = self.options.clrtexts
		for i in range(self.COLUMN_NUM_ARABIAN+1+1):#+1 is the leftmost column
			draw.line((x+summa+offs[i], y, x+summa+offs[i], y+self.LINE_HEIGHT), fill=clr)

			d, m, s = 0, 0, 0
			if i > 1:
				d,m,s = util.decToDeg(data[i-2])

			if i == 1:
				w,h = draw.textsize(name, self.fntText)
				draw.text((x+summa+(offs[i]-w)/2, y+(self.LINE_HEIGHT-h)/2), name, fill=txtclr, font=self.fntText)
			elif i == 2:
				if self.options.ayanamsha != 0:
					lona = data[i-2]-self.chart.ayanamsha
					lona = util.normalize(lona)
					d,m,s = util.decToDeg(lona)

				sign = d/chart.Chart.SIGN_DEG
				pos = d%chart.Chart.SIGN_DEG
				wsp,hsp = draw.textsize(' ', self.fntText)
				txtsign = self.signs[sign]
				wsg,hsg = draw.textsize(txtsign, self.fntMorinus)
				txt = (str(pos)).rjust(2)+self.deg_symbol+(str(m)).zfill(2)+"'"+(str(s)).zfill(2)+'"'
				w,h = draw.textsize(txt, self.fntText)
				offset = (offs[i]-(w+wsp+wsg))/2
				draw.text((x+summa+offset, y+(self.LINE_HEIGHT-h)/2), txt, fill=txtclr, font=self.fntText)
				draw.text((x+summa+offset+w+wsp, y+(self.LINE_HEIGHT-h)/2), txtsign, fill=txtclr, font=self.fntMorinus)
			elif i == 3 or i == 5:
				sign = ''
				if data[i-2] < 0.0:
					sign = '-'
				txt = sign+(str(d)).rjust(2)+self.deg_symbol+(str(m)).zfill(2)+"'"+(str(s)).zfill(2)+'"'
				w,h = draw.textsize(txt, self.fntText)
				draw.text((x+summa+(offs[i]-w)/2, y+(self.LINE_HEIGHT-h)/2), txt, fill=txtclr, font=self.fntText)
			elif i == 4:
				txt = str(d)+self.deg_symbol+(str(m)).zfill(2)+"'"+(str(s)).zfill(2)+'"'
				if self.options.intime:
					d,m,s = util.decToDeg(data[i-2]/15.0)
					txt = (str(d)).rjust(2)+':'+(str(m)).zfill(2)+":"+(str(s)).zfill(2)
				w,h = draw.textsize(txt, self.fntText)
				draw.text((x+summa+(offs[i]-w)/2, y+(self.LINE_HEIGHT-h)/2), txt, fill=txtclr, font=self.fntText)

			summa += offs[i]
开发者ID:roycewells,项目名称:ktz-astrology,代码行数:54,代码来源:munposwnd.py


示例7: drawline

	def drawline(self, draw, x, y, clr, idx):
		#bottom horizontal line
		draw.line((x, y+self.LINE_HEIGHT, x+self.TABLE_WIDTH, y+self.LINE_HEIGHT), fill=clr)

		#vertical lines
		offs = (0, self.SMALL_CELL_WIDTH, self.CELL_WIDTH, self.CELL_WIDTH, self.CELL_WIDTH, self.CELL_WIDTH)

		BOR = commonwnd.CommonWnd.BORDER
		summa = 0
		for i in range(self.COLUMN_NUM+1+1):#+1 is the leftmost column
			draw.line((x+summa+offs[i], y, x+summa+offs[i], y+self.LINE_HEIGHT), fill=clr)

			tclr = (0, 0, 0)
			if not self.bw:
				if self.options.useplanetcolors:
					tclr = self.options.clrindividual[idx]
				else:
					dign = self.chart.dignity(idx)
					tclr = self.clrs[dign]

			if i == 1:
				txt = common.common.Planets[idx]
				w,h = draw.textsize(txt, self.fntMorinus)
				draw.text((x+summa+(offs[i]-w)/2, y+(self.LINE_HEIGHT-h)/2), txt, fill=tclr, font=self.fntMorinus)
			elif i != 0:
				h,m,s = util.decToDeg(self.chart.riseset.times[idx][i-2])
				txt = (str(h)).zfill(2)+':'+(str(m)).zfill(2)+':'+(str(s)).zfill(2)
				w,h = draw.textsize(txt, self.fntText)
				draw.text((x+summa+(offs[i]-w)/2, y+(self.LINE_HEIGHT-h)/2), txt, fill=tclr, font=self.fntText)

			summa += offs[i]
开发者ID:roycewells,项目名称:ktz-astrology,代码行数:31,代码来源:risesetwnd.py


示例8: drawAscMCPos

    def drawAscMCPos(self):  # Not used
        (cx, cy) = self.center.Get()
        clrpos = self.options.clrpositions
        if self.bw:
            clrpos = (0, 0, 0)
        for i in range(2):
            lon = self.chart.houses.ascmc[i]
            if self.options.ayanamsha != 0:
                lon -= self.chartRadix.ayanamsha
                lon = util.normalize(lon)

            (d, m, s) = util.decToDeg(lon)
            d = d % chart.Chart.SIGN_DEG
            # 			d, m = util.roundDeg(d%chart.Chart.SIGN_DEG, m, s)

            wdeg, hdeg = self.draw.textsize(str(d), self.fntText)
            wmin, hmin = self.draw.textsize((str(m).zfill(2)), self.fntSmallText)
            x = (
                cx
                + math.cos(
                    math.pi + math.radians(self.chart.houses.ascmc[houses.Houses.ASC] - self.chart.houses.ascmc[i])
                )
                * self.rPosAscMC
            )
            y = (
                cy
                + math.sin(
                    math.pi + math.radians(self.chart.houses.ascmc[houses.Houses.ASC] - self.chart.houses.ascmc[i])
                )
                * self.rPosAscMC
            )
            xdeg = x - wdeg / 2
            ydeg = y - hdeg / 2
            self.draw.text((xdeg, ydeg), str(d), fill=clrpos, font=self.fntText)
            self.draw.text((xdeg + wdeg, ydeg), (str(m)).zfill(2), fill=clrpos, font=self.fntSmallText)
开发者ID:Alwnikrotikz,项目名称:morinus-astro,代码行数:35,代码来源:graphchartpds.py


示例9: show

	def show(self, y, m, d, t, cnt):
		proftype = chart.Chart.YEAR
		if self.zodprofs:
			prof = profections.Profections(self.chart, y, m, d, t, cnt)
			pchart = chart.Chart(self.chart.name, self.chart.male, self.chart.time, self.chart.place, chart.Chart.PROFECTION, '', self.options, False, proftype)
			pchart.calcProfPos(prof)
		else:
			if not self.usezodprojs and (y+cnt == self.chart.time.year or (y+cnt-self.chart.time.year) % 12 == 0) and m == self.chart.time.month and d == self.chart.time.day:
				pchart = self.chart
			else:
				prof = munprofections.MunProfections(self.chart, y, m, d, t, cnt)
				proflondeg, proflonmin, proflonsec = util.decToDeg(prof.lonZ)
				profplace = chart.Place(mtexts.txts['Profections'], proflondeg, proflonmin, proflonsec, prof.east, self.chart.place.deglat, self.chart.place.minlat, self.chart.place.seclat, self.chart.place.north, self.chart.place.altitude)
				pchart = chart.Chart(self.chart.name, self.chart.male, self.chart.time, profplace, chart.Chart.PROFECTION, '', self.options, False, proftype, self.options.usezodprojsprof)
				pchartpls = chart.Chart(self.chart.name, self.chart.male, self.chart.time, self.chart.place, chart.Chart.PROFECTION, '', self.options, False, proftype, self.options.usezodprojsprof)
				#modify planets, ...
				pchart.planets.calcMundaneProfPos(pchart.houses.ascmc2, pchartpls.planets.planets, self.chart.place.lat, self.chart.obl[0])

				#modify lof
				pchart.fortune.calcMundaneProfPos(pchart.houses.ascmc2, pchartpls.fortune, self.chart.place.lat, self.chart.obl[0])

				#recalc AspMatrix
				pchart.calcAspMatrix()

		self.parent.change(pchart, self.caption, y+cnt, m, d, t)
		self.yeartxt.SetValue(str(y+cnt))
		self.monthtxt.SetValue(str(m))
		if self.zodprofs or self.usezodprojs:
			self.daytxt.SetValue(str(d))
开发者ID:Alwnikrotikz,项目名称:morinus-astro,代码行数:29,代码来源:profectionstepperdlg.py


示例10: OnAdd

	def OnAdd(self, fnd):
		datstr = str(fnd[0])+'.'+str(fnd[1])+'.'+str(fnd[2])
		h, m, s = util.decToDeg(fnd[3])
		timstr = str(h).zfill(2)+':'+str(m).zfill(2)+':'+str(s).zfill(2)
		item = [datstr, timstr]

		self.li.OnAdd(item)
开发者ID:roycewells,项目名称:ktz-astrology,代码行数:7,代码来源:findtimedlg.py


示例11: createRevolution

	def createRevolution(self, year, month, trans, num = 0):
		self.t[0] = year
		self.t[1] = month
		self.t[2] = trans.transits[num].day
		h, m, s = util.decToDeg(trans.transits[num].time)
		self.t[3] = h
		self.t[4] = m
		self.t[5] = s
开发者ID:roycewells,项目名称:ktz-astrology,代码行数:8,代码来源:revolutions.py


示例12: createTransit

	def createTransit(self, year, month, trans):
		self.t[0] = year
		self.t[1] = month
		self.t[2] = trans.transits[0].day
		h, m, s = util.decToDeg(trans.transits[0].time)
		self.t[3] = h
		self.t[4] = m
		self.t[5] = s
开发者ID:roycewells,项目名称:ktz-astrology,代码行数:8,代码来源:suntransits.py


示例13: printRiseSet

	def printRiseSet(self, pls):
		numangles = len(RiseSet.Angles)
		txt = [mtexts.txtsriseset['Rise'], mtexts.txtsriseset['MC'], mtexts.txtsriseset['Set'], mtexts.txtsriseset['IC']]
		print ''
		print 'Rise/Set times:'
		for i in range(planets.Planets.PLANETS_NUM):#Nodes are excluded
			for angle in range(numangles):
				h,m,s = util.decToDeg(self.times[i][angle])
				print "%s: %s: %02d:%02d:%02d" % (pls.planets[i].name, txt[angle], h, m, s)
开发者ID:roycewells,项目名称:ktz-astrology,代码行数:9,代码来源:riseset.py


示例14: onDecrDay

	def onDecrDay(self, event):
		h, mi, s = util.decToDeg(self.t)
		yt, mt, dt = util.decrDay(self.y+self.cnt, self.m, self.d)
		tim = chart.Time(yt, mt, dt, h, mi, s, self.chart.time.bc, self.chart.time.cal, self.chart.time.zt, self.chart.time.plus, self.chart.time.zh, self.chart.time.zm, self.chart.time.daylightsaving, self.chart.place, False)
		if tim.jd > self.chart.time.jd:
			y, self.m, self.d = util.decrDay(self.y+self.cnt, self.m, self.d)
			if y != self.y+self.cnt:
				self.cnt -=1
			self.show(self.y, self.m, self.d, self.t, self.cnt)
开发者ID:Alwnikrotikz,项目名称:morinus-astro,代码行数:9,代码来源:profectionstepperdlg.py


示例15: read

	def read(self):
		res = True

		try:
			f = open(self.fname, 'r')
			lines = f.readlines()
			f.close()

			#Count non-comment lines
			cnt = 0
			for ln in lines:
				if ln[0] == FixStars.COMMENT and ln.find('example') != -1:
					break

				if ln[0] != FixStars.COMMENT:
					cnt += 1

			for i in range(1, cnt+1):
				ret, name, dat, serr = astrology.swe_fixstar_ut(str(i), self.jd, 0)
				d, m, s = util.decToDeg(dat[0])
				sign = d/chart.Chart.SIGN_DEG
				lon = d%chart.Chart.SIGN_DEG
				lontxt = str(lon)+FixStars.signtxts[sign]+' '+(str(m)).zfill(2)+"' "+(str(s)).zfill(2)+'"'
				d, m, s = util.decToDeg(dat[1])
				si = ''
				if dat[1] < 0.0:
					si = '-'
				lattxt = si+str(d)+' '+(str(m)).zfill(2)+"' "+(str(s)).zfill(2)+'"'

				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.append(FixStars.FixStar(nam, nomnam, lontxt, lattxt))

		except IOError:
			res = False
			pass

		return res
开发者ID:Alwnikrotikz,项目名称:morinus-astro,代码行数:44,代码来源:fixstarsdlg.py


示例16: change

	def change(self, chrt, title, y, m, d, t):
		self.chart = chrt
		self.w.chart = chrt
		self.w.drawBkg()
		self.w.Refresh()

		#Update Caption
		h, mi, s = util.decToDeg(t)
		title = title.replace(mtexts.txts['Radix'], mtexts.txts['Profections']+' ('+str(y)+'.'+common.common.months[m-1]+'.'+str(d)+' '+str(h)+':'+str(mi).zfill(2)+':'+str(s).zfill(2)+')')
		self.SetTitle(title)
开发者ID:roycewells,项目名称:ktz-astrology,代码行数:10,代码来源:profectionsframe.py


示例17: drawline

	def drawline(self, draw, x, y, data, clr, idx):
		#bottom horizontal line
		draw.line((x, y+self.LINE_HEIGHT, x+self.TABLE_WIDTH, y+self.LINE_HEIGHT), fill=clr)

		#vertical lines
		offs = (0, self.CELL_WIDTH, self.CELL_WIDTH, self.CELL_WIDTH, self.CELL_WIDTH, self.CELL_WIDTH)

		BOR = commonwnd.CommonWnd.BORDER
		summa = 0
		txtclr = (0,0,0)
		if not self.bw:
			txtclr = self.options.clrtexts

		for i in range(self.COLUMN_NUM+1+1):#+1 is the leftmost column
			draw.line((x+summa+offs[i], y, x+summa+offs[i], y+self.LINE_HEIGHT), fill=clr)

			if i == arabicparts.ArabicParts.NAME:
				name = data[idx][i]
				w,h = draw.textsize(name, self.fntText)
				draw.text((x+summa+(offs[i+1]-w)/2, y+(self.LINE_HEIGHT-h)/2), data[idx][i], fill=txtclr, font=self.fntText)
			elif i == arabicparts.ArabicParts.FORMULA:
				A = mtexts.partstxts[data[idx][1][0]]
				B = mtexts.partstxts[data[idx][1][1]]
				C = mtexts.partstxts[data[idx][1][2]]

				if data[idx][arabicparts.ArabicParts.DIURNAL] and not self.chart.planets.planets[astrology.SE_SUN].abovehorizon:
					tmp = C
					C = B
					B = tmp

				formula = A+u' + '+B+u' - '+C

				w,h = draw.textsize(formula, self.fntText)
				draw.text((x+summa+self.CELL_WIDTH+(offs[i]-w)/2, y+(self.LINE_HEIGHT-h)/2), formula, fill=txtclr, font=self.fntText)
			elif i == arabicparts.ArabicParts.LONG:
				lon = data[idx][i]
				if self.options.ayanamsha != 0:
					lon = lon-self.chart.ayanamsha
					lon = util.normalize(lon)
				d,m,s = util.decToDeg(lon)

				sign = d/chart.Chart.SIGN_DEG
				pos = d%chart.Chart.SIGN_DEG
				wsp,hsp = draw.textsize(' ', self.fntText)
				txtsign = self.signs[sign]
				wsg,hsg = draw.textsize(txtsign, self.fntMorinus)
				txt = (str(pos)).rjust(2)+self.deg_symbol+(str(m)).zfill(2)+"'"+(str(s)).zfill(2)+'"'
				w,h = draw.textsize(txt, self.fntText)
				offset = (offs[i]-(w+wsp+wsg))/2
				draw.text((x+summa+offset, y+(self.LINE_HEIGHT-h)/2), txt, fill=txtclr, font=self.fntText)
				draw.text((x+summa+offset+w+wsp, y+(self.LINE_HEIGHT-h)/2), txtsign, fill=txtclr, font=self.fntMorinus)
			elif i == arabicparts.ArabicParts.DEGWINNER:
				self.drawDegWinner2(draw, x+summa, y, data[idx][i], txtclr)

			summa += offs[i]
开发者ID:Alwnikrotikz,项目名称:morinus-astro,代码行数:55,代码来源:arabicpartswnd.py


示例18: drawline

	def drawline(self, draw, x, y, clr, pcharts, age, idx):
		#bottom horizontal line
		draw.line((x, y+self.LINE_HEIGHT, x+self.TABLE_WIDTH, y+self.LINE_HEIGHT), fill=clr)

		#vertical lines
		offs = (self.CELL_WIDTH, self.BIG_CELL_WIDTH, self.BIG_CELL_WIDTH, self.BIG_CELL_WIDTH, self.BIG_CELL_WIDTH, self.BIG_CELL_WIDTH, self.BIG_CELL_WIDTH, self.BIG_CELL_WIDTH, self.BIG_CELL_WIDTH, self.BIG_CELL_WIDTH, self.BIG_CELL_WIDTH, self.BIG_CELL_WIDTH, self.BIG_CELL_WIDTH, self.BIG_CELL_WIDTH, self.BIG_CELL_WIDTH)

		BOR = commonwnd.CommonWnd.BORDER
		draw.line((x, y, x, y+self.LINE_HEIGHT), fill=clr)
		summa = 0
		for i in range(self.COLUMN_NUM):
			draw.line((x+summa+offs[i], y, x+summa+offs[i], y+self.LINE_HEIGHT), fill=clr)

			tclr = (0, 0, 0)
			if not self.bw:
				txtclr = self.options.clrtexts

			if i == ProfectionsWnd.AGE:
				txt = str(age+idx)
				w,h = draw.textsize(txt, self.fntText)
				draw.text((x+summa+(offs[i]-w)/2, y+(self.LINE_HEIGHT-h)/2), txt, fill=tclr, font=self.fntText)
			elif i == ProfectionsWnd.DATE:
				txt = str(pcharts[1])+'.'+str(pcharts[2]).zfill(2)+'.'+str(pcharts[3]).zfill(2)+'.'
				w,h = draw.textsize(txt, self.fntText)
				draw.text((x+summa+(offs[i]-w)/2, y+(self.LINE_HEIGHT-h)/2), txt, fill=tclr, font=self.fntText)
			else:
				if i == ProfectionsWnd.ASC:
					lon = pcharts[0].houses.ascmc[houses.Houses.ASC]
				if i == ProfectionsWnd.MC:
					lon = pcharts[0].houses.ascmc[houses.Houses.MC]
				if i == ProfectionsWnd.SUN:
					lon = pcharts[0].planets.planets[astrology.SE_SUN].data[planets.Planet.LONG]
				if i == ProfectionsWnd.MOON:
					lon = pcharts[0].planets.planets[astrology.SE_MOON].data[planets.Planet.LONG]
				if i == ProfectionsWnd.FORTUNE:
					lon = pcharts[0].fortune.fortune[fortune.Fortune.LON]
				if i >= ProfectionsWnd.MERCURY:
					lon = pcharts[0].planets.planets[i-5].data[planets.Planet.LONG]
				if self.options.ayanamsha != 0:
					lon -= self.chart.ayanamsha
					lon = util.normalize(lon)
				d,m,s = util.decToDeg(lon)
				sign = d/chart.Chart.SIGN_DEG
				pos = d%chart.Chart.SIGN_DEG
				wsp,hsp = draw.textsize(' ', self.fntText)
				wsg,hsg = draw.textsize(self.signs[sign], self.fntMorinus)
				txt = (str(pos)).rjust(2)+self.deg_symbol+(str(m)).zfill(2)+"'"+(str(s)).zfill(2)+'"'
				w,h = draw.textsize(txt, self.fntText)
				offset = (offs[i]-(w+wsp+wsg))/2
				draw.text((x+summa+offset, y+(self.LINE_HEIGHT-h)/2), txt, fill=tclr, font=self.fntText)
				draw.text((x+summa+offset+w+wsp, y+(self.LINE_HEIGHT-hsg)/2), self.signs[sign], fill=tclr, font=self.fntMorinus)

			summa += offs[i]
开发者ID:roycewells,项目名称:ktz-astrology,代码行数:53,代码来源:profectionswnd.py


示例19: printTransits

	def printTransits(self, ls):
		planets = ('Sun', 'Moon', 'Mercury', 'Venus', 'Mars', 'Jupiter', 'Saturn', 'Uranus', 'Neptune', 'Pluto')
		asps = ['conjunctio', 'semisextil', 'semiquadrat', 'sextil', 'quintile', 'quadrat', 'trigon', 'sesquiquadrat', 'biquintile', 'qinqunx', 'oppositio']
		signs = ['Aries', 'Taurus', 'Gemini', 'Cancer', 'Leo', 'Virgo', 'Libra', 'Scorpio', 'Sagittarius', 'Capricornus', 'Aquarius', 'Pisces']
		ascmc = ['Asc', 'MC']

		for tr in ls:
			d, m, s = util.decToDeg(tr.time)
			if tr.objtype == Transit.PLANET:
				print 'day %d: %s %s %s house:%d %d:%02d:%02d' % (tr.day, planets[tr.plt], asps[tr.aspect], planets[tr.obj], tr.house+1, d, m, s)
			elif tr.objtype == Transit.ASCMC:
				print 'day %d: %s %s %s house:%d %d:%02d:%02d' % (tr.day, planets[tr.plt], asps[tr.aspect], ascmc[tr.obj], tr.house+1, d, m, s)
			else:
				print 'day %d: %s %s house:%d %d:%02d:%02d' % (tr.day, planets[tr.plt], signs[tr.obj], tr.house+1, d, m, s)
开发者ID:Alwnikrotikz,项目名称:morinus-astro,代码行数:14,代码来源:transits.py


示例20: drawLong

	def drawLong(self, draw, x, y, lon, clr):
		if self.options.ayanamsha != 0:
			lon -= self.chart.ayanamsha
			lon = util.normalize(lon)

		d,m,s = util.decToDeg(lon)

		sign = d/chart.Chart.SIGN_DEG
		pos = d%chart.Chart.SIGN_DEG
		wsp,hsp = draw.textsize(' ', self.fntText)
		wsg,hsg = draw.textsize(self.signs[sign], self.fntMorinus)
		txt = (str(pos)).rjust(2)+self.deg_symbol+(str(m)).zfill(2)+"'"+(str(s)).zfill(2)+'"'
		w,h = draw.textsize(txt, self.fntText)
		offset = (self.LONGITUDE_CELL_WIDTH-(w+wsp+wsg))/2
		draw.text((x+offset, y+(self.LINE_HEIGHT-h)/2), txt, fill=clr, font=self.fntText)
		draw.text((x+offset+w+wsp, y+(self.LINE_HEIGHT-hsg)/2), self.signs[sign], fill=clr, font=self.fntMorinus)
开发者ID:roycewells,项目名称:ktz-astrology,代码行数:16,代码来源:almutentopicalswnd.py



注:本文中的util.decToDeg函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python util.decode函数代码示例发布时间:2022-05-27
下一篇:
Python util.debug函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap