migration: establish exact preserved app baseline
This commit is contained in:
@@ -0,0 +1 @@
|
||||
pip
|
||||
@@ -0,0 +1,20 @@
|
||||
Metadata-Version: 2.4
|
||||
Name: lunar_python
|
||||
Version: 1.4.8
|
||||
Summary: lunar is a calendar library for Solar and Chinese Lunar.
|
||||
Home-page: https://github.com/6tail/lunar-python
|
||||
Author: 6tail
|
||||
Author-email: 6tail@6tail.cn
|
||||
License: MIT
|
||||
Keywords: solar lunar
|
||||
License-File: LICENSE
|
||||
Dynamic: author
|
||||
Dynamic: author-email
|
||||
Dynamic: description
|
||||
Dynamic: home-page
|
||||
Dynamic: keywords
|
||||
Dynamic: license
|
||||
Dynamic: license-file
|
||||
Dynamic: summary
|
||||
|
||||
lunar is a calendar library for Solar and Chinese Lunar.
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
lunar_python-1.4.8.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
||||
lunar_python-1.4.8.dist-info/METADATA,sha256=_6Ni_lki-DO8oBPzS_WPS3dDC-kuWkOkn7NybXhGY4Y,501
|
||||
lunar_python-1.4.8.dist-info/RECORD,,
|
||||
lunar_python-1.4.8.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
lunar_python-1.4.8.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
|
||||
lunar_python-1.4.8.dist-info/licenses/LICENSE,sha256=qdBPR_BhXAzki9vi_1jVwXQnnZ8g8ETvKSSWMjAqSrM,1061
|
||||
lunar_python-1.4.8.dist-info/top_level.txt,sha256=BpZlCilUCMbm-cEt1bR1ujzMuWtBlnCqZncPgJZWqeg,13
|
||||
lunar_python/EightChar.py,sha256=04JB51tpPyX8jCo-FYf9AooKUsxQT51ce0cybu8FHAw,13761
|
||||
lunar_python/Foto.py,sha256=lOPnL7Yl8OYKR01CD3zrJLyo7mRyQ9fxsgFAuSOLLPg,3848
|
||||
lunar_python/FotoFestival.py,sha256=RNLRhT5HtRVbEJC4Muy2CkRvZORlS0GfRvK-kI7wN5g,946
|
||||
lunar_python/Fu.py,sha256=72HMv6hufSSB3aDg49QT3D7eHTBFUYpFtxoAxN5RilQ,768
|
||||
lunar_python/Holiday.py,sha256=EJpAB0sN1T1QNTFX-4COMFZfm4_eGY63kVPiEQEFo_I,1263
|
||||
lunar_python/JieQi.py,sha256=xNdg0xfQkFOyKN2FFha6aKVFVILyBuCKx1DKYUja9Fk,1383
|
||||
lunar_python/Lunar.py,sha256=SJoXJaK6RD-eis8FNPBaDuKMJPiQStsSnIow2qPtcHk,48684
|
||||
lunar_python/LunarMonth.py,sha256=RVnWF2ZrsArY2xYzvVkzIkJ5W4G9BJZDpkz-av9Hqyg,5419
|
||||
lunar_python/LunarTime.py,sha256=Y_Bz0wxSTMJav4xYrcwC1v6DbrofRQJUx_Ix_YED-Ro,5108
|
||||
lunar_python/LunarYear.py,sha256=hDCM8GwudmZAFna1j9vBqagUkVhLcQzZkn_V0tV5u7U,12228
|
||||
lunar_python/NineStar.py,sha256=tSwA0S1cgICifZ80r7o6jk48bnlBAz-1X7WlB6tc0ew,5148
|
||||
lunar_python/ShuJiu.py,sha256=r4UtLbWD0LCHV-vfOdEGSg5hAVBul29tAroy5L21lSo,577
|
||||
lunar_python/Solar.py,sha256=j6Pfdg9Z6pN9rnEl1JQGmF35DZIXigdB1tTC_4WybV4,14919
|
||||
lunar_python/SolarHalfYear.py,sha256=VpyYq3jhN66_QxyoVRKi4mEMY30tdH7Z_95weu6_08M,1690
|
||||
lunar_python/SolarMonth.py,sha256=85V1mAGMNRFAmc1IAw-ih8F2f2m2PdhMUd2ZnFmXgns,2196
|
||||
lunar_python/SolarSeason.py,sha256=T9rKYxw_KBEuTVV_jOiAN7Mchf0lfbWHLxCqWmjjgZI,1638
|
||||
lunar_python/SolarWeek.py,sha256=-QvDSfMdUrwlZGlXtEO4yeQdaIdLcU2UeRXRU1WIKRs,5707
|
||||
lunar_python/SolarYear.py,sha256=Zuh-20Joj8gFvP45vOSVj-gQp2_tKUqqUUQC1vYwShA,1130
|
||||
lunar_python/Tao.py,sha256=vtEbHenYOkOBAp08e1cyXv95Q6dP5Sq_aSVbo1EETzc,3803
|
||||
lunar_python/TaoFestival.py,sha256=0_yPV2x03F6DtyM9IIc_CUsj4PPioGgLVNTVRFDg-eo,597
|
||||
lunar_python/__init__.py,sha256=_dxV9rC9XMQk9Nhh2RD6k4-UvVxXYVF2cqJ58yhU9cc,638
|
||||
lunar_python/__pycache__/EightChar.cpython-314.pyc,,
|
||||
lunar_python/__pycache__/Foto.cpython-314.pyc,,
|
||||
lunar_python/__pycache__/FotoFestival.cpython-314.pyc,,
|
||||
lunar_python/__pycache__/Fu.cpython-314.pyc,,
|
||||
lunar_python/__pycache__/Holiday.cpython-314.pyc,,
|
||||
lunar_python/__pycache__/JieQi.cpython-314.pyc,,
|
||||
lunar_python/__pycache__/Lunar.cpython-314.pyc,,
|
||||
lunar_python/__pycache__/LunarMonth.cpython-314.pyc,,
|
||||
lunar_python/__pycache__/LunarTime.cpython-314.pyc,,
|
||||
lunar_python/__pycache__/LunarYear.cpython-314.pyc,,
|
||||
lunar_python/__pycache__/NineStar.cpython-314.pyc,,
|
||||
lunar_python/__pycache__/ShuJiu.cpython-314.pyc,,
|
||||
lunar_python/__pycache__/Solar.cpython-314.pyc,,
|
||||
lunar_python/__pycache__/SolarHalfYear.cpython-314.pyc,,
|
||||
lunar_python/__pycache__/SolarMonth.cpython-314.pyc,,
|
||||
lunar_python/__pycache__/SolarSeason.cpython-314.pyc,,
|
||||
lunar_python/__pycache__/SolarWeek.cpython-314.pyc,,
|
||||
lunar_python/__pycache__/SolarYear.cpython-314.pyc,,
|
||||
lunar_python/__pycache__/Tao.cpython-314.pyc,,
|
||||
lunar_python/__pycache__/TaoFestival.cpython-314.pyc,,
|
||||
lunar_python/__pycache__/__init__.cpython-314.pyc,,
|
||||
lunar_python/eightchar/DaYun.py,sha256=A5dJuSkACXvPpA6LZ7ROynt7SOyzrwzhuMVUp2LILOc,2611
|
||||
lunar_python/eightchar/LiuNian.py,sha256=oGnOyhFfDd66C3IL8-3yDIgq7IjCUUBHjUdCIYsmZ4s,1447
|
||||
lunar_python/eightchar/LiuYue.py,sha256=SqWeIyY6GzrGl5_1egq_TxXzyxCXbm4TBTCNDT-PCkY,1642
|
||||
lunar_python/eightchar/XiaoYun.py,sha256=oeoTUtuR-WfKa3fr8oJ_eJrutxXP2-RmTfyKHuUAn_0,1334
|
||||
lunar_python/eightchar/Yun.py,sha256=tTIASss4o8qn85njo9UmnFhlOPms-V5Sa-i70tMb9pY,3423
|
||||
lunar_python/eightchar/__init__.py,sha256=sup3ZkLLgn157BEQzf3PitmO7GO8j5CoPs5Ja7N4z7s,155
|
||||
lunar_python/eightchar/__pycache__/DaYun.cpython-314.pyc,,
|
||||
lunar_python/eightchar/__pycache__/LiuNian.cpython-314.pyc,,
|
||||
lunar_python/eightchar/__pycache__/LiuYue.cpython-314.pyc,,
|
||||
lunar_python/eightchar/__pycache__/XiaoYun.cpython-314.pyc,,
|
||||
lunar_python/eightchar/__pycache__/Yun.cpython-314.pyc,,
|
||||
lunar_python/eightchar/__pycache__/__init__.cpython-314.pyc,,
|
||||
lunar_python/util/FotoUtil.py,sha256=4Hp_OVCC5GxpG_ZXmglrm3F1Wu5xUtmLOom3ynQyPnQ,14678
|
||||
lunar_python/util/HolidayUtil.py,sha256=5itujXlqyN9qBYeIEz8zb0fPMgGW9F7QPMfpnvhrauY,21983
|
||||
lunar_python/util/LunarUtil.py,sha256=h6hIGKPd0Qkly7KOwEoEiyfhrEbykf9NmoYfFftZqgA,109420
|
||||
lunar_python/util/ShouXingUtil.py,sha256=UkcRC_ZjvOI-kYXMnUAilQqfe-VmSmGShsG2V0dq2dY,67277
|
||||
lunar_python/util/SolarUtil.py,sha256=u6A02JPvdOTyGUUu0UMwIIJTKZCyqvyFL3TJC_slp6M,10017
|
||||
lunar_python/util/TaoUtil.py,sha256=IOoBxByqCa_7qsDaeTuI77fhzEuzY6620e3vIRRJPe4,8061
|
||||
lunar_python/util/__init__.py,sha256=i-t6BYvPWGK1NEG-tBhVFA6O9MkU9Z7vIs-4Hx9K2PI,226
|
||||
lunar_python/util/__pycache__/FotoUtil.cpython-314.pyc,,
|
||||
lunar_python/util/__pycache__/HolidayUtil.cpython-314.pyc,,
|
||||
lunar_python/util/__pycache__/LunarUtil.cpython-314.pyc,,
|
||||
lunar_python/util/__pycache__/ShouXingUtil.cpython-314.pyc,,
|
||||
lunar_python/util/__pycache__/SolarUtil.cpython-314.pyc,,
|
||||
lunar_python/util/__pycache__/TaoUtil.cpython-314.pyc,,
|
||||
lunar_python/util/__pycache__/__init__.cpython-314.pyc,,
|
||||
@@ -0,0 +1,5 @@
|
||||
Wheel-Version: 1.0
|
||||
Generator: setuptools (83.0.0)
|
||||
Root-Is-Purelib: true
|
||||
Tag: py3-none-any
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 6tail
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1 @@
|
||||
lunar_python
|
||||
Vendored
+493
@@ -0,0 +1,493 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from .util import LunarUtil
|
||||
|
||||
|
||||
class EightChar:
|
||||
"""
|
||||
八字
|
||||
"""
|
||||
|
||||
MONTH_ZHI = ("", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥", "子", "丑")
|
||||
|
||||
CHANG_SHENG = ("长生", "沐浴", "冠带", "临官", "帝旺", "衰", "病", "死", "墓", "绝", "胎", "养")
|
||||
|
||||
__CHANG_SHENG_OFFSET = {
|
||||
"甲": 1,
|
||||
"丙": 10,
|
||||
"戊": 10,
|
||||
"庚": 7,
|
||||
"壬": 4,
|
||||
"乙": 6,
|
||||
"丁": 9,
|
||||
"己": 9,
|
||||
"辛": 0,
|
||||
"癸": 3
|
||||
}
|
||||
|
||||
def __init__(self, lunar):
|
||||
self.__sect = 2
|
||||
self.__lunar = lunar
|
||||
|
||||
@staticmethod
|
||||
def fromLunar(lunar):
|
||||
return EightChar(lunar)
|
||||
|
||||
def toString(self):
|
||||
return self.getYear() + " " + self.getMonth() + " " + self.getDay() + " " + self.getTime()
|
||||
|
||||
def __str__(self):
|
||||
return self.toString()
|
||||
|
||||
def getSect(self):
|
||||
return self.__sect
|
||||
|
||||
def setSect(self, sect):
|
||||
self.__sect = sect
|
||||
|
||||
def getYear(self):
|
||||
"""
|
||||
获取年柱
|
||||
:return: 年柱
|
||||
"""
|
||||
return self.__lunar.getYearInGanZhiExact()
|
||||
|
||||
def getYearGan(self):
|
||||
"""
|
||||
获取年干
|
||||
:return: 天干
|
||||
"""
|
||||
return self.__lunar.getYearGanExact()
|
||||
|
||||
def getYearZhi(self):
|
||||
"""
|
||||
获取年支
|
||||
:return: 地支
|
||||
"""
|
||||
return self.__lunar.getYearZhiExact()
|
||||
|
||||
def getYearHideGan(self):
|
||||
"""
|
||||
获取年柱地支藏干,由于藏干分主气、余气、杂气,所以返回结果可能为1到3个元素
|
||||
:return: 天干
|
||||
"""
|
||||
return LunarUtil.ZHI_HIDE_GAN.get(self.getYearZhi())
|
||||
|
||||
def getYearWuXing(self):
|
||||
"""
|
||||
获取年柱五行
|
||||
:return: 五行
|
||||
"""
|
||||
return LunarUtil.WU_XING_GAN.get(self.getYearGan()) + LunarUtil.WU_XING_ZHI.get(self.getYearZhi())
|
||||
|
||||
def getYearNaYin(self):
|
||||
"""
|
||||
获取年柱纳音
|
||||
:return: 纳音
|
||||
"""
|
||||
return LunarUtil.NAYIN.get(self.getYear())
|
||||
|
||||
def getYearShiShenGan(self):
|
||||
"""
|
||||
获取年柱天干十神
|
||||
:return: 十神
|
||||
"""
|
||||
return LunarUtil.SHI_SHEN.get(self.getDayGan() + self.getYearGan())
|
||||
|
||||
def __getShiShenZhi(self, zhi):
|
||||
hide_gan = LunarUtil.ZHI_HIDE_GAN.get(zhi)
|
||||
arr = []
|
||||
for gan in hide_gan:
|
||||
arr.append(LunarUtil.SHI_SHEN.get(self.getDayGan() + gan))
|
||||
return arr
|
||||
|
||||
def getYearShiShenZhi(self):
|
||||
"""
|
||||
获取年柱地支十神,由于藏干分主气、余气、杂气,所以返回结果可能为1到3个元素
|
||||
:return: 十神
|
||||
"""
|
||||
return self.__getShiShenZhi(self.getYearZhi())
|
||||
|
||||
def getDayGanIndex(self):
|
||||
return self.__lunar.getDayGanIndexExact2() if 2 == self.__sect else self.__lunar.getDayGanIndexExact()
|
||||
|
||||
def getDayZhiIndex(self):
|
||||
return self.__lunar.getDayZhiIndexExact2() if 2 == self.__sect else self.__lunar.getDayZhiIndexExact()
|
||||
|
||||
def __getDiShi(self, zhi_index):
|
||||
index = self.__CHANG_SHENG_OFFSET.get(self.getDayGan()) + (zhi_index if self.getDayGanIndex() % 2 == 0 else -zhi_index)
|
||||
if index >= 12:
|
||||
index -= 12
|
||||
if index < 0:
|
||||
index += 12
|
||||
return EightChar.CHANG_SHENG[index]
|
||||
|
||||
def getYearDiShi(self):
|
||||
"""
|
||||
获取年柱地势(长生十二神)
|
||||
:return: 地势
|
||||
"""
|
||||
return self.__getDiShi(self.__lunar.getYearZhiIndexExact())
|
||||
|
||||
def getMonth(self):
|
||||
"""
|
||||
获取月柱
|
||||
:return: 月柱
|
||||
"""
|
||||
return self.__lunar.getMonthInGanZhiExact()
|
||||
|
||||
def getMonthGan(self):
|
||||
"""
|
||||
获取月干
|
||||
:return: 天干
|
||||
"""
|
||||
return self.__lunar.getMonthGanExact()
|
||||
|
||||
def getMonthZhi(self):
|
||||
"""
|
||||
获取月支
|
||||
:return: 地支
|
||||
"""
|
||||
return self.__lunar.getMonthZhiExact()
|
||||
|
||||
def getMonthHideGan(self):
|
||||
"""
|
||||
获取月柱地支藏干,由于藏干分主气、余气、杂气,所以返回结果可能为1到3个元素
|
||||
:return: 天干
|
||||
"""
|
||||
return LunarUtil.ZHI_HIDE_GAN.get(self.getMonthZhi())
|
||||
|
||||
def getMonthWuXing(self):
|
||||
"""
|
||||
获取月柱五行
|
||||
:return: 五行
|
||||
"""
|
||||
return LunarUtil.WU_XING_GAN.get(self.getMonthGan()) + LunarUtil.WU_XING_ZHI.get(self.getMonthZhi())
|
||||
|
||||
def getMonthNaYin(self):
|
||||
"""
|
||||
获取月柱纳音
|
||||
:return: 纳音
|
||||
"""
|
||||
return LunarUtil.NAYIN.get(self.getMonth())
|
||||
|
||||
def getMonthShiShenGan(self):
|
||||
"""
|
||||
获取月柱天干十神
|
||||
:return: 十神
|
||||
"""
|
||||
return LunarUtil.SHI_SHEN.get(self.getDayGan() + self.getMonthGan())
|
||||
|
||||
def getMonthShiShenZhi(self):
|
||||
"""
|
||||
获取月柱地支十神,由于藏干分主气、余气、杂气,所以返回结果可能为1到3个元素
|
||||
:return: 十神
|
||||
"""
|
||||
return self.__getShiShenZhi(self.getMonthZhi())
|
||||
|
||||
def getMonthDiShi(self):
|
||||
"""
|
||||
获取月柱地势(长生十二神)
|
||||
:return: 地势
|
||||
"""
|
||||
return self.__getDiShi(self.__lunar.getMonthZhiIndexExact())
|
||||
|
||||
def getDay(self):
|
||||
"""
|
||||
获取日柱
|
||||
:return: 日柱
|
||||
"""
|
||||
return self.__lunar.getDayInGanZhiExact2() if 2 == self.__sect else self.__lunar.getDayInGanZhiExact()
|
||||
|
||||
def getDayGan(self):
|
||||
"""
|
||||
获取日干
|
||||
:return: 天干
|
||||
"""
|
||||
return self.__lunar.getDayGanExact2() if 2 == self.__sect else self.__lunar.getDayGanExact()
|
||||
|
||||
def getDayZhi(self):
|
||||
"""
|
||||
获取日支
|
||||
:return: 地支
|
||||
"""
|
||||
return self.__lunar.getDayZhiExact2() if 2 == self.__sect else self.__lunar.getDayZhiExact()
|
||||
|
||||
def getDayHideGan(self):
|
||||
"""
|
||||
获取日柱地支藏干,由于藏干分主气、余气、杂气,所以返回结果可能为1到3个元素
|
||||
:return: 天干
|
||||
"""
|
||||
return LunarUtil.ZHI_HIDE_GAN.get(self.getDayZhi())
|
||||
|
||||
def getDayWuXing(self):
|
||||
"""
|
||||
获取日柱五行
|
||||
:return: 五行
|
||||
"""
|
||||
return LunarUtil.WU_XING_GAN.get(self.getDayGan()) + LunarUtil.WU_XING_ZHI.get(self.getDayZhi())
|
||||
|
||||
def getDayNaYin(self):
|
||||
"""
|
||||
获取日柱纳音
|
||||
:return: 纳音
|
||||
"""
|
||||
return LunarUtil.NAYIN.get(self.getDay())
|
||||
|
||||
def getDayShiShenGan(self):
|
||||
"""
|
||||
获取日柱天干十神,也称日元、日干
|
||||
:return: 十神
|
||||
"""
|
||||
return "日主"
|
||||
|
||||
def getDayShiShenZhi(self):
|
||||
"""
|
||||
获取日柱地支十神,由于藏干分主气、余气、杂气,所以返回结果可能为1到3个元素
|
||||
:return: 十神
|
||||
"""
|
||||
return self.__getShiShenZhi(self.getDayZhi())
|
||||
|
||||
def getDayDiShi(self):
|
||||
"""
|
||||
获取日柱地势(长生十二神)
|
||||
:return: 地势
|
||||
"""
|
||||
return self.__getDiShi(self.getDayZhiIndex())
|
||||
|
||||
def getTime(self):
|
||||
"""
|
||||
获取时柱
|
||||
:return: 时柱
|
||||
"""
|
||||
return self.__lunar.getTimeInGanZhi()
|
||||
|
||||
def getTimeGan(self):
|
||||
"""
|
||||
获取时干
|
||||
:return: 天干
|
||||
"""
|
||||
return self.__lunar.getTimeGan()
|
||||
|
||||
def getTimeZhi(self):
|
||||
"""
|
||||
获取时支
|
||||
:return: 地支
|
||||
"""
|
||||
return self.__lunar.getTimeZhi()
|
||||
|
||||
def getTimeHideGan(self):
|
||||
"""
|
||||
获取时柱地支藏干,由于藏干分主气、余气、杂气,所以返回结果可能为1到3个元素
|
||||
:return: 天干
|
||||
"""
|
||||
return LunarUtil.ZHI_HIDE_GAN.get(self.getTimeZhi())
|
||||
|
||||
def getTimeWuXing(self):
|
||||
"""
|
||||
获取时柱五行
|
||||
:return: 五行
|
||||
"""
|
||||
return LunarUtil.WU_XING_GAN.get(self.getTimeGan()) + LunarUtil.WU_XING_ZHI.get(self.getTimeZhi())
|
||||
|
||||
def getTimeNaYin(self):
|
||||
"""
|
||||
获取时柱纳音
|
||||
:return: 纳音
|
||||
"""
|
||||
return LunarUtil.NAYIN.get(self.getTime())
|
||||
|
||||
def getTimeShiShenGan(self):
|
||||
"""
|
||||
获取时柱天干十神
|
||||
:return: 十神
|
||||
"""
|
||||
return LunarUtil.SHI_SHEN.get(self.getDayGan() + self.getTimeGan())
|
||||
|
||||
def getTimeShiShenZhi(self):
|
||||
"""
|
||||
获取时柱地支十神,由于藏干分主气、余气、杂气,所以返回结果可能为1到3个元素
|
||||
:return: 十神
|
||||
"""
|
||||
return self.__getShiShenZhi(self.getTimeZhi())
|
||||
|
||||
def getTimeDiShi(self):
|
||||
"""
|
||||
获取时柱地势(长生十二神)
|
||||
:return: 地势
|
||||
"""
|
||||
return self.__getDiShi(self.__lunar.getTimeZhiIndex())
|
||||
|
||||
def getTaiYuan(self):
|
||||
"""
|
||||
获取胎元
|
||||
:return: 胎元
|
||||
"""
|
||||
gan_index = self.__lunar.getMonthGanIndexExact() + 1
|
||||
if gan_index >= 10:
|
||||
gan_index -= 10
|
||||
zhi_index = self.__lunar.getMonthZhiIndexExact() + 3
|
||||
if zhi_index >= 12:
|
||||
zhi_index -= 12
|
||||
return LunarUtil.GAN[gan_index + 1] + LunarUtil.ZHI[zhi_index + 1]
|
||||
|
||||
def getTaiYuanNaYin(self):
|
||||
"""
|
||||
获取胎元纳音
|
||||
:return: 纳音
|
||||
"""
|
||||
return LunarUtil.NAYIN.get(self.getTaiYuan())
|
||||
|
||||
def getTaiXi(self):
|
||||
"""
|
||||
获取胎息
|
||||
:return: 胎息
|
||||
"""
|
||||
gan_index = self.__lunar.getDayGanIndexExact2() if 2 == self.__sect else self.__lunar.getDayGanIndexExact()
|
||||
zhi_index = self.__lunar.getDayZhiIndexExact2() if 2 == self.__sect else self.__lunar.getDayZhiIndexExact()
|
||||
return LunarUtil.HE_GAN_5[gan_index] + LunarUtil.HE_ZHI_6[zhi_index]
|
||||
|
||||
def getTaiXiNaYin(self):
|
||||
"""
|
||||
获取胎息纳音
|
||||
:return: 纳音
|
||||
"""
|
||||
return LunarUtil.NAYIN.get(self.getTaiXi())
|
||||
|
||||
def getMingGong(self):
|
||||
"""
|
||||
获取命宫
|
||||
:return: 命宫
|
||||
"""
|
||||
month_zhi_index = 0
|
||||
time_zhi_index = 0
|
||||
month_zhi = self.getMonthZhi()
|
||||
time_zhi = self.getTimeZhi()
|
||||
for i in range(0, len(EightChar.MONTH_ZHI)):
|
||||
zhi = EightChar.MONTH_ZHI[i]
|
||||
if month_zhi == zhi:
|
||||
month_zhi_index = i
|
||||
break
|
||||
for i in range(0, len(EightChar.MONTH_ZHI)):
|
||||
zhi = EightChar.MONTH_ZHI[i]
|
||||
if time_zhi == zhi:
|
||||
time_zhi_index = i
|
||||
break
|
||||
offset = month_zhi_index + time_zhi_index
|
||||
if offset >= 14:
|
||||
offset = 26 - offset
|
||||
else:
|
||||
offset = 14 - offset
|
||||
gan_index = (self.__lunar.getYearGanIndexExact() + 1) * 2 + offset
|
||||
while gan_index > 10:
|
||||
gan_index -= 10
|
||||
return LunarUtil.GAN[gan_index] + EightChar.MONTH_ZHI[offset]
|
||||
|
||||
def getMingGongNaYin(self):
|
||||
"""
|
||||
获取命宫纳音
|
||||
:return: 纳音
|
||||
"""
|
||||
return LunarUtil.NAYIN.get(self.getMingGong())
|
||||
|
||||
def getShenGong(self):
|
||||
"""
|
||||
获取身宫
|
||||
:return: 身宫
|
||||
"""
|
||||
month_zhi_index = 0
|
||||
time_zhi_index = 0
|
||||
month_zhi = self.getMonthZhi()
|
||||
time_zhi = self.getTimeZhi()
|
||||
for i in range(0, len(EightChar.MONTH_ZHI)):
|
||||
zhi = EightChar.MONTH_ZHI[i]
|
||||
if month_zhi == zhi:
|
||||
month_zhi_index = i
|
||||
break
|
||||
for i in range(0, len(LunarUtil.ZHI)):
|
||||
zhi = LunarUtil.ZHI[i]
|
||||
if time_zhi == zhi:
|
||||
time_zhi_index = i
|
||||
break
|
||||
offset = month_zhi_index + time_zhi_index
|
||||
if offset > 12:
|
||||
offset -= 12
|
||||
gan_index = (self.__lunar.getYearGanIndexExact() + 1) * 2 + offset
|
||||
while gan_index > 10:
|
||||
gan_index -= 10
|
||||
return LunarUtil.GAN[gan_index] + EightChar.MONTH_ZHI[offset]
|
||||
|
||||
def getShenGongNaYin(self):
|
||||
"""
|
||||
获取身宫纳音
|
||||
:return: 纳音
|
||||
"""
|
||||
return LunarUtil.NAYIN.get(self.getShenGong())
|
||||
|
||||
def getLunar(self):
|
||||
return self.__lunar
|
||||
|
||||
def getYun(self, gender, sect=1):
|
||||
"""
|
||||
获取运
|
||||
:param gender: 性别:1男,0女
|
||||
:param sect 流派:1按天数和时辰数计算,3天1年,1天4个月,1时辰10天;2按分钟数计算
|
||||
:return: 运
|
||||
"""
|
||||
from .eightchar import Yun
|
||||
return Yun(self, gender, sect)
|
||||
|
||||
def getYearXun(self):
|
||||
"""
|
||||
获取年柱所在旬
|
||||
:return: 旬
|
||||
"""
|
||||
return self.__lunar.getYearXunExact()
|
||||
|
||||
def getYearXunKong(self):
|
||||
"""
|
||||
获取年柱旬空(空亡)
|
||||
:return: 旬空(空亡)
|
||||
"""
|
||||
return self.__lunar.getYearXunKongExact()
|
||||
|
||||
def getMonthXun(self):
|
||||
"""
|
||||
获取月柱所在旬
|
||||
:return: 旬
|
||||
"""
|
||||
return self.__lunar.getMonthXunExact()
|
||||
|
||||
def getMonthXunKong(self):
|
||||
"""
|
||||
获取月柱旬空(空亡)
|
||||
:return: 旬空(空亡)
|
||||
"""
|
||||
return self.__lunar.getMonthXunKongExact()
|
||||
|
||||
def getDayXun(self):
|
||||
"""
|
||||
获取日柱所在旬
|
||||
:return: 旬
|
||||
"""
|
||||
return self.__lunar.getDayXunExact2() if 2 == self.__sect else self.__lunar.getDayXunExact()
|
||||
|
||||
def getDayXunKong(self):
|
||||
"""
|
||||
获取日柱旬空(空亡)
|
||||
:return: 旬空(空亡)
|
||||
"""
|
||||
return self.__lunar.getDayXunKongExact2() if 2 == self.__sect else self.__lunar.getDayXunKongExact()
|
||||
|
||||
def getTimeXun(self):
|
||||
"""
|
||||
获取时柱所在旬
|
||||
:return: 旬
|
||||
"""
|
||||
return self.__lunar.getTimeXun()
|
||||
|
||||
def getTimeXunKong(self):
|
||||
"""
|
||||
获取时柱旬空(空亡)
|
||||
:return: 旬空(空亡)
|
||||
"""
|
||||
return self.__lunar.getTimeXunKong()
|
||||
Vendored
+143
@@ -0,0 +1,143 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from . import Lunar, LunarMonth
|
||||
from .util import LunarUtil, FotoUtil
|
||||
|
||||
|
||||
class Foto:
|
||||
"""
|
||||
佛历
|
||||
"""
|
||||
|
||||
DEAD_YEAR = -543
|
||||
|
||||
def __init__(self, lunar):
|
||||
self.__lunar = lunar
|
||||
|
||||
@staticmethod
|
||||
def fromLunar(lunar):
|
||||
return Foto(lunar)
|
||||
|
||||
@staticmethod
|
||||
def fromYmdHms(year, month, day, hour, minute, second):
|
||||
return Foto.fromLunar(Lunar.fromYmdHms(year + Foto.DEAD_YEAR - 1, month, day, hour, minute, second))
|
||||
|
||||
@staticmethod
|
||||
def fromYmd(year, month, day):
|
||||
return Foto.fromYmdHms(year, month, day, 0, 0, 0)
|
||||
|
||||
def getLunar(self):
|
||||
return self.__lunar
|
||||
|
||||
def getYear(self):
|
||||
sy = self.__lunar.getSolar().getYear()
|
||||
y = sy - Foto.DEAD_YEAR
|
||||
if sy == self.__lunar.getYear():
|
||||
y += 1
|
||||
return y
|
||||
|
||||
def getMonth(self):
|
||||
return self.__lunar.getMonth()
|
||||
|
||||
def getDay(self):
|
||||
return self.__lunar.getDay()
|
||||
|
||||
def getYearInChinese(self):
|
||||
y = str(self.getYear())
|
||||
s = ""
|
||||
for i in range(0, len(y)):
|
||||
s += LunarUtil.NUMBER[ord(y[i]) - 48]
|
||||
return s
|
||||
|
||||
def getMonthInChinese(self):
|
||||
return self.__lunar.getMonthInChinese()
|
||||
|
||||
def getDayInChinese(self):
|
||||
return self.__lunar.getDayInChinese()
|
||||
|
||||
def getFestivals(self):
|
||||
festivals = []
|
||||
md = "%d-%d" % (abs(self.getMonth()), self.getDay())
|
||||
if md in FotoUtil.FESTIVAL:
|
||||
fs = FotoUtil.FESTIVAL[md]
|
||||
for f in fs:
|
||||
festivals.append(f)
|
||||
return festivals
|
||||
|
||||
def getOtherFestivals(self):
|
||||
"""
|
||||
获取纪念日
|
||||
:return: 非正式的节日列表,如中元节
|
||||
"""
|
||||
festivals = []
|
||||
key = "%d-%d" % (self.getMonth(), self.getDay())
|
||||
if key in FotoUtil.OTHER_FESTIVAL:
|
||||
for f in FotoUtil.OTHER_FESTIVAL[key]:
|
||||
festivals.append(f)
|
||||
return festivals
|
||||
|
||||
def isMonthZhai(self):
|
||||
m = self.getMonth()
|
||||
return 1 == m or 5 == m or 9 == m
|
||||
|
||||
def isDayYangGong(self):
|
||||
for f in self.getFestivals():
|
||||
if "杨公忌" == f.getName():
|
||||
return True
|
||||
return False
|
||||
|
||||
def isDayZhaiShuoWang(self):
|
||||
d = self.getDay()
|
||||
return 1 == d or 15 == d
|
||||
|
||||
def isDayZhaiSix(self):
|
||||
d = self.getDay()
|
||||
if 8 == d or 14 == d or 15 == d or 23 == d or 29 == d or 30 == d:
|
||||
return True
|
||||
elif 28 == d:
|
||||
m = LunarMonth.fromYm(self.__lunar.getYear(), self.getMonth())
|
||||
return m is not None and 30 != m.getDayCount()
|
||||
return False
|
||||
|
||||
def isDayZhaiTen(self):
|
||||
d = self.getDay()
|
||||
return 1 == d or 8 == d or 14 == d or 15 == d or 18 == d or 23 == d or 24 == d or 28 == d or 29 == d or 30 == d
|
||||
|
||||
def isDayZhaiGuanYin(self):
|
||||
k = "%d-%d" % (self.getMonth(), self.getDay())
|
||||
for d in FotoUtil.DAY_ZHAI_GUAN_YIN:
|
||||
if k == d:
|
||||
return True
|
||||
return False
|
||||
|
||||
def getXiu(self):
|
||||
return FotoUtil.getXiu(self.getMonth(), self.getDay())
|
||||
|
||||
def getXiuLuck(self):
|
||||
return LunarUtil.XIU_LUCK[self.getXiu()]
|
||||
|
||||
def getXiuSong(self):
|
||||
return LunarUtil.XIU_SONG[self.getXiu()]
|
||||
|
||||
def getZheng(self):
|
||||
return LunarUtil.ZHENG[self.getXiu()]
|
||||
|
||||
def getAnimal(self):
|
||||
return LunarUtil.ANIMAL[self.getXiu()]
|
||||
|
||||
def getGong(self):
|
||||
return LunarUtil.GONG[self.getXiu()]
|
||||
|
||||
def getShou(self):
|
||||
return LunarUtil.SHOU[self.getGong()]
|
||||
|
||||
def __str__(self):
|
||||
return self.toString()
|
||||
|
||||
def toString(self):
|
||||
return "%s年%s月%s" % (self.getYearInChinese(), self.getMonthInChinese(), self.getDayInChinese())
|
||||
|
||||
def toFullString(self):
|
||||
s = self.toString()
|
||||
for f in self.getFestivals():
|
||||
s += " (%s)" % f
|
||||
return s
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
class FotoFestival:
|
||||
"""
|
||||
佛历因果犯忌
|
||||
"""
|
||||
|
||||
def __init__(self, name, result=None, every_month=False, remark=None):
|
||||
self.__name = name
|
||||
self.__result = "" if result is None else result
|
||||
self.__everyMonth = every_month
|
||||
self.__remark = "" if remark is None else remark
|
||||
|
||||
def getName(self):
|
||||
return self.__name
|
||||
|
||||
def getResult(self):
|
||||
return self.__result
|
||||
|
||||
def isEveryMonth(self):
|
||||
return self.__everyMonth
|
||||
|
||||
def getRemark(self):
|
||||
return self.__remark
|
||||
|
||||
def __str__(self):
|
||||
return self.toString()
|
||||
|
||||
def toString(self):
|
||||
return self.__name
|
||||
|
||||
def toFullString(self):
|
||||
s = self.__name
|
||||
if self.__result is not None and len(self.__result) > 0:
|
||||
s += " " + self.__result
|
||||
if self.__remark is not None and len(self.__remark) > 0:
|
||||
s += " " + self.__remark
|
||||
return s
|
||||
Vendored
+33
@@ -0,0 +1,33 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
class Fu:
|
||||
"""
|
||||
三伏
|
||||
<p>从夏至后第3个庚日算起,初伏为10天,中伏为10天或20天,末伏为10天。当夏至与立秋之间出现4个庚日时中伏为10天,出现5个庚日则为20天。</p>
|
||||
"""
|
||||
|
||||
def __init__(self, name, index):
|
||||
self.__name = name
|
||||
self.__index = index
|
||||
|
||||
def getName(self):
|
||||
return self.__name
|
||||
|
||||
def setName(self, name):
|
||||
self.__name = name
|
||||
|
||||
def getIndex(self):
|
||||
return self.__index
|
||||
|
||||
def setIndex(self, index):
|
||||
self.__index = index
|
||||
|
||||
def __str__(self):
|
||||
return self.toString()
|
||||
|
||||
def toString(self):
|
||||
return self.__name
|
||||
|
||||
def toFullString(self):
|
||||
return "%s第%d天" % (self.__name, self.__index)
|
||||
Vendored
+52
@@ -0,0 +1,52 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
class Holiday:
|
||||
"""
|
||||
节假日
|
||||
"""
|
||||
|
||||
def __init__(self, day, name, work, target):
|
||||
"""
|
||||
初始化
|
||||
:param day: 日期,YYYY-MM-DD格式
|
||||
:param name: 名称,如:国庆
|
||||
:param work: 是否调休,即是否要上班
|
||||
:param target: 关联的节日,YYYY-MM-DD格式
|
||||
"""
|
||||
self.__day = Holiday.__ymd(day)
|
||||
self.__name = name
|
||||
self.__work = work
|
||||
self.__target = Holiday.__ymd(target)
|
||||
|
||||
@staticmethod
|
||||
def __ymd(s):
|
||||
return s if "-" in s else (s[0:4] + "-" + s[4:6] + "-" + s[6:])
|
||||
|
||||
def getDay(self):
|
||||
return self.__day
|
||||
|
||||
def getName(self):
|
||||
return self.__name
|
||||
|
||||
def isWork(self):
|
||||
return self.__work
|
||||
|
||||
def getTarget(self):
|
||||
return self.__target
|
||||
|
||||
def setDay(self, day):
|
||||
self.__day = Holiday.__ymd(day)
|
||||
|
||||
def setName(self, name):
|
||||
self.__name = name
|
||||
|
||||
def setWork(self, work):
|
||||
self.__work = work
|
||||
|
||||
def setTarget(self, target):
|
||||
self.__target = Holiday.__ymd(target)
|
||||
|
||||
def toString(self):
|
||||
return "%s %s%s %s" % (self.__day, self.__name, "调休" if self.__work else "", self.__target)
|
||||
|
||||
def __str__(self):
|
||||
return self.toString()
|
||||
Vendored
+70
@@ -0,0 +1,70 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
class JieQi:
|
||||
"""
|
||||
节气
|
||||
"""
|
||||
|
||||
def __init__(self, name, solar):
|
||||
self.__name = name
|
||||
self.__jie = False
|
||||
self.__qi = False
|
||||
self.__solar = solar
|
||||
self.setName(name)
|
||||
|
||||
def getName(self):
|
||||
"""
|
||||
获取名称
|
||||
:return: 名称
|
||||
"""
|
||||
return self.__name
|
||||
|
||||
def setName(self, name):
|
||||
"""
|
||||
设置名称
|
||||
:param name: 名称
|
||||
"""
|
||||
from . import Lunar
|
||||
self.__name = name
|
||||
for i in range(0, len(Lunar.JIE_QI)):
|
||||
if name == Lunar.JIE_QI[i]:
|
||||
if i % 2 == 0:
|
||||
self.__qi = True
|
||||
else:
|
||||
self.__jie = True
|
||||
return
|
||||
|
||||
def getSolar(self):
|
||||
"""
|
||||
获取阳历日期
|
||||
:return: 阳历日期
|
||||
"""
|
||||
return self.__solar
|
||||
|
||||
def setSolar(self, solar):
|
||||
"""
|
||||
设置阳历日期
|
||||
:param solar: 阳历日期
|
||||
"""
|
||||
self.__solar = solar
|
||||
|
||||
def isJie(self):
|
||||
"""
|
||||
是否节令
|
||||
:return: true/false
|
||||
"""
|
||||
return self.__jie
|
||||
|
||||
def isQi(self):
|
||||
"""
|
||||
是否气令
|
||||
:return: true/false
|
||||
"""
|
||||
return self.__qi
|
||||
|
||||
def toString(self):
|
||||
return self.__name
|
||||
|
||||
def __str__(self):
|
||||
return self.toString()
|
||||
Vendored
+1418
File diff suppressed because it is too large
Load Diff
+173
@@ -0,0 +1,173 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from . import Solar, LunarYear, NineStar
|
||||
from .util import LunarUtil
|
||||
|
||||
|
||||
class LunarMonth:
|
||||
"""
|
||||
农历月
|
||||
"""
|
||||
|
||||
def __init__(self, lunar_year, lunar_month, day_count, first_julian_day, index):
|
||||
self.__year = lunar_year
|
||||
self.__month = lunar_month
|
||||
self.__dayCount = day_count
|
||||
self.__firstJulianDay = first_julian_day
|
||||
self.__index = index
|
||||
self.__zhiIndex = (abs(lunar_month) - 1 + LunarUtil.BASE_MONTH_ZHI_INDEX) % 12
|
||||
|
||||
@staticmethod
|
||||
def fromYm(lunar_year, lunar_month):
|
||||
from . import LunarYear
|
||||
return LunarYear.fromYear(lunar_year).getMonth(lunar_month)
|
||||
|
||||
def getYear(self):
|
||||
return self.__year
|
||||
|
||||
def getMonth(self):
|
||||
return self.__month
|
||||
|
||||
def getIndex(self):
|
||||
return self.__index
|
||||
|
||||
def getZhiIndex(self):
|
||||
return self.__zhiIndex
|
||||
|
||||
def getGanIndex(self):
|
||||
offset = (LunarYear.fromYear(self.__year).getGanIndex() + 1) % 5 * 2
|
||||
return (abs(self.__month) - 1 + offset) % 10
|
||||
|
||||
def getGan(self):
|
||||
return LunarUtil.GAN[self.getGanIndex() + 1]
|
||||
|
||||
def getZhi(self):
|
||||
return LunarUtil.ZHI[self.getZhiIndex() + 1]
|
||||
|
||||
def getGanZhi(self):
|
||||
return "%s%s" % (self.getGan(), self.getZhi())
|
||||
|
||||
def getPositionXi(self):
|
||||
return LunarUtil.POSITION_XI[self.getGanIndex() + 1]
|
||||
|
||||
def getPositionXiDesc(self):
|
||||
return LunarUtil.POSITION_DESC[self.getPositionXi()]
|
||||
|
||||
def getPositionYangGui(self):
|
||||
return LunarUtil.POSITION_YANG_GUI[self.getGanIndex() + 1]
|
||||
|
||||
def getPositionYangGuiDesc(self):
|
||||
return LunarUtil.POSITION_DESC[self.getPositionYangGui()]
|
||||
|
||||
def getPositionYinGui(self):
|
||||
return LunarUtil.POSITION_YIN_GUI[self.getGanIndex() + 1]
|
||||
|
||||
def getPositionYinGuiDesc(self):
|
||||
return LunarUtil.POSITION_DESC[self.getPositionYinGui()]
|
||||
|
||||
def getPositionFu(self, sect=2):
|
||||
return (LunarUtil.POSITION_FU if 1 == sect else LunarUtil.POSITION_FU_2)[self.getGanIndex() + 1]
|
||||
|
||||
def getPositionFuDesc(self, sect=2):
|
||||
return LunarUtil.POSITION_DESC[self.getPositionFu(sect)]
|
||||
|
||||
def getPositionCai(self):
|
||||
return LunarUtil.POSITION_CAI[self.getGanIndex() + 1]
|
||||
|
||||
def getPositionCaiDesc(self):
|
||||
return LunarUtil.POSITION_DESC[self.getPositionCai()]
|
||||
|
||||
def isLeap(self):
|
||||
return self.__month < 0
|
||||
|
||||
def getDayCount(self):
|
||||
return self.__dayCount
|
||||
|
||||
def getFirstJulianDay(self):
|
||||
return self.__firstJulianDay
|
||||
|
||||
def getPositionTaiSui(self):
|
||||
m = abs(self.__month) % 4
|
||||
if 0 == m:
|
||||
p = "巽"
|
||||
elif 1 == m:
|
||||
p = "艮"
|
||||
elif 3 == m:
|
||||
p = "坤"
|
||||
else:
|
||||
p = LunarUtil.POSITION_GAN[Solar.fromJulianDay(self.getFirstJulianDay()).getLunar().getMonthGanIndex()]
|
||||
return p
|
||||
|
||||
def getPositionTaiSuiDesc(self):
|
||||
return LunarUtil.POSITION_DESC[self.getPositionTaiSui()]
|
||||
|
||||
def getNineStar(self):
|
||||
index = LunarYear.fromYear(self.__year).getZhiIndex() % 3
|
||||
m = abs(self.__month)
|
||||
month_zhi_index = (13 + m) % 12
|
||||
n = 27 - (index * 3)
|
||||
if month_zhi_index < LunarUtil.BASE_MONTH_ZHI_INDEX:
|
||||
n -= 3
|
||||
offset = (n - month_zhi_index) % 9
|
||||
return NineStar.fromIndex(offset)
|
||||
|
||||
def toString(self):
|
||||
return "%d年%s%s月(%d天)" % (self.__year, ("闰" if self.isLeap() else ""), LunarUtil.MONTH[abs(self.__month)], self.__dayCount)
|
||||
|
||||
def __str__(self):
|
||||
return self.toString()
|
||||
|
||||
def next(self, n):
|
||||
"""
|
||||
获取往后推几个月的阴历月,如果要往前推,则月数用负数
|
||||
:param n: 月数
|
||||
:return: 阴历月
|
||||
"""
|
||||
if 0 == n:
|
||||
return LunarMonth.fromYm(self.__year, self.__month)
|
||||
elif n > 0:
|
||||
rest = n
|
||||
ny = self.__year
|
||||
iy = ny
|
||||
im = self.__month
|
||||
index = 0
|
||||
months = LunarYear.fromYear(ny).getMonths()
|
||||
while True:
|
||||
size = len(months)
|
||||
for i in range(0, size):
|
||||
m = months[i]
|
||||
if m.getYear() == iy and m.getMonth() == im:
|
||||
index = i
|
||||
break
|
||||
more = size - index - 1
|
||||
if rest < more:
|
||||
break
|
||||
rest -= more
|
||||
last_month = months[size - 1]
|
||||
iy = last_month.getYear()
|
||||
im = last_month.getMonth()
|
||||
ny += 1
|
||||
months = LunarYear.fromYear(ny).getMonths()
|
||||
return months[index + rest]
|
||||
else:
|
||||
rest = -n
|
||||
ny = self.__year
|
||||
iy = ny
|
||||
im = self.__month
|
||||
index = 0
|
||||
months = LunarYear.fromYear(ny).getMonths()
|
||||
while True:
|
||||
size = len(months)
|
||||
for i in range(0, size):
|
||||
m = months[i]
|
||||
if m.getYear() == iy and m.getMonth() == im:
|
||||
index = i
|
||||
break
|
||||
if rest <= index:
|
||||
break
|
||||
rest -= index
|
||||
first_month = months[0]
|
||||
iy = first_month.getYear()
|
||||
im = first_month.getMonth()
|
||||
ny -= 1
|
||||
months = LunarYear.fromYear(ny).getMonths()
|
||||
return months[index - rest]
|
||||
Vendored
+171
@@ -0,0 +1,171 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from . import NineStar
|
||||
from .util import LunarUtil
|
||||
|
||||
|
||||
class LunarTime:
|
||||
"""
|
||||
时辰
|
||||
"""
|
||||
|
||||
def __init__(self, lunar_year, lunar_month, lunar_day, hour, minute, second):
|
||||
from . import Lunar
|
||||
self.__lunar = Lunar.fromYmdHms(lunar_year, lunar_month, lunar_day, hour, minute, second)
|
||||
self.__zhiIndex = LunarUtil.getTimeZhiIndex("%02d:%02d" % (hour, minute))
|
||||
self.__ganIndex = (self.__lunar.getDayGanIndexExact() % 5 * 2 + self.__zhiIndex) % 10
|
||||
|
||||
@staticmethod
|
||||
def fromYmdHms(lunar_year, lunar_month, lunar_day, hour, minute, second):
|
||||
return LunarTime(lunar_year, lunar_month, lunar_day, hour, minute, second)
|
||||
|
||||
def getGan(self):
|
||||
return LunarUtil.GAN[self.__ganIndex + 1]
|
||||
|
||||
def getZhi(self):
|
||||
return LunarUtil.ZHI[self.__zhiIndex + 1]
|
||||
|
||||
def getGanZhi(self):
|
||||
return "%s%s" % (self.getGan(), self.getZhi())
|
||||
|
||||
def getShengXiao(self):
|
||||
return LunarUtil.SHENGXIAO[self.__zhiIndex + 1]
|
||||
|
||||
def getPositionXi(self):
|
||||
return LunarUtil.POSITION_XI[self.__ganIndex + 1]
|
||||
|
||||
def getPositionXiDesc(self):
|
||||
return LunarUtil.POSITION_DESC[self.getPositionXi()]
|
||||
|
||||
def getPositionYangGui(self):
|
||||
return LunarUtil.POSITION_YANG_GUI[self.__ganIndex + 1]
|
||||
|
||||
def getPositionYangGuiDesc(self):
|
||||
return LunarUtil.POSITION_DESC[self.getPositionYangGui()]
|
||||
|
||||
def getPositionYinGui(self):
|
||||
return LunarUtil.POSITION_YIN_GUI[self.__ganIndex + 1]
|
||||
|
||||
def getPositionYinGuiDesc(self):
|
||||
return LunarUtil.POSITION_DESC[self.getPositionYinGui()]
|
||||
|
||||
def getPositionFu(self, sect=2):
|
||||
return (LunarUtil.POSITION_FU if 1 == sect else LunarUtil.POSITION_FU_2)[self.__ganIndex + 1]
|
||||
|
||||
def getPositionFuDesc(self, sect=2):
|
||||
return LunarUtil.POSITION_DESC[self.getPositionFu(sect)]
|
||||
|
||||
def getPositionCai(self):
|
||||
return LunarUtil.POSITION_CAI[self.__ganIndex + 1]
|
||||
|
||||
def getPositionCaiDesc(self):
|
||||
return LunarUtil.POSITION_DESC[self.getPositionCai()]
|
||||
|
||||
def getChong(self):
|
||||
return LunarUtil.CHONG[self.__zhiIndex]
|
||||
|
||||
def getChongGan(self):
|
||||
return LunarUtil.CHONG_GAN[self.__ganIndex]
|
||||
|
||||
def getChongGanTie(self):
|
||||
return LunarUtil.CHONG_GAN_TIE[self.__ganIndex]
|
||||
|
||||
def getChongShengXiao(self):
|
||||
chong = self.getChong()
|
||||
for i in range(0, len(LunarUtil.ZHI)):
|
||||
if LunarUtil.ZHI[i] == chong:
|
||||
return LunarUtil.SHENGXIAO[i]
|
||||
return ""
|
||||
|
||||
def getChongDesc(self):
|
||||
return "(" + self.getChongGan() + self.getChong() + ")" + self.getChongShengXiao()
|
||||
|
||||
def getSha(self):
|
||||
return LunarUtil.SHA[self.getZhi()]
|
||||
|
||||
def getNaYin(self):
|
||||
return LunarUtil.NAYIN[self.getGanZhi()]
|
||||
|
||||
def getTianShen(self):
|
||||
return LunarUtil.TIAN_SHEN[(self.__zhiIndex + LunarUtil.ZHI_TIAN_SHEN_OFFSET[self.__lunar.getDayZhiExact()]) % 12 + 1]
|
||||
|
||||
def getTianShenType(self):
|
||||
return LunarUtil.TIAN_SHEN_TYPE[self.getTianShen()]
|
||||
|
||||
def getTianShenLuck(self):
|
||||
return LunarUtil.TIAN_SHEN_TYPE_LUCK[self.getTianShenType()]
|
||||
|
||||
def getYi(self):
|
||||
"""
|
||||
获取时宜
|
||||
:return: 宜
|
||||
"""
|
||||
return LunarUtil.getTimeYi(self.__lunar.getDayInGanZhiExact(), self.getGanZhi())
|
||||
|
||||
def getJi(self):
|
||||
"""
|
||||
获取时忌
|
||||
:return: 忌
|
||||
"""
|
||||
return LunarUtil.getTimeJi(self.__lunar.getDayInGanZhiExact(), self.getGanZhi())
|
||||
|
||||
def getNineStar(self):
|
||||
solar_ymd = self.__lunar.getSolar().toYmd()
|
||||
jie_qi = self.__lunar.getJieQiTable()
|
||||
asc = False
|
||||
if jie_qi["冬至"] <= solar_ymd < jie_qi["夏至"]:
|
||||
asc = True
|
||||
start = 7 if asc else 3
|
||||
day_zhi = self.__lunar.getDayZhi()
|
||||
if day_zhi in "子午卯酉":
|
||||
start = 1 if asc else 9
|
||||
elif day_zhi in "辰戌丑未":
|
||||
start = 4 if asc else 6
|
||||
index = start + self.__zhiIndex - 1 if asc else start - self.__zhiIndex - 1
|
||||
|
||||
if index > 8:
|
||||
index -= 9
|
||||
if index < 0:
|
||||
index += 9
|
||||
return NineStar.fromIndex(index)
|
||||
|
||||
def getGanIndex(self):
|
||||
return self.__ganIndex
|
||||
|
||||
def getZhiIndex(self):
|
||||
return self.__zhiIndex
|
||||
|
||||
def __str__(self):
|
||||
return self.toString()
|
||||
|
||||
def toString(self):
|
||||
return self.getGanZhi()
|
||||
|
||||
def getXun(self):
|
||||
"""
|
||||
获取时辰所在旬
|
||||
:return: 旬
|
||||
"""
|
||||
return LunarUtil.getXun(self.getGanZhi())
|
||||
|
||||
def getXunKong(self):
|
||||
"""
|
||||
获取值时空亡
|
||||
:return: 空亡(旬空)
|
||||
"""
|
||||
return LunarUtil.getXunKong(self.getGanZhi())
|
||||
|
||||
def getMinHm(self):
|
||||
hour = self.__lunar.getHour()
|
||||
if hour < 1:
|
||||
return "00:00"
|
||||
elif hour > 22:
|
||||
return "23:00"
|
||||
return "%02d:00" % (hour - 1 if hour % 2 == 0 else hour)
|
||||
|
||||
def getMaxHm(self):
|
||||
hour = self.__lunar.getHour()
|
||||
if hour < 1:
|
||||
return "00:59"
|
||||
elif hour > 22:
|
||||
return "23:59"
|
||||
return "%02d:59" % (hour + 1 if hour % 2 != 0 else hour)
|
||||
Vendored
+333
@@ -0,0 +1,333 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import threading
|
||||
from math import floor
|
||||
from . import Solar, NineStar
|
||||
from .util import ShouXingUtil, LunarUtil
|
||||
|
||||
|
||||
class LunarYear:
|
||||
"""
|
||||
农历年
|
||||
"""
|
||||
|
||||
YUAN = ("下", "上", "中")
|
||||
|
||||
YUN = ("七", "八", "九", "一", "二", "三", "四", "五", "六")
|
||||
|
||||
__LEAP_11 = (75, 94, 170, 265, 322, 398, 469, 553, 583, 610, 678, 735, 754, 773, 849, 887, 936, 1050, 1069, 1126, 1145, 1164, 1183, 1259, 1278, 1308, 1373, 1403, 1441, 1460, 1498, 1555, 1593, 1612, 1631, 1642, 2033, 2128, 2147, 2242, 2614, 2728, 2910, 3062, 3244, 3339, 3616, 3711, 3730, 3825, 4007, 4159, 4197, 4322, 4341, 4379, 4417, 4531, 4599, 4694, 4713, 4789, 4808, 4971, 5085, 5104, 5161, 5180, 5199, 5294, 5305, 5476, 5677, 5696, 5772, 5791, 5848, 5886, 6049, 6068, 6144, 6163, 6258, 6402, 6440, 6497, 6516, 6630, 6641, 6660, 6679, 6736, 6774, 6850, 6869, 6899, 6918, 6994, 7013, 7032, 7051, 7070, 7089, 7108, 7127, 7146, 7222, 7271, 7290, 7309, 7366, 7385, 7404, 7442, 7461, 7480, 7491, 7499, 7594, 7624, 7643, 7662, 7681, 7719, 7738, 7814, 7863, 7882, 7901, 7939, 7958, 7977, 7996,
|
||||
8034, 8053, 8072, 8091, 8121, 8159, 8186, 8216, 8235, 8254, 8273, 8311, 8330, 8341, 8349, 8368, 8444, 8463, 8474, 8493, 8531, 8569, 8588, 8626, 8664, 8683, 8694, 8702, 8713, 8721, 8751, 8789, 8808, 8816, 8827, 8846, 8884, 8903, 8922, 8941, 8971, 9036, 9066, 9085, 9104, 9123, 9142, 9161, 9180, 9199, 9218, 9256, 9294, 9313, 9324, 9343, 9362, 9381, 9419, 9438, 9476, 9514, 9533, 9544, 9552, 9563, 9571, 9582, 9601, 9639, 9658, 9666, 9677, 9696, 9734, 9753, 9772, 9791, 9802, 9821, 9886, 9897, 9916, 9935, 9954, 9973, 9992)
|
||||
|
||||
__LEAP_12 = (37, 56, 113, 132, 151, 189, 208, 227, 246, 284, 303, 341, 360, 379, 417, 436, 458, 477, 496, 515, 534, 572, 591, 629, 648, 667, 697, 716, 792, 811, 830, 868, 906, 925, 944, 963, 982, 1001, 1020, 1039, 1058, 1088, 1153, 1202, 1221, 1240, 1297, 1335, 1392, 1411, 1422, 1430, 1517, 1525, 1536, 1574, 3358, 3472, 3806, 3988, 4751, 4941, 5066, 5123, 5275, 5343, 5438, 5457, 5495, 5533, 5552, 5715, 5810, 5829, 5905, 5924, 6421, 6535, 6793, 6812, 6888, 6907, 7002, 7184, 7260, 7279, 7374, 7556, 7746, 7757, 7776, 7833, 7852, 7871, 7966, 8015, 8110, 8129, 8148, 8224, 8243, 8338, 8406, 8425, 8482, 8501, 8520, 8558, 8596, 8607, 8615, 8645, 8740, 8778, 8835, 8865, 8930, 8960, 8979, 8998, 9017, 9055, 9074, 9093, 9112, 9150, 9188, 9237, 9275, 9332, 9351, 9370, 9408, 9427, 9446, 9457, 9465,
|
||||
9495, 9560, 9590, 9628, 9647, 9685, 9715, 9742, 9780, 9810, 9818, 9829, 9848, 9867, 9905, 9924, 9943, 9962, 10000)
|
||||
|
||||
__CACHE_YEAR = None
|
||||
|
||||
__lock = threading.Lock()
|
||||
|
||||
def __init__(self, lunar_year):
|
||||
self.__year = lunar_year
|
||||
offset = lunar_year - 4
|
||||
year_gan_index = offset % 10
|
||||
year_zhi_index = offset % 12
|
||||
if year_gan_index < 0:
|
||||
year_gan_index += 10
|
||||
if year_zhi_index < 0:
|
||||
year_zhi_index += 12
|
||||
self.__ganIndex = year_gan_index
|
||||
self.__zhiIndex = year_zhi_index
|
||||
self.__months = []
|
||||
self.__jieQiJulianDays = []
|
||||
self.compute()
|
||||
|
||||
@staticmethod
|
||||
def fromYear(lunar_year):
|
||||
LunarYear.__lock.acquire()
|
||||
if LunarYear.__CACHE_YEAR is None or LunarYear.__CACHE_YEAR.getYear() != lunar_year:
|
||||
y = LunarYear(lunar_year)
|
||||
LunarYear.__CACHE_YEAR = y
|
||||
else:
|
||||
y = LunarYear.__CACHE_YEAR
|
||||
LunarYear.__lock.release()
|
||||
return y
|
||||
|
||||
def compute(self):
|
||||
from . import Lunar, Solar, LunarMonth
|
||||
# 节气
|
||||
jq = []
|
||||
# 合朔,即每月初一
|
||||
hs = []
|
||||
# 每月天数,长度15
|
||||
day_counts = []
|
||||
# 月份
|
||||
months = []
|
||||
|
||||
current_year = self.__year
|
||||
jd = floor((current_year - 2000) * 365.2422 + 180)
|
||||
# 355是2000.12冬至,得到较靠近jd的冬至估计值
|
||||
w = floor((jd - 355 + 183) / 365.2422) * 365.2422 + 355
|
||||
if ShouXingUtil.calcQi(w) > jd:
|
||||
w -= 365.2422
|
||||
# 25个节气时刻(北京时间),从冬至开始到下一个冬至以后
|
||||
for i in range(0, 26):
|
||||
jq.append(ShouXingUtil.calcQi(w + 15.2184 * i))
|
||||
|
||||
# 从上年的大雪到下年的立春 精确的节气
|
||||
for i in range(0, len(Lunar.JIE_QI_IN_USE)):
|
||||
if i == 0:
|
||||
jd = ShouXingUtil.qiAccurate2(jq[0] - 15.2184)
|
||||
elif i <= 26:
|
||||
jd = ShouXingUtil.qiAccurate2(jq[i - 1])
|
||||
else:
|
||||
jd = ShouXingUtil.qiAccurate2(jq[25] + 15.2184 * (i - 26))
|
||||
self.__jieQiJulianDays.append(jd + Solar.J2000)
|
||||
|
||||
# 冬至前的初一,今年"首朔"的日月黄经差w
|
||||
w = ShouXingUtil.calcShuo(jq[0])
|
||||
if w > jq[0]:
|
||||
w -= 29.53
|
||||
# 递推每月初一
|
||||
for i in range(0, 16):
|
||||
hs.append(ShouXingUtil.calcShuo(w + 29.5306 * i))
|
||||
# 每月
|
||||
for i in range(0, 15):
|
||||
day_counts.append(int(hs[i + 1] - hs[i]))
|
||||
months.append(i)
|
||||
|
||||
prev_year = current_year - 1
|
||||
leap_index = 16
|
||||
|
||||
if current_year in LunarYear.__LEAP_11:
|
||||
leap_index = 13
|
||||
elif current_year in LunarYear.__LEAP_12:
|
||||
leap_index = 14
|
||||
elif hs[13] <= jq[24]:
|
||||
i = 1
|
||||
while hs[i + 1] > jq[2 * i] and i < 13:
|
||||
i += 1
|
||||
leap_index = i
|
||||
for j in range(leap_index, 15):
|
||||
months[j] -= 1
|
||||
ymc = [11, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
|
||||
|
||||
fm = -1
|
||||
index = -1
|
||||
y = prev_year
|
||||
for i in range(0, 15):
|
||||
dm = hs[i] + Solar.J2000
|
||||
v2 = months[i]
|
||||
mc = ymc[v2 % 12]
|
||||
if 1724360 <= dm < 1729794:
|
||||
mc = ymc[(v2 + 1) % 12]
|
||||
elif 1807724 <= dm < 1808699:
|
||||
mc = ymc[(v2 + 1) % 12]
|
||||
elif dm == 1729794 or dm == 1808699:
|
||||
mc = 12
|
||||
if fm == -1:
|
||||
fm = mc
|
||||
index = mc
|
||||
if mc < fm:
|
||||
y += 1
|
||||
index = 1
|
||||
fm = mc
|
||||
if i == leap_index:
|
||||
mc = -mc
|
||||
elif dm == 1729794 or dm == 1808699:
|
||||
mc = -11
|
||||
self.__months.append(LunarMonth(y, mc, day_counts[i], dm, index))
|
||||
index += 1
|
||||
|
||||
def getYear(self):
|
||||
return self.__year
|
||||
|
||||
def getGanIndex(self):
|
||||
return self.__ganIndex
|
||||
|
||||
def getZhiIndex(self):
|
||||
return self.__zhiIndex
|
||||
|
||||
def getGan(self):
|
||||
return LunarUtil.GAN[self.__ganIndex + 1]
|
||||
|
||||
def getZhi(self):
|
||||
return LunarUtil.ZHI[self.__zhiIndex + 1]
|
||||
|
||||
def getGanZhi(self):
|
||||
return "%s%s" % (self.getGan(), self.getZhi())
|
||||
|
||||
def toString(self):
|
||||
return str(self.__year) + ""
|
||||
|
||||
def toFullString(self):
|
||||
return "%d年" % self.__year
|
||||
|
||||
def __str__(self):
|
||||
return self.toString()
|
||||
|
||||
def getDayCount(self):
|
||||
n = 0
|
||||
for m in self.__months:
|
||||
if m.getYear() == self.__year:
|
||||
n += m.getDayCount()
|
||||
return n
|
||||
|
||||
def getMonthsInYear(self):
|
||||
months = []
|
||||
for m in self.__months:
|
||||
if m.getYear() == self.__year:
|
||||
months.append(m)
|
||||
return months
|
||||
|
||||
def getMonths(self):
|
||||
return self.__months
|
||||
|
||||
def getJieQiJulianDays(self):
|
||||
return self.__jieQiJulianDays
|
||||
|
||||
def getLeapMonth(self):
|
||||
"""
|
||||
获取闰月
|
||||
:return: 闰月数字,1代表闰1月,0代表无闰月
|
||||
"""
|
||||
for m in self.__months:
|
||||
if m.getYear() == self.__year and m.isLeap():
|
||||
return abs(m.getMonth())
|
||||
return 0
|
||||
|
||||
def getMonth(self, lunar_month):
|
||||
"""
|
||||
获取农历月
|
||||
:param lunar_month: 闰月数字,1代表闰1月,0代表无闰月
|
||||
:return: 农历月
|
||||
"""
|
||||
for m in self.__months:
|
||||
if m.getYear() == self.__year and m.getMonth() == lunar_month:
|
||||
return m
|
||||
return None
|
||||
|
||||
def __getZaoByGan(self, index, name):
|
||||
offset = index - Solar.fromJulianDay(self.getMonth(1).getFirstJulianDay()).getLunar().getDayGanIndex()
|
||||
if offset < 0:
|
||||
offset += 10
|
||||
return name.replace("几", LunarUtil.NUMBER[offset + 1], 1)
|
||||
|
||||
def __getZaoByZhi(self, index, name):
|
||||
offset = index - Solar.fromJulianDay(self.getMonth(1).getFirstJulianDay()).getLunar().getDayZhiIndex()
|
||||
if offset < 0:
|
||||
offset += 12
|
||||
return name.replace("几", LunarUtil.NUMBER[offset + 1], 1)
|
||||
|
||||
def getTouLiang(self):
|
||||
return self.__getZaoByZhi(0, "几鼠偷粮")
|
||||
|
||||
def getCaoZi(self):
|
||||
return self.__getZaoByZhi(0, "草子几分")
|
||||
|
||||
def getGengTian(self):
|
||||
"""
|
||||
获取耕田(正月第一个丑日是初几,就是几牛耕田)
|
||||
:return: 耕田,如:六牛耕田
|
||||
"""
|
||||
return self.__getZaoByZhi(1, "几牛耕田")
|
||||
|
||||
def getHuaShou(self):
|
||||
return self.__getZaoByZhi(3, "花收几分")
|
||||
|
||||
def getZhiShui(self):
|
||||
"""
|
||||
获取治水(正月第一个辰日是初几,就是几龙治水)
|
||||
:return: 治水,如:二龙治水
|
||||
"""
|
||||
return self.__getZaoByZhi(4, "几龙治水")
|
||||
|
||||
def getTuoGu(self):
|
||||
return self.__getZaoByZhi(6, "几马驮谷")
|
||||
|
||||
def getQiangMi(self):
|
||||
return self.__getZaoByZhi(9, "几鸡抢米")
|
||||
|
||||
def getKanCan(self):
|
||||
return self.__getZaoByZhi(9, "几姑看蚕")
|
||||
|
||||
def getGongZhu(self):
|
||||
return self.__getZaoByZhi(11, "几屠共猪")
|
||||
|
||||
def getJiaTian(self):
|
||||
return self.__getZaoByGan(0, "甲田几分")
|
||||
|
||||
def getFenBing(self):
|
||||
"""
|
||||
获取分饼(正月第一个丙日是初几,就是几人分饼)
|
||||
:return: 分饼,如:六人分饼
|
||||
"""
|
||||
return self.__getZaoByGan(2, "几人分饼")
|
||||
|
||||
def getDeJin(self):
|
||||
"""
|
||||
获取得金(正月第一个辛日是初几,就是几日得金)
|
||||
:return: 得金,如:一日得金
|
||||
"""
|
||||
return self.__getZaoByGan(7, "几日得金")
|
||||
|
||||
def getRenBing(self):
|
||||
return self.__getZaoByGan(2, self.__getZaoByZhi(2, "几人几丙"))
|
||||
|
||||
def getRenChu(self):
|
||||
return self.__getZaoByGan(3, self.__getZaoByZhi(2, "几人几锄"))
|
||||
|
||||
def getYuan(self):
|
||||
return LunarYear.YUAN[int((self.__year + 2696) / 60) % 3] + "元"
|
||||
|
||||
def getYun(self):
|
||||
return LunarYear.YUN[int((self.__year + 2696) / 20) % 9] + "运"
|
||||
|
||||
def getNineStar(self):
|
||||
index = LunarUtil.getJiaZiIndex(self.getGanZhi()) + 1
|
||||
yuan = int((self.__year + 2696) / 60) % 3
|
||||
offset = (62 + yuan * 3 - index) % 9
|
||||
if 0 == offset:
|
||||
offset = 9
|
||||
return NineStar.fromIndex(offset - 1)
|
||||
|
||||
def getPositionXi(self):
|
||||
return LunarUtil.POSITION_XI[self.__ganIndex + 1]
|
||||
|
||||
def getPositionXiDesc(self):
|
||||
return LunarUtil.POSITION_DESC[self.getPositionXi()]
|
||||
|
||||
def getPositionYangGui(self):
|
||||
return LunarUtil.POSITION_YANG_GUI[self.__ganIndex + 1]
|
||||
|
||||
def getPositionYangGuiDesc(self):
|
||||
return LunarUtil.POSITION_DESC[self.getPositionYangGui()]
|
||||
|
||||
def getPositionYinGui(self):
|
||||
return LunarUtil.POSITION_YIN_GUI[self.__ganIndex + 1]
|
||||
|
||||
def getPositionYinGuiDesc(self):
|
||||
return LunarUtil.POSITION_DESC[self.getPositionYinGui()]
|
||||
|
||||
def getPositionFu(self, sect=2):
|
||||
return (LunarUtil.POSITION_FU if 1 == sect else LunarUtil.POSITION_FU_2)[self.__ganIndex + 1]
|
||||
|
||||
def getPositionFuDesc(self, sect=2):
|
||||
return LunarUtil.POSITION_DESC[self.getPositionFu(sect)]
|
||||
|
||||
def getPositionCai(self):
|
||||
return LunarUtil.POSITION_CAI[self.__ganIndex + 1]
|
||||
|
||||
def getPositionCaiDesc(self):
|
||||
return LunarUtil.POSITION_DESC[self.getPositionCai()]
|
||||
|
||||
def getPositionTaiSui(self):
|
||||
return LunarUtil.POSITION_TAI_SUI_YEAR[self.__zhiIndex]
|
||||
|
||||
def getPositionTaiSuiDesc(self):
|
||||
return LunarUtil.POSITION_DESC[self.getPositionTaiSui()]
|
||||
|
||||
def next(self, n):
|
||||
"""
|
||||
获取往后推几年的阴历年,如果要往前推,则年数用负数
|
||||
:param n: 年数
|
||||
:return: 阴历年
|
||||
"""
|
||||
return LunarYear.fromYear(self.__year + n)
|
||||
Vendored
+115
@@ -0,0 +1,115 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from .util import LunarUtil
|
||||
|
||||
|
||||
class NineStar:
|
||||
"""
|
||||
九星
|
||||
"""
|
||||
|
||||
NUMBER = ("一", "二", "三", "四", "五", "六", "七", "八", "九")
|
||||
COLOR = ("白", "黑", "碧", "绿", "黄", "白", "赤", "白", "紫")
|
||||
WU_XING = ("水", "土", "木", "木", "土", "金", "金", "土", "火")
|
||||
POSITION = ("坎", "坤", "震", "巽", "中", "乾", "兑", "艮", "离")
|
||||
NAME_BEI_DOU = ("天枢", "天璇", "天玑", "天权", "玉衡", "开阳", "摇光", "洞明", "隐元")
|
||||
NAME_XUAN_KONG = ("贪狼", "巨门", "禄存", "文曲", "廉贞", "武曲", "破军", "左辅", "右弼")
|
||||
NAME_QI_MEN = ("天蓬", "天芮", "天冲", "天辅", "天禽", "天心", "天柱", "天任", "天英")
|
||||
BA_MEN_QI_MEN = ("休", "死", "伤", "杜", "", "开", "惊", "生", "景")
|
||||
NAME_TAI_YI = ("太乙", "摄提", "轩辕", "招摇", "天符", "青龙", "咸池", "太阴", "天乙")
|
||||
TYPE_TAI_YI = ("吉神", "凶神", "安神", "安神", "凶神", "吉神", "凶神", "吉神", "吉神")
|
||||
SONG_TAI_YI = ("门中太乙明,星官号贪狼,赌彩财喜旺,婚姻大吉昌,出入无阻挡,参谒见贤良,此行三五里,黑衣别阴阳。", "门前见摄提,百事必忧疑,相生犹自可,相克祸必临,死门并相会,老妇哭悲啼,求谋并吉事,尽皆不相宜,只可藏隐遁,若动伤身疾。", "出入会轩辕,凡事必缠牵,相生全不美,相克更忧煎,远行多不利,博彩尽输钱,九天玄女法,句句不虚言。", "招摇号木星,当之事莫行,相克行人阻,阴人口舌迎,梦寐多惊惧,屋响斧自鸣,阴阳消息理,万法弗违情。", "五鬼为天符,当门阴女谋,相克无好事,行路阻中途,走失难寻觅,道逢有尼姑,此星当门值,万事有灾除。", "神光跃青龙,财气喜重重,投入有酒食,赌彩最兴隆,更逢相生旺,休言克破凶,见贵安营寨,万事总吉同。", "吾将为咸池,当之尽不宜,出入多不利,相克有灾情,赌彩全输尽,求财空手回,仙人真妙语,愚人莫与知,动用虚惊退,反复逆风吹。", "坐临太阴星,百祸不相侵,求谋悉成就,知交有觅寻,回风归来路,恐有殃伏起,密语中记取,慎乎莫轻行。", "迎来天乙星,相逢百事兴,运用和合庆,茶酒喜相迎,求谋并嫁娶,好合有天成,祸福如神验,吉凶甚分明。")
|
||||
LUCK_XUAN_KONG = ("吉", "凶", "凶", "吉", "凶", "吉", "凶", "吉", "吉")
|
||||
LUCK_QI_MEN = ("大凶", "大凶", "小吉", "大吉", "大吉", "大吉", "小凶", "小吉", "小凶")
|
||||
YIN_YANG_QI_MEN = ("阳", "阴", "阳", "阳", "阳", "阴", "阴", "阳", "阴")
|
||||
|
||||
def __init__(self, index):
|
||||
self.__index = index
|
||||
|
||||
@staticmethod
|
||||
def fromIndex(index):
|
||||
return NineStar(index)
|
||||
|
||||
def getNumber(self):
|
||||
return NineStar.NUMBER[self.__index]
|
||||
|
||||
def getColor(self):
|
||||
return NineStar.COLOR[self.__index]
|
||||
|
||||
def getWuXing(self):
|
||||
return NineStar.WU_XING[self.__index]
|
||||
|
||||
def getPosition(self):
|
||||
return NineStar.POSITION[self.__index]
|
||||
|
||||
def getPositionDesc(self):
|
||||
return LunarUtil.POSITION_DESC[self.getPosition()]
|
||||
|
||||
def getNameInXuanKong(self):
|
||||
return NineStar.NAME_XUAN_KONG[self.__index]
|
||||
|
||||
def getNameInBeiDou(self):
|
||||
return NineStar.NAME_BEI_DOU[self.__index]
|
||||
|
||||
def getNameInQiMen(self):
|
||||
return NineStar.NAME_QI_MEN[self.__index]
|
||||
|
||||
def getNameInTaiYi(self):
|
||||
return NineStar.NAME_TAI_YI[self.__index]
|
||||
|
||||
def getLuckInQiMen(self):
|
||||
return NineStar.LUCK_QI_MEN[self.__index]
|
||||
|
||||
def getLuckInXuanKong(self):
|
||||
return NineStar.LUCK_XUAN_KONG[self.__index]
|
||||
|
||||
def getYinYangInQiMen(self):
|
||||
return NineStar.YIN_YANG_QI_MEN[self.__index]
|
||||
|
||||
def getTypeInTaiYi(self):
|
||||
return NineStar.TYPE_TAI_YI[self.__index]
|
||||
|
||||
def getBaMenInQiMen(self):
|
||||
return NineStar.BA_MEN_QI_MEN[self.__index]
|
||||
|
||||
def getSongInTaiYi(self):
|
||||
return NineStar.SONG_TAI_YI[self.__index]
|
||||
|
||||
def getIndex(self):
|
||||
return self.__index
|
||||
|
||||
def __str__(self):
|
||||
return self.toString()
|
||||
|
||||
def toString(self):
|
||||
return self.getNumber() + self.getColor() + self.getWuXing() + self.getNameInBeiDou()
|
||||
|
||||
def toFullString(self):
|
||||
s = self.getNumber()
|
||||
s += self.getColor()
|
||||
s += self.getWuXing()
|
||||
s += " "
|
||||
s += self.getPosition()
|
||||
s += "("
|
||||
s += self.getPositionDesc()
|
||||
s += ") "
|
||||
s += self.getNameInBeiDou()
|
||||
s += " 玄空["
|
||||
s += self.getNameInXuanKong()
|
||||
s += " "
|
||||
s += self.getLuckInXuanKong()
|
||||
s += "] 奇门["
|
||||
s += self.getNameInQiMen()
|
||||
s += " "
|
||||
s += self.getLuckInQiMen()
|
||||
if len(self.getBaMenInQiMen()) > 0:
|
||||
s += " "
|
||||
s += self.getBaMenInQiMen()
|
||||
s += "门"
|
||||
s += " "
|
||||
s += self.getYinYangInQiMen()
|
||||
s += "] 太乙["
|
||||
s += self.getNameInTaiYi()
|
||||
s += " "
|
||||
s += self.getTypeInTaiYi()
|
||||
s += "]"
|
||||
return s
|
||||
Vendored
+32
@@ -0,0 +1,32 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
class ShuJiu:
|
||||
"""
|
||||
数九
|
||||
"""
|
||||
|
||||
def __init__(self, name, index):
|
||||
self.__name = name
|
||||
self.__index = index
|
||||
|
||||
def getName(self):
|
||||
return self.__name
|
||||
|
||||
def setName(self, name):
|
||||
self.__name = name
|
||||
|
||||
def getIndex(self):
|
||||
return self.__index
|
||||
|
||||
def setIndex(self, index):
|
||||
self.__index = index
|
||||
|
||||
def __str__(self):
|
||||
return self.toString()
|
||||
|
||||
def toString(self):
|
||||
return self.__name
|
||||
|
||||
def toFullString(self):
|
||||
return "%s第%d天" % (self.__name, self.__index)
|
||||
Vendored
+465
@@ -0,0 +1,465 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from datetime import datetime
|
||||
from math import ceil
|
||||
|
||||
from .util import SolarUtil, LunarUtil, HolidayUtil
|
||||
|
||||
|
||||
class Solar:
|
||||
"""
|
||||
阳历日期
|
||||
"""
|
||||
|
||||
# 2000年儒略日数(2000-1-1 12:00:00 UTC)
|
||||
J2000 = 2451545
|
||||
|
||||
def __init__(self, year, month, day, hour, minute, second):
|
||||
if year == 1582 and month == 10:
|
||||
if 4 < day < 15:
|
||||
raise Exception("wrong solar year %d month %d day %d" % (year, month, day))
|
||||
if month < 1 or month > 12:
|
||||
raise Exception("wrong month %d" % month)
|
||||
if day < 1 or month > 31:
|
||||
raise Exception("wrong day %d" % day)
|
||||
if hour < 0 or hour > 23:
|
||||
raise Exception("wrong hour %d" % hour)
|
||||
if minute < 0 or minute > 59:
|
||||
raise Exception("wrong minute %d" % minute)
|
||||
if second < 0 or second > 59:
|
||||
raise Exception("wrong second %d" % second)
|
||||
self.__year = year
|
||||
self.__month = month
|
||||
self.__day = day
|
||||
self.__hour = hour
|
||||
self.__minute = minute
|
||||
self.__second = second
|
||||
|
||||
@staticmethod
|
||||
def fromDate(date):
|
||||
return Solar(date.year, date.month, date.day, date.hour, date.minute, date.second)
|
||||
|
||||
@staticmethod
|
||||
def fromJulianDay(julian_day):
|
||||
d = int(julian_day + 0.5)
|
||||
f = julian_day + 0.5 - d
|
||||
if d >= 2299161:
|
||||
c = int((d - 1867216.25) / 36524.25)
|
||||
d += 1 + c - int(c / 4)
|
||||
d += 1524
|
||||
year = int((d - 122.1) / 365.25)
|
||||
d -= int(365.25 * year)
|
||||
month = int(d / 30.601)
|
||||
d -= int(30.601 * month)
|
||||
day = d
|
||||
if month > 13:
|
||||
month -= 13
|
||||
year -= 4715
|
||||
else:
|
||||
month -= 1
|
||||
year -= 4716
|
||||
f *= 24
|
||||
hour = int(f)
|
||||
|
||||
f -= hour
|
||||
f *= 60
|
||||
minute = int(f)
|
||||
|
||||
f -= minute
|
||||
f *= 60
|
||||
second = int(round(f))
|
||||
if second > 59:
|
||||
second -= 60
|
||||
minute += 1
|
||||
if minute > 59:
|
||||
minute -= 60
|
||||
hour += 1
|
||||
if hour > 23:
|
||||
hour -= 24
|
||||
day += 1
|
||||
return Solar(year, month, day, hour, minute, second)
|
||||
|
||||
@staticmethod
|
||||
def fromYmdHms(year, month, day, hour, minute, second):
|
||||
return Solar(year, month, day, hour, minute, second)
|
||||
|
||||
@staticmethod
|
||||
def fromYmd(year, month, day):
|
||||
return Solar(year, month, day, 0, 0, 0)
|
||||
|
||||
@staticmethod
|
||||
def fromBaZi(year_gan_zhi, month_gan_zhi, day_gan_zhi, time_gan_zhi, sect=2, base_year=1900):
|
||||
from . import Lunar
|
||||
sect = 1 if 1 == sect else 2
|
||||
solar_list = []
|
||||
# 月地支距寅月的偏移值
|
||||
m = LunarUtil.find(month_gan_zhi[1:], LunarUtil.ZHI, -1) - 2
|
||||
if m < 0:
|
||||
m += 12
|
||||
# 月天干要一致
|
||||
if ((LunarUtil.find(year_gan_zhi[:1], LunarUtil.GAN, -1) + 1) * 2 + m) % 10 != LunarUtil.find(month_gan_zhi[:1], LunarUtil.GAN, -1):
|
||||
return solar_list
|
||||
# 1年的立春是辛酉,序号57
|
||||
y = LunarUtil.getJiaZiIndex(year_gan_zhi) - 57
|
||||
if y < 0:
|
||||
y += 60
|
||||
y += 1
|
||||
# 节令偏移值
|
||||
m *= 2
|
||||
# 时辰地支转时刻,子时按零点算
|
||||
h = LunarUtil.find(time_gan_zhi[1:], LunarUtil.ZHI, -1) * 2
|
||||
hours = [h]
|
||||
if 0 == h and 2 == sect:
|
||||
hours.append(23)
|
||||
start_year = base_year - 1
|
||||
|
||||
# 结束年
|
||||
end_year = datetime.now().year
|
||||
|
||||
while y <= end_year:
|
||||
if y >= start_year:
|
||||
# 立春为寅月的开始
|
||||
jie_qi_table = Lunar.fromYmd(y, 1, 1).getJieQiTable()
|
||||
# 节令推移,年干支和月干支就都匹配上了
|
||||
solar_time = jie_qi_table[Lunar.JIE_QI_IN_USE[4 + m]]
|
||||
if solar_time.getYear() >= base_year:
|
||||
# 日干支和节令干支的偏移值
|
||||
d = LunarUtil.getJiaZiIndex(day_gan_zhi) - LunarUtil.getJiaZiIndex(solar_time.getLunar().getDayInGanZhiExact2())
|
||||
if d < 0:
|
||||
d += 60
|
||||
if d > 0:
|
||||
# 从节令推移天数
|
||||
solar_time = solar_time.next(d)
|
||||
for hour in hours:
|
||||
mi = 0
|
||||
s = 0
|
||||
if d == 0 and hour == solar_time.getHour():
|
||||
# 如果正好是节令当天,且小时和节令的小时数相等的极端情况,把分钟和秒钟带上
|
||||
mi = solar_time.getMinute()
|
||||
s = solar_time.getSecond()
|
||||
# 验证一下
|
||||
solar = Solar.fromYmdHms(solar_time.getYear(), solar_time.getMonth(), solar_time.getDay(), hour, mi, s)
|
||||
if d == 30:
|
||||
solar = solar.nextHour(-1)
|
||||
lunar = solar.getLunar()
|
||||
dgz = lunar.getDayInGanZhiExact2() if 2 == sect else lunar.getDayInGanZhiExact()
|
||||
if lunar.getYearInGanZhiExact() == year_gan_zhi and lunar.getMonthInGanZhiExact() == month_gan_zhi and dgz == day_gan_zhi and lunar.getTimeInGanZhi() == time_gan_zhi:
|
||||
solar_list.append(solar)
|
||||
y += 60
|
||||
return solar_list
|
||||
|
||||
def isLeapYear(self):
|
||||
"""
|
||||
是否闰年
|
||||
:return: True/False 闰年/非闰年
|
||||
"""
|
||||
return SolarUtil.isLeapYear(self.__year)
|
||||
|
||||
def getWeek(self):
|
||||
"""
|
||||
获取星期,0代表周日,1代表周一
|
||||
:return: 0123456
|
||||
"""
|
||||
return (int(self.getJulianDay() + 0.5) + 7000001) % 7
|
||||
|
||||
def getWeekInChinese(self):
|
||||
"""
|
||||
获取星期的中文
|
||||
:return: 日一二三四五六
|
||||
"""
|
||||
return SolarUtil.WEEK[self.getWeek()]
|
||||
|
||||
def getFestivals(self):
|
||||
"""
|
||||
获取节日,有可能一天会有多个节日
|
||||
:return: 劳动节等
|
||||
"""
|
||||
festivals = []
|
||||
key = "%d-%d" % (self.__month, self.__day)
|
||||
if key in SolarUtil.FESTIVAL:
|
||||
festivals.append(SolarUtil.FESTIVAL[key])
|
||||
week = self.getWeek()
|
||||
key = "%d-%d-%d" % (self.__month, int(ceil(self.__day / 7.0)), week)
|
||||
if key in SolarUtil.WEEK_FESTIVAL:
|
||||
festivals.append(SolarUtil.WEEK_FESTIVAL[key])
|
||||
if self.__day + 7 > SolarUtil.getDaysOfMonth(self.__year, self.__month):
|
||||
key = "%d-0-%d" % (self.__month, week)
|
||||
if key in SolarUtil.WEEK_FESTIVAL:
|
||||
festivals.append(SolarUtil.WEEK_FESTIVAL[key])
|
||||
return festivals
|
||||
|
||||
def getOtherFestivals(self):
|
||||
"""
|
||||
获取非正式的节日,有可能一天会有多个节日
|
||||
:return: 非正式的节日列表,如中元节
|
||||
"""
|
||||
festivals = []
|
||||
key = "%d-%d" % (self.__month, self.__day)
|
||||
if key in SolarUtil.OTHER_FESTIVAL:
|
||||
for f in SolarUtil.OTHER_FESTIVAL[key]:
|
||||
festivals.append(f)
|
||||
return festivals
|
||||
|
||||
def getXingZuo(self):
|
||||
"""
|
||||
获取星座
|
||||
:return: 星座
|
||||
"""
|
||||
index = 11
|
||||
y = self.__month * 100 + self.__day
|
||||
if 321 <= y <= 419:
|
||||
index = 0
|
||||
elif 420 <= y <= 520:
|
||||
index = 1
|
||||
elif 521 <= y <= 621:
|
||||
index = 2
|
||||
elif 622 <= y <= 722:
|
||||
index = 3
|
||||
elif 723 <= y <= 822:
|
||||
index = 4
|
||||
elif 823 <= y <= 922:
|
||||
index = 5
|
||||
elif 923 <= y <= 1023:
|
||||
index = 6
|
||||
elif 1024 <= y <= 1122:
|
||||
index = 7
|
||||
elif 1123 <= y <= 1221:
|
||||
index = 8
|
||||
elif y >= 1222 or y <= 119:
|
||||
index = 9
|
||||
elif y <= 218:
|
||||
index = 10
|
||||
return SolarUtil.XING_ZUO[index]
|
||||
|
||||
def getJulianDay(self):
|
||||
"""
|
||||
获取儒略日
|
||||
:return: 儒略日
|
||||
"""
|
||||
y = self.__year
|
||||
m = self.__month
|
||||
d = self.__day + ((self.__second / 60.0 + self.__minute) / 60 + self.__hour) / 24
|
||||
n = 0
|
||||
g = False
|
||||
if y * 372 + m * 31 + int(d) >= 588829:
|
||||
g = True
|
||||
if m <= 2:
|
||||
m += 12
|
||||
y -= 1
|
||||
if g:
|
||||
n = int(y / 100)
|
||||
n = 2 - n + int(n / 4)
|
||||
return int(365.25 * (y + 4716)) + int(30.6001 * (m + 1)) + d + n - 1524.5
|
||||
|
||||
def getLunar(self):
|
||||
"""
|
||||
获取农历
|
||||
:return: 农历
|
||||
"""
|
||||
from .Lunar import Lunar
|
||||
return Lunar.fromSolar(self)
|
||||
|
||||
def nextDay(self, days):
|
||||
y = self.__year
|
||||
m = self.__month
|
||||
d = self.__day
|
||||
if 1582 == y and 10 == m:
|
||||
if d > 4:
|
||||
d -= 10
|
||||
if days > 0:
|
||||
d += days
|
||||
days_in_month = SolarUtil.getDaysOfMonth(y, m)
|
||||
while d > days_in_month:
|
||||
d -= days_in_month
|
||||
m += 1
|
||||
if m > 12:
|
||||
m = 1
|
||||
y += 1
|
||||
days_in_month = SolarUtil.getDaysOfMonth(y, m)
|
||||
elif days < 0:
|
||||
while d + days <= 0:
|
||||
m -= 1
|
||||
if m < 1:
|
||||
m = 12
|
||||
y -= 1
|
||||
d += SolarUtil.getDaysOfMonth(y, m)
|
||||
d += days
|
||||
if 1582 == y and 10 == m:
|
||||
if d > 4:
|
||||
d += 10
|
||||
return Solar.fromYmdHms(y, m, d, self.__hour, self.__minute, self.__second)
|
||||
|
||||
def next(self, days, only_work_day=False):
|
||||
"""
|
||||
获取往后推几天的阳历日期,如果要往前推,则天数用负数
|
||||
:param days: 天数
|
||||
:param only_work_day: 是否仅工作日
|
||||
:return: 阳历日期
|
||||
"""
|
||||
if not only_work_day:
|
||||
return self.nextDay(days)
|
||||
solar = Solar.fromYmdHms(self.__year, self.__month, self.__day, self.__hour, self.__minute, self.__second)
|
||||
if days != 0:
|
||||
rest = abs(days)
|
||||
add = 1
|
||||
if days < 0:
|
||||
add = -1
|
||||
while rest > 0:
|
||||
solar = solar.next(add)
|
||||
work = True
|
||||
holiday = HolidayUtil.getHoliday(solar.getYear(), solar.getMonth(), solar.getDay())
|
||||
if holiday is None:
|
||||
week = solar.getWeek()
|
||||
if 0 == week or 6 == week:
|
||||
work = False
|
||||
else:
|
||||
work = holiday.isWork()
|
||||
if work:
|
||||
rest -= 1
|
||||
return solar
|
||||
|
||||
def getYear(self):
|
||||
return self.__year
|
||||
|
||||
def getMonth(self):
|
||||
return self.__month
|
||||
|
||||
def getDay(self):
|
||||
return self.__day
|
||||
|
||||
def getHour(self):
|
||||
return self.__hour
|
||||
|
||||
def getMinute(self):
|
||||
return self.__minute
|
||||
|
||||
def getSecond(self):
|
||||
return self.__second
|
||||
|
||||
def toYmd(self):
|
||||
return "%04d-%02d-%02d" % (self.__year, self.__month, self.__day)
|
||||
|
||||
def toYmdHms(self):
|
||||
return "%s %02d:%02d:%02d" % (self.toYmd(), self.__hour, self.__minute, self.__second)
|
||||
|
||||
def toFullString(self):
|
||||
s = self.toYmdHms()
|
||||
if self.isLeapYear():
|
||||
s += " 闰年"
|
||||
s += " 星期"
|
||||
s += self.getWeekInChinese()
|
||||
for f in self.getFestivals():
|
||||
s += " (" + f + ")"
|
||||
for f in self.getOtherFestivals():
|
||||
s += " (" + f + ")"
|
||||
s += " "
|
||||
s += self.getXingZuo()
|
||||
s += "座"
|
||||
return s
|
||||
|
||||
def toString(self):
|
||||
return self.toYmd()
|
||||
|
||||
def __str__(self):
|
||||
return self.toString()
|
||||
|
||||
def subtract(self, solar):
|
||||
return SolarUtil.getDaysBetween(solar.getYear(), solar.getMonth(), solar.getDay(), self.__year, self.__month, self.__day)
|
||||
|
||||
def subtractMinute(self, solar):
|
||||
days = self.subtract(solar)
|
||||
cm = self.__hour * 60 + self.__minute
|
||||
sm = solar.getHour() * 60 + solar.getMinute()
|
||||
m = cm - sm
|
||||
if m < 0:
|
||||
m += 1440
|
||||
days -= 1
|
||||
m += days * 1440
|
||||
return m
|
||||
|
||||
def isAfter(self, solar):
|
||||
if self.__year > solar.getYear():
|
||||
return True
|
||||
if self.__year < solar.getYear():
|
||||
return False
|
||||
if self.__month > solar.getMonth():
|
||||
return True
|
||||
if self.__month < solar.getMonth():
|
||||
return False
|
||||
if self.__day > solar.getDay():
|
||||
return True
|
||||
if self.__day < solar.getDay():
|
||||
return False
|
||||
if self.__hour > solar.getHour():
|
||||
return True
|
||||
if self.__hour < solar.getHour():
|
||||
return False
|
||||
if self.__minute > solar.getMinute():
|
||||
return True
|
||||
if self.__minute < solar.getMinute():
|
||||
return False
|
||||
return self.__second > solar.getSecond()
|
||||
|
||||
def isBefore(self, solar):
|
||||
if self.__year > solar.getYear():
|
||||
return False
|
||||
if self.__year < solar.getYear():
|
||||
return True
|
||||
if self.__month > solar.getMonth():
|
||||
return False
|
||||
if self.__month < solar.getMonth():
|
||||
return True
|
||||
if self.__day > solar.getDay():
|
||||
return False
|
||||
if self.__day < solar.getDay():
|
||||
return True
|
||||
if self.__hour > solar.getHour():
|
||||
return False
|
||||
if self.__hour < solar.getHour():
|
||||
return True
|
||||
if self.__minute > solar.getMinute():
|
||||
return False
|
||||
if self.__minute < solar.getMinute():
|
||||
return True
|
||||
return self.__second < solar.getSecond()
|
||||
|
||||
def nextYear(self, years):
|
||||
y = self.__year + years
|
||||
m = self.__month
|
||||
d = self.__day
|
||||
if 1582 == y and 10 == m:
|
||||
if 4 < d < 15:
|
||||
d += 10
|
||||
elif 2 == m:
|
||||
if d > 28:
|
||||
if not SolarUtil.isLeapYear(y):
|
||||
d = 28
|
||||
return Solar.fromYmdHms(y, m, d, self.__hour, self.__minute, self.__second)
|
||||
|
||||
def nextMonth(self, months):
|
||||
from . import SolarMonth
|
||||
month = SolarMonth.fromYm(self.__year, self.__month).next(months)
|
||||
y = month.getYear()
|
||||
m = month.getMonth()
|
||||
d = self.__day
|
||||
if 1582 == y and 10 == m:
|
||||
if 4 < d < 15:
|
||||
d += 10
|
||||
else:
|
||||
days = SolarUtil.getDaysOfMonth(y, m)
|
||||
if d > days:
|
||||
d = days
|
||||
return Solar.fromYmdHms(y, m, d, self.__hour, self.__minute, self.__second)
|
||||
|
||||
def nextHour(self, hours):
|
||||
h = self.__hour + hours
|
||||
n = 1
|
||||
if h < 0:
|
||||
n = -1
|
||||
hour = abs(h)
|
||||
days = int(hour / 24) * n
|
||||
hour = (hour % 24) * n
|
||||
if hour < 0:
|
||||
hour += 24
|
||||
days -= 1
|
||||
solar = self.next(days)
|
||||
return Solar.fromYmdHms(solar.getYear(), solar.getMonth(), solar.getDay(), hour, solar.getMinute(), solar.getSecond())
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from math import ceil
|
||||
|
||||
from . import SolarMonth
|
||||
|
||||
|
||||
class SolarHalfYear:
|
||||
"""
|
||||
阳历半年
|
||||
"""
|
||||
|
||||
MONTH_COUNT = 6
|
||||
|
||||
def __init__(self, year, month):
|
||||
self.__year = year
|
||||
self.__month = month
|
||||
|
||||
@staticmethod
|
||||
def fromDate(date):
|
||||
return SolarHalfYear(date.year, date.month)
|
||||
|
||||
@staticmethod
|
||||
def fromYm(year, month):
|
||||
return SolarHalfYear(year, month)
|
||||
|
||||
def getYear(self):
|
||||
return self.__year
|
||||
|
||||
def getMonth(self):
|
||||
return self.__month
|
||||
|
||||
def toString(self):
|
||||
return "%d.%d" % (self.__year, self.getIndex())
|
||||
|
||||
def toFullString(self):
|
||||
return "%d年%s半年" % (self.__year, ("上" if 1 == self.getIndex() else "下"))
|
||||
|
||||
def __str__(self):
|
||||
return self.toString()
|
||||
|
||||
def getIndex(self):
|
||||
"""
|
||||
获取当月是第几半年
|
||||
:return: 半年序号,从1开始
|
||||
"""
|
||||
return int(ceil(self.__month * 1.0 / SolarHalfYear.MONTH_COUNT))
|
||||
|
||||
def getMonths(self):
|
||||
"""
|
||||
获取本半年的阳历月列表
|
||||
:return: 阳历月列表
|
||||
"""
|
||||
months = []
|
||||
index = self.getIndex() - 1
|
||||
for i in range(0, SolarHalfYear.MONTH_COUNT):
|
||||
months.append(SolarMonth.fromYm(self.__year, SolarHalfYear.MONTH_COUNT * index + i + 1))
|
||||
return months
|
||||
|
||||
def next(self, half_years):
|
||||
"""
|
||||
半年推移
|
||||
:param half_years: 推移的半年数,负数为倒推
|
||||
:return: 推移后的半年
|
||||
"""
|
||||
m = SolarMonth.fromYm(self.__year, self.__month).next(SolarHalfYear.MONTH_COUNT * half_years)
|
||||
return SolarHalfYear.fromYm(m.getYear(), m.getMonth())
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import Solar, SolarWeek
|
||||
from .util import SolarUtil
|
||||
|
||||
|
||||
class SolarMonth:
|
||||
"""
|
||||
阳历月
|
||||
"""
|
||||
|
||||
def __init__(self, year, month):
|
||||
self.__year = year
|
||||
self.__month = month
|
||||
|
||||
@staticmethod
|
||||
def fromDate(date):
|
||||
return SolarMonth(date.year, date.month)
|
||||
|
||||
@staticmethod
|
||||
def fromYm(year: int, month: int):
|
||||
return SolarMonth(year, month)
|
||||
|
||||
def getYear(self):
|
||||
return self.__year
|
||||
|
||||
def getMonth(self):
|
||||
return self.__month
|
||||
|
||||
def toString(self):
|
||||
return "%d-%d" % (self.__year, self.__month)
|
||||
|
||||
def toFullString(self):
|
||||
return "%d年%d月" % (self.__year, self.__month)
|
||||
|
||||
def __str__(self):
|
||||
return self.toString()
|
||||
|
||||
def getDays(self):
|
||||
"""
|
||||
获取本月的阳历日期列表
|
||||
:return: 阳历日期列表
|
||||
"""
|
||||
days = []
|
||||
d = Solar.fromYmd(self.__year, self.__month, 1)
|
||||
days.append(d)
|
||||
for i in range(1, SolarUtil.getDaysOfMonth(self.__year, self.__month)):
|
||||
days.append(d.next(i))
|
||||
return days
|
||||
|
||||
def getWeeks(self, start):
|
||||
"""
|
||||
获取本月的阳历日期列表
|
||||
:param start: 星期几作为一周的开始,1234560分别代表星期一至星期天
|
||||
:return: 阳历日期列表
|
||||
"""
|
||||
weeks = []
|
||||
week = SolarWeek.fromYmd(self.__year, self.__month, 1, start)
|
||||
while True:
|
||||
weeks.append(week)
|
||||
week = week.next(1, False)
|
||||
first_day = week.getFirstDay()
|
||||
if first_day.getYear() > self.__year or first_day.getMonth() > self.__month:
|
||||
break
|
||||
return weeks
|
||||
|
||||
def next(self, months):
|
||||
"""
|
||||
获取往后推几个月的阳历月,如果要往前推,则月数用负数
|
||||
:param months: 月数
|
||||
:return: 阳历月
|
||||
"""
|
||||
n = 1
|
||||
if months < 0:
|
||||
n = -1
|
||||
m = abs(months)
|
||||
y = self.__year + int(m / 12) * n
|
||||
m = self.__month + m % 12 * n
|
||||
if m > 12:
|
||||
m -= 12
|
||||
y += 1
|
||||
elif m < 1:
|
||||
m += 12
|
||||
y -= 1
|
||||
return SolarMonth.fromYm(y, m)
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from math import ceil
|
||||
|
||||
from . import SolarMonth
|
||||
|
||||
|
||||
class SolarSeason:
|
||||
"""
|
||||
阳历季度
|
||||
"""
|
||||
|
||||
MONTH_COUNT = 3
|
||||
|
||||
def __init__(self, year, month):
|
||||
self.__year = year
|
||||
self.__month = month
|
||||
|
||||
@staticmethod
|
||||
def fromDate(date):
|
||||
return SolarSeason(date.year, date.month)
|
||||
|
||||
@staticmethod
|
||||
def fromYm(year, month):
|
||||
return SolarSeason(year, month)
|
||||
|
||||
def getYear(self):
|
||||
return self.__year
|
||||
|
||||
def getMonth(self):
|
||||
return self.__month
|
||||
|
||||
def toString(self):
|
||||
return "%d.%d" % (self.__year, self.getIndex())
|
||||
|
||||
def toFullString(self):
|
||||
return "%d年%d季度" % (self.__year, self.getIndex())
|
||||
|
||||
def __str__(self):
|
||||
return self.toString()
|
||||
|
||||
def getIndex(self):
|
||||
"""
|
||||
获取当月是第几季度
|
||||
:return: 季度序号,从1开始
|
||||
"""
|
||||
return int(ceil(self.__month * 1.0 / SolarSeason.MONTH_COUNT))
|
||||
|
||||
def getMonths(self):
|
||||
"""
|
||||
获取本季度的阳历月列表
|
||||
:return: 阳历月列表
|
||||
"""
|
||||
months = []
|
||||
index = self.getIndex() - 1
|
||||
for i in range(0, SolarSeason.MONTH_COUNT):
|
||||
months.append(SolarMonth.fromYm(self.__year, SolarSeason.MONTH_COUNT * index + i + 1))
|
||||
return months
|
||||
|
||||
def next(self, seasons):
|
||||
"""
|
||||
季度推移
|
||||
:param seasons: 推移的季度数,负数为倒推
|
||||
:return: 推移后的季度
|
||||
"""
|
||||
m = SolarMonth.fromYm(self.__year, self.__month).next(SolarSeason.MONTH_COUNT * seasons)
|
||||
return SolarSeason.fromYm(m.getYear(), m.getMonth())
|
||||
Vendored
+162
@@ -0,0 +1,162 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from math import ceil
|
||||
|
||||
from . import Solar
|
||||
from .util import SolarUtil
|
||||
|
||||
|
||||
class SolarWeek:
|
||||
"""
|
||||
阳历周
|
||||
"""
|
||||
|
||||
def __init__(self, year, month, day, start):
|
||||
"""
|
||||
通过年月日初始化
|
||||
:param year: 年
|
||||
:param month: 月,1到12
|
||||
:param day: 日,1到31
|
||||
:param start: 星期几作为一周的开始,1234560分别代表星期一至星期天
|
||||
"""
|
||||
self.__year = year
|
||||
self.__month = month
|
||||
self.__day = day
|
||||
self.__start = start
|
||||
|
||||
@staticmethod
|
||||
def fromDate(date, start):
|
||||
return SolarWeek(date.year, date.month, date.day, start)
|
||||
|
||||
@staticmethod
|
||||
def fromYmd(year, month, day, start):
|
||||
return SolarWeek(year, month, day, start)
|
||||
|
||||
def getYear(self):
|
||||
return self.__year
|
||||
|
||||
def getMonth(self):
|
||||
return self.__month
|
||||
|
||||
def getDay(self):
|
||||
return self.__day
|
||||
|
||||
def getStart(self):
|
||||
return self.__start
|
||||
|
||||
def toString(self):
|
||||
return "%d.%d.%d" % (self.__year, self.__month, self.getIndex())
|
||||
|
||||
def toFullString(self):
|
||||
return "%d年%d月第%d周" % (self.__year, self.__month, self.getIndex())
|
||||
|
||||
def __str__(self):
|
||||
return self.toString()
|
||||
|
||||
def getIndex(self):
|
||||
"""
|
||||
获取当前日期是在当月第几周
|
||||
:return: 周序号,从1开始
|
||||
"""
|
||||
offset = Solar.fromYmd(self.__year, self.__month, 1).getWeek() - self.__start
|
||||
if offset < 0:
|
||||
offset += 7
|
||||
return int(ceil((self.__day + offset) * 1.0 / 7))
|
||||
|
||||
def getIndexInYear(self):
|
||||
"""
|
||||
获取当前日期是在当年第几周
|
||||
:return: 周序号,从1开始
|
||||
"""
|
||||
offset = Solar.fromYmd(self.__year, 1, 1).getWeek() - self.__start
|
||||
if offset < 0:
|
||||
offset += 7
|
||||
return int(ceil((SolarUtil.getDaysInYear(self.__year, self.__month, self.__day) + offset) * 1.0 / 7))
|
||||
|
||||
def getFirstDay(self):
|
||||
"""
|
||||
获取本周第一天的阳历日期(可能跨月)
|
||||
:return: 本周第一天的阳历日期
|
||||
"""
|
||||
solar = Solar.fromYmd(self.__year, self.__month, self.__day)
|
||||
prev = solar.getWeek() - self.__start
|
||||
if prev < 0:
|
||||
prev += 7
|
||||
return solar.next(-prev)
|
||||
|
||||
def getFirstDayInMonth(self):
|
||||
"""
|
||||
获取本周第一天的阳历日期(仅限当月)
|
||||
:return: 本周第一天的阳历日期
|
||||
"""
|
||||
for day in self.getDays():
|
||||
if self.__month == day.getMonth():
|
||||
return day
|
||||
return None
|
||||
|
||||
def getDays(self):
|
||||
"""
|
||||
获取本周的阳历日期列表(可能跨月)
|
||||
:return: 本周的阳历日期列表
|
||||
"""
|
||||
days = []
|
||||
first = self.getFirstDay()
|
||||
days.append(first)
|
||||
for i in range(1, 7):
|
||||
days.append(first.next(i))
|
||||
return days
|
||||
|
||||
def getDaysInMonth(self):
|
||||
"""
|
||||
获取本周的阳历日期列表(仅限当月)
|
||||
:return: 本周的阳历日期列表(仅限当月)
|
||||
"""
|
||||
days = []
|
||||
for day in self.getDays():
|
||||
if self.__month == day.getMonth():
|
||||
days.append(day)
|
||||
return days
|
||||
|
||||
def next(self, weeks, separate_month):
|
||||
"""
|
||||
周推移
|
||||
:param weeks: 推移的周数,负数为倒推
|
||||
:param separate_month: 是否按月单独计算
|
||||
:return: 推移后的阳历周
|
||||
"""
|
||||
if 0 == weeks:
|
||||
return SolarWeek.fromYmd(self.__year, self.__month, self.__day, self.__start)
|
||||
solar = Solar.fromYmd(self.__year, self.__month, self.__day)
|
||||
if separate_month:
|
||||
n = weeks
|
||||
week = SolarWeek.fromYmd(solar.getYear(), solar.getMonth(), solar.getDay(), self.__start)
|
||||
month = self.__month
|
||||
plus = n > 0
|
||||
days = 7 if plus else -7
|
||||
while 0 != n:
|
||||
solar = solar.next(days)
|
||||
week = SolarWeek.fromYmd(solar.getYear(), solar.getMonth(), solar.getDay(), self.__start)
|
||||
week_month = week.getMonth()
|
||||
if month != week_month:
|
||||
index = week.getIndex()
|
||||
if plus:
|
||||
if 1 == index:
|
||||
first_day = week.getFirstDay()
|
||||
week = SolarWeek.fromYmd(first_day.getYear(), first_day.getMonth(), first_day.getDay(), self.__start)
|
||||
week_month = week.getMonth()
|
||||
else:
|
||||
solar = Solar.fromYmd(week.getYear(), week.getMonth(), 1)
|
||||
week = SolarWeek.fromYmd(solar.getYear(), solar.getMonth(), solar.getDay(), self.__start)
|
||||
else:
|
||||
if SolarUtil.getWeeksOfMonth(week.getYear(), week.getMonth(), self.__start) == index:
|
||||
last_day = week.getFirstDay().next(6)
|
||||
week = SolarWeek.fromYmd(last_day.getYear(), last_day.getMonth(), last_day.getDay(), self.__start)
|
||||
week_month = week.getMonth()
|
||||
else:
|
||||
solar = Solar.fromYmd(week.getYear(), week.getMonth(), SolarUtil.getDaysOfMonth(week.getYear(), week.getMonth()))
|
||||
week = SolarWeek.fromYmd(solar.getYear(), solar.getMonth(), solar.getDay(), self.__start)
|
||||
month = week_month
|
||||
n -= 1 if plus else -1
|
||||
return week
|
||||
else:
|
||||
solar = solar.next(weeks * 7)
|
||||
return SolarWeek.fromYmd(solar.getYear(), solar.getMonth(), solar.getDay(), self.__start)
|
||||
Vendored
+54
@@ -0,0 +1,54 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import SolarMonth
|
||||
|
||||
|
||||
class SolarYear:
|
||||
"""
|
||||
阳历年
|
||||
"""
|
||||
|
||||
MONTH_COUNT = 12
|
||||
|
||||
def __init__(self, year):
|
||||
self.__year = year
|
||||
|
||||
@staticmethod
|
||||
def fromDate(date):
|
||||
return SolarYear(date.year)
|
||||
|
||||
@staticmethod
|
||||
def fromYear(year):
|
||||
return SolarYear(year)
|
||||
|
||||
def getYear(self):
|
||||
return self.__year
|
||||
|
||||
def toString(self):
|
||||
return str(self.__year)
|
||||
|
||||
def toFullString(self):
|
||||
return "%d年" % self.__year
|
||||
|
||||
def __str__(self):
|
||||
return self.toString()
|
||||
|
||||
def getMonths(self):
|
||||
"""
|
||||
获取本年的阳历月列表
|
||||
:return: 阳历月列表
|
||||
"""
|
||||
months = []
|
||||
m = SolarMonth.fromYm(self.__year, 1)
|
||||
months.append(m)
|
||||
for i in range(1, SolarYear.MONTH_COUNT):
|
||||
months.append(m.next(i))
|
||||
return months
|
||||
|
||||
def next(self, years):
|
||||
"""
|
||||
获取往后推几年的阳历年,如果要往前推,则月数用负数
|
||||
:param years: 年数
|
||||
:return: 阳历年
|
||||
"""
|
||||
return SolarYear.fromYear(self.__year + years)
|
||||
Vendored
+130
@@ -0,0 +1,130 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from . import Lunar, TaoFestival
|
||||
from .util import LunarUtil, TaoUtil
|
||||
|
||||
|
||||
class Tao:
|
||||
"""
|
||||
道历
|
||||
"""
|
||||
|
||||
BIRTH_YEAR = -2697
|
||||
|
||||
def __init__(self, lunar):
|
||||
self.__lunar = lunar
|
||||
|
||||
@staticmethod
|
||||
def fromLunar(lunar):
|
||||
return Tao(lunar)
|
||||
|
||||
@staticmethod
|
||||
def fromYmdHms(year, month, day, hour, minute, second):
|
||||
return Tao.fromLunar(Lunar.fromYmdHms(year + Tao.BIRTH_YEAR, month, day, hour, minute, second))
|
||||
|
||||
@staticmethod
|
||||
def fromYmd(year, month, day):
|
||||
return Tao.fromYmdHms(year, month, day, 0, 0, 0)
|
||||
|
||||
def getLunar(self):
|
||||
return self.__lunar
|
||||
|
||||
def getYear(self):
|
||||
return self.__lunar.getYear() - Tao.BIRTH_YEAR
|
||||
|
||||
def getMonth(self):
|
||||
return self.__lunar.getMonth()
|
||||
|
||||
def getDay(self):
|
||||
return self.__lunar.getDay()
|
||||
|
||||
def getYearInChinese(self):
|
||||
y = str(self.getYear())
|
||||
s = ""
|
||||
for i in range(0, len(y)):
|
||||
s += LunarUtil.NUMBER[ord(y[i]) - 48]
|
||||
return s
|
||||
|
||||
def getMonthInChinese(self):
|
||||
return self.__lunar.getMonthInChinese()
|
||||
|
||||
def getDayInChinese(self):
|
||||
return self.__lunar.getDayInChinese()
|
||||
|
||||
def getFestivals(self):
|
||||
festivals = []
|
||||
md = "%d-%d" % (self.getMonth(), self.getDay())
|
||||
if md in TaoUtil.FESTIVAL:
|
||||
fs = TaoUtil.FESTIVAL[md]
|
||||
for f in fs:
|
||||
festivals.append(f)
|
||||
jq = self.__lunar.getJieQi()
|
||||
if "冬至" == jq:
|
||||
festivals.append(TaoFestival("元始天尊圣诞"))
|
||||
elif "夏至" == jq:
|
||||
festivals.append(TaoFestival("灵宝天尊圣诞"))
|
||||
# 八节日
|
||||
if jq in TaoUtil.BA_JIE:
|
||||
festivals.append(TaoFestival(TaoUtil.BA_JIE[jq]))
|
||||
# 八会日
|
||||
gz = self.__lunar.getDayInGanZhi()
|
||||
if gz in TaoUtil.BA_HUI:
|
||||
festivals.append(TaoFestival(TaoUtil.BA_HUI[gz]))
|
||||
return festivals
|
||||
|
||||
def __isDayIn(self, days):
|
||||
md = "%d-%d" % (self.getMonth(), self.getDay())
|
||||
for d in days:
|
||||
if md == d:
|
||||
return True
|
||||
return False
|
||||
|
||||
def isDaySanHui(self):
|
||||
return self.__isDayIn(TaoUtil.SAN_HUI)
|
||||
|
||||
def isDaySanYuan(self):
|
||||
return self.__isDayIn(TaoUtil.SAN_YUAN)
|
||||
|
||||
def isDayBaJie(self):
|
||||
return self.__lunar.getJieQi() in TaoUtil.BA_JIE
|
||||
|
||||
def isDayWuLa(self):
|
||||
return self.__isDayIn(TaoUtil.WU_LA)
|
||||
|
||||
def isDayBaHui(self):
|
||||
return self.__lunar.getDayInGanZhi() in TaoUtil.BA_HUI
|
||||
|
||||
def isDayMingWu(self):
|
||||
return "戊" == self.__lunar.getDayGan()
|
||||
|
||||
def isDayAnWu(self):
|
||||
return self.__lunar.getDayZhi() == TaoUtil.AN_WU[abs(self.getMonth()) - 1]
|
||||
|
||||
def isDayWu(self):
|
||||
return self.isDayMingWu() or self.isDayAnWu()
|
||||
|
||||
def isDayTianShe(self):
|
||||
ret = False
|
||||
mz = self.__lunar.getMonthZhi()
|
||||
dgz = self.__lunar.getDayInGanZhi()
|
||||
if mz in "寅卯辰":
|
||||
if "戊寅" == dgz:
|
||||
ret = True
|
||||
elif mz in "巳午未":
|
||||
if "甲午" == dgz:
|
||||
ret = True
|
||||
elif mz in "申酉戌":
|
||||
if "戊申" == dgz:
|
||||
ret = True
|
||||
elif mz in "亥子丑":
|
||||
if "甲子" == dgz:
|
||||
ret = True
|
||||
return ret
|
||||
|
||||
def __str__(self):
|
||||
return self.toString()
|
||||
|
||||
def toString(self):
|
||||
return "%s年%s月%s" % (self.getYearInChinese(), self.getMonthInChinese(), self.getDayInChinese())
|
||||
|
||||
def toFullString(self):
|
||||
return "道歷%s年,天运%s年,%s月,%s日。%s月%s日,%s時。" % (self.getYearInChinese(), self.__lunar.getYearInGanZhi(), self.__lunar.getMonthInGanZhi(), self.__lunar.getDayInGanZhi(), self.getMonthInChinese(), self.getDayInChinese(), self.__lunar.getTimeZhi())
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
class TaoFestival:
|
||||
"""
|
||||
道历节日
|
||||
"""
|
||||
|
||||
def __init__(self, name, remark=None):
|
||||
self.__name = name
|
||||
self.__remark = "" if remark is None else remark
|
||||
|
||||
def getName(self):
|
||||
return self.__name
|
||||
|
||||
def getRemark(self):
|
||||
return self.__remark
|
||||
|
||||
def __str__(self):
|
||||
return self.toString()
|
||||
|
||||
def toString(self):
|
||||
return self.__name
|
||||
|
||||
def toFullString(self):
|
||||
s = self.__name
|
||||
if self.__remark is not None and len(self.__remark) > 0:
|
||||
s += "[" + self.__remark + "]"
|
||||
return s
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from .JieQi import JieQi
|
||||
from .NineStar import NineStar
|
||||
from .EightChar import EightChar
|
||||
from .ShuJiu import ShuJiu
|
||||
from .Fu import Fu
|
||||
from .Solar import Solar
|
||||
from .SolarWeek import SolarWeek
|
||||
from .SolarMonth import SolarMonth
|
||||
from .SolarSeason import SolarSeason
|
||||
from .SolarHalfYear import SolarHalfYear
|
||||
from .SolarYear import SolarYear
|
||||
from .LunarTime import LunarTime
|
||||
from .Lunar import Lunar
|
||||
from .LunarYear import LunarYear
|
||||
from .LunarMonth import LunarMonth
|
||||
from .Holiday import Holiday
|
||||
from .FotoFestival import FotoFestival
|
||||
from .Foto import Foto
|
||||
from .TaoFestival import TaoFestival
|
||||
from .Tao import Tao
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from . import XiaoYun, LiuNian
|
||||
from ..util import LunarUtil
|
||||
|
||||
|
||||
class DaYun:
|
||||
"""
|
||||
大运
|
||||
"""
|
||||
|
||||
def __init__(self, yun, index: int):
|
||||
self.__yun = yun
|
||||
self.__lunar = yun.getLunar()
|
||||
self.__index = index
|
||||
birth_year = yun.getLunar().getSolar().getYear()
|
||||
year = yun.getStartSolar().getYear()
|
||||
if index < 1:
|
||||
self.__startYear = birth_year
|
||||
self.__startAge = 1
|
||||
self.__endYear = year - 1
|
||||
self.__endAge = year - birth_year
|
||||
else:
|
||||
add = (index - 1) * 10
|
||||
self.__startYear = year + add
|
||||
self.__startAge = self.__startYear - birth_year + 1
|
||||
self.__endYear = self.__startYear + 9
|
||||
self.__endAge = self.__startAge + 9
|
||||
|
||||
def getStartYear(self):
|
||||
return self.__startYear
|
||||
|
||||
def getEndYear(self):
|
||||
return self.__endYear
|
||||
|
||||
def getStartAge(self):
|
||||
return self.__startAge
|
||||
|
||||
def getEndAge(self):
|
||||
return self.__endAge
|
||||
|
||||
def getIndex(self):
|
||||
return self.__index
|
||||
|
||||
def getLunar(self):
|
||||
return self.__lunar
|
||||
|
||||
def getGanZhi(self):
|
||||
"""
|
||||
获取干支
|
||||
:return: 干支
|
||||
"""
|
||||
if self.__index < 1:
|
||||
return ""
|
||||
offset = LunarUtil.getJiaZiIndex(self.__lunar.getMonthInGanZhiExact())
|
||||
offset += self.__index if self.__yun.isForward() else -self.__index
|
||||
size = len(LunarUtil.JIA_ZI)
|
||||
if offset >= size:
|
||||
offset -= size
|
||||
if offset < 0:
|
||||
offset += size
|
||||
return LunarUtil.JIA_ZI[offset]
|
||||
|
||||
def getXun(self):
|
||||
"""
|
||||
获取所在旬
|
||||
:return: 旬
|
||||
"""
|
||||
return LunarUtil.getXun(self.getGanZhi())
|
||||
|
||||
def getXunKong(self):
|
||||
"""
|
||||
获取旬空(空亡)
|
||||
:return: 旬空(空亡)
|
||||
"""
|
||||
return LunarUtil.getXunKong(self.getGanZhi())
|
||||
|
||||
def getLiuNian(self, n=10):
|
||||
"""
|
||||
获取流年
|
||||
:param n: 轮数
|
||||
:return: 流年
|
||||
"""
|
||||
if self.__index < 1:
|
||||
n = self.__endYear - self.__startYear + 1
|
||||
liu_nian = []
|
||||
for i in range(0, n):
|
||||
liu_nian.append(LiuNian(self, i))
|
||||
return liu_nian
|
||||
|
||||
def getXiaoYun(self, n=10):
|
||||
"""
|
||||
获取小运
|
||||
:param n: 轮数
|
||||
:return: 小运
|
||||
"""
|
||||
if self.__index < 1:
|
||||
n = self.__endYear - self.__startYear + 1
|
||||
xiao_yun = []
|
||||
for i in range(0, n):
|
||||
xiao_yun.append(XiaoYun(self, i, self.__yun.isForward()))
|
||||
return xiao_yun
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from . import LiuYue
|
||||
from ..util import LunarUtil
|
||||
|
||||
|
||||
class LiuNian:
|
||||
"""
|
||||
流年
|
||||
"""
|
||||
|
||||
def __init__(self, da_yun, index):
|
||||
self.__daYun = da_yun
|
||||
self.__lunar = da_yun.getLunar()
|
||||
self.__index = index
|
||||
self.__year = da_yun.getStartYear() + index
|
||||
self.__age = da_yun.getStartAge() + index
|
||||
|
||||
def getIndex(self):
|
||||
return self.__index
|
||||
|
||||
def getYear(self):
|
||||
return self.__year
|
||||
|
||||
def getAge(self):
|
||||
return self.__age
|
||||
|
||||
def getGanZhi(self):
|
||||
"""
|
||||
获取干支
|
||||
:return: 干支
|
||||
"""
|
||||
offset = LunarUtil.getJiaZiIndex(self.__lunar.getJieQiTable()["立春"].getLunar().getYearInGanZhiExact()) + self.__index
|
||||
if self.__daYun.getIndex() > 0:
|
||||
offset += self.__daYun.getStartAge() - 1
|
||||
offset %= len(LunarUtil.JIA_ZI)
|
||||
return LunarUtil.JIA_ZI[offset]
|
||||
|
||||
def getXun(self):
|
||||
"""
|
||||
获取所在旬
|
||||
:return: 旬
|
||||
"""
|
||||
return LunarUtil.getXun(self.getGanZhi())
|
||||
|
||||
def getXunKong(self):
|
||||
"""
|
||||
获取旬空(空亡)
|
||||
:return: 旬空(空亡)
|
||||
"""
|
||||
return LunarUtil.getXunKong(self.getGanZhi())
|
||||
|
||||
def getLiuYue(self):
|
||||
"""
|
||||
获取流月
|
||||
:return: 流月
|
||||
"""
|
||||
n = 12
|
||||
liu_yue = []
|
||||
for i in range(0, n):
|
||||
liu_yue.append(LiuYue(self, i))
|
||||
return liu_yue
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ..util import LunarUtil
|
||||
|
||||
|
||||
class LiuYue:
|
||||
"""
|
||||
流月
|
||||
"""
|
||||
|
||||
def __init__(self, liu_nian, index):
|
||||
self.__liuNian = liu_nian
|
||||
self.__index = index
|
||||
|
||||
def getIndex(self):
|
||||
return self.__index
|
||||
|
||||
def getMonthInChinese(self):
|
||||
"""
|
||||
获取中文的月
|
||||
:return: 中文月,如正
|
||||
"""
|
||||
return LunarUtil.MONTH[self.__index + 1]
|
||||
|
||||
def getGanZhi(self):
|
||||
"""
|
||||
获取干支
|
||||
<p>
|
||||
《五虎遁》
|
||||
甲己之年丙作首,
|
||||
乙庚之年戊为头,
|
||||
丙辛之年寻庚上,
|
||||
丁壬壬寅顺水流,
|
||||
若问戊癸何处走,
|
||||
甲寅之上好追求。
|
||||
:return: 干支
|
||||
"""
|
||||
offset = 0
|
||||
year_gan_zhi = self.__liuNian.getGanZhi()
|
||||
year_gan = year_gan_zhi[:1]
|
||||
if "甲" == year_gan or "己" == year_gan:
|
||||
offset = 2
|
||||
elif "乙" == year_gan or "庚" == year_gan:
|
||||
offset = 4
|
||||
elif "丙" == year_gan or "辛" == year_gan:
|
||||
offset = 6
|
||||
elif "丁" == year_gan or "壬" == year_gan:
|
||||
offset = 8
|
||||
gan = LunarUtil.GAN[(self.__index + offset) % 10 + 1]
|
||||
zhi = LunarUtil.ZHI[(self.__index + LunarUtil.BASE_MONTH_ZHI_INDEX) % 12 + 1]
|
||||
return gan + zhi
|
||||
|
||||
def getXun(self):
|
||||
"""
|
||||
获取所在旬
|
||||
:return: 旬
|
||||
"""
|
||||
return LunarUtil.getXun(self.getGanZhi())
|
||||
|
||||
def getXunKong(self):
|
||||
"""
|
||||
获取旬空(空亡)
|
||||
:return: 旬空(空亡)
|
||||
"""
|
||||
return LunarUtil.getXunKong(self.getGanZhi())
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from ..util import LunarUtil
|
||||
|
||||
|
||||
class XiaoYun:
|
||||
"""
|
||||
小运
|
||||
"""
|
||||
|
||||
def __init__(self, da_yun, index, forward):
|
||||
self.__daYun = da_yun
|
||||
self.__lunar = da_yun.getLunar()
|
||||
self.__index = index
|
||||
self.__year = da_yun.getStartYear() + index
|
||||
self.__age = da_yun.getStartAge() + index
|
||||
self.__forward = forward
|
||||
|
||||
def getIndex(self):
|
||||
return self.__index
|
||||
|
||||
def getYear(self):
|
||||
return self.__year
|
||||
|
||||
def getAge(self):
|
||||
return self.__age
|
||||
|
||||
def getGanZhi(self):
|
||||
"""
|
||||
获取干支
|
||||
:return: 干支
|
||||
"""
|
||||
offset = LunarUtil.getJiaZiIndex(self.__lunar.getTimeInGanZhi())
|
||||
add = self.__index + 1
|
||||
if self.__daYun.getIndex() > 0:
|
||||
add += self.__daYun.getStartAge() - 1
|
||||
offset += add if self.__forward else -add
|
||||
size = len(LunarUtil.JIA_ZI)
|
||||
while offset < 0:
|
||||
offset += size
|
||||
offset %= size
|
||||
return LunarUtil.JIA_ZI[offset]
|
||||
|
||||
def getXun(self):
|
||||
"""
|
||||
获取所在旬
|
||||
:return: 旬
|
||||
"""
|
||||
return LunarUtil.getXun(self.getGanZhi())
|
||||
|
||||
def getXunKong(self):
|
||||
"""
|
||||
获取旬空(空亡)
|
||||
:return: 旬空(空亡)
|
||||
"""
|
||||
return LunarUtil.getXunKong(self.getGanZhi())
|
||||
+124
@@ -0,0 +1,124 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from . import DaYun
|
||||
from ..util import LunarUtil
|
||||
|
||||
|
||||
class Yun:
|
||||
"""
|
||||
运
|
||||
"""
|
||||
|
||||
def __init__(self, eight_char, gender, sect=1):
|
||||
self.__lunar = eight_char.getLunar()
|
||||
self.__gender = gender
|
||||
yang = 0 == self.__lunar.getYearGanIndexExact() % 2
|
||||
man = 1 == gender
|
||||
self.__forward = (yang and man) or (not yang and not man)
|
||||
self.__compute_start(sect)
|
||||
|
||||
def __compute_start(self, sect):
|
||||
"""
|
||||
起运计算
|
||||
"""
|
||||
prev_jie = self.__lunar.getPrevJie()
|
||||
next_jie = self.__lunar.getNextJie()
|
||||
current = self.__lunar.getSolar()
|
||||
start = current if self.__forward else prev_jie.getSolar()
|
||||
end = next_jie.getSolar() if self.__forward else current
|
||||
|
||||
hour = 0
|
||||
|
||||
if 2 == sect:
|
||||
minutes = end.subtractMinute(start)
|
||||
year = int(minutes / 4320)
|
||||
minutes -= year * 4320
|
||||
month = int(minutes / 360)
|
||||
minutes -= month * 360
|
||||
day = int(minutes / 12)
|
||||
minutes -= day * 12
|
||||
hour = minutes * 2
|
||||
else:
|
||||
end_time_zhi_index = 11 if end.getHour() == 23 else LunarUtil.getTimeZhiIndex(end.toYmdHms()[11: 16])
|
||||
start_time_zhi_index = 11 if start.getHour() == 23 else LunarUtil.getTimeZhiIndex(start.toYmdHms()[11: 16])
|
||||
# 时辰差
|
||||
hour_diff = end_time_zhi_index - start_time_zhi_index
|
||||
day_diff = end.subtract(start)
|
||||
if hour_diff < 0:
|
||||
hour_diff += 12
|
||||
day_diff -= 1
|
||||
month_diff = int(hour_diff * 10 / 30)
|
||||
month = day_diff * 4 + month_diff
|
||||
day = hour_diff * 10 - month_diff * 30
|
||||
year = int(month / 12)
|
||||
month = month - year * 12
|
||||
self.__startYear = year
|
||||
self.__startMonth = month
|
||||
self.__startDay = day
|
||||
self.__startHour = hour
|
||||
|
||||
def getGender(self):
|
||||
"""
|
||||
获取性别
|
||||
:return: 性别(1男 , 0女)
|
||||
"""
|
||||
return self.__gender
|
||||
|
||||
def getStartYear(self):
|
||||
"""
|
||||
获取起运年数
|
||||
:return: 起运年数
|
||||
"""
|
||||
return self.__startYear
|
||||
|
||||
def getStartMonth(self):
|
||||
"""
|
||||
获取起运月数
|
||||
:return: 起运月数
|
||||
"""
|
||||
return self.__startMonth
|
||||
|
||||
def getStartDay(self):
|
||||
"""
|
||||
获取起运天数
|
||||
:return: 起运天数
|
||||
"""
|
||||
return self.__startDay
|
||||
|
||||
def getStartHour(self):
|
||||
"""
|
||||
获取起运小时数
|
||||
:return: 起运小时数
|
||||
"""
|
||||
return self.__startHour
|
||||
|
||||
def isForward(self):
|
||||
"""
|
||||
是否顺推
|
||||
:return: true/false
|
||||
"""
|
||||
return self.__forward
|
||||
|
||||
def getLunar(self):
|
||||
return self.__lunar
|
||||
|
||||
def getStartSolar(self):
|
||||
"""
|
||||
获取起运的阳历日期
|
||||
:return: 阳历日期
|
||||
"""
|
||||
solar = self.__lunar.getSolar()
|
||||
solar = solar.nextYear(self.__startYear)
|
||||
solar = solar.nextMonth(self.__startMonth)
|
||||
solar = solar.next(self.__startDay)
|
||||
return solar.nextHour(self.__startHour)
|
||||
|
||||
def getDaYun(self, n: int = 10):
|
||||
"""
|
||||
获取大运
|
||||
:param n: 轮数
|
||||
:return: 大运
|
||||
"""
|
||||
da_yun = []
|
||||
for i in range(0, n):
|
||||
da_yun.append(DaYun(self, i))
|
||||
return da_yun
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from .LiuYue import LiuYue
|
||||
from .LiuNian import LiuNian
|
||||
from .XiaoYun import XiaoYun
|
||||
from .DaYun import DaYun
|
||||
from .Yun import Yun
|
||||
+304
@@ -0,0 +1,304 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from ..FotoFestival import FotoFestival
|
||||
|
||||
|
||||
class FotoUtil:
|
||||
"""
|
||||
佛历工具
|
||||
"""
|
||||
|
||||
# 观音斋日期
|
||||
DAY_ZHAI_GUAN_YIN = ("1-8", "2-7", "2-9", "2-19", "3-3", "3-6", "3-13", "4-22", "5-3", "5-17", "6-16", "6-18", "6-19", "6-23", "7-13", "8-16", "9-19", "9-23", "10-2", "11-19", "11-24", "12-25")
|
||||
|
||||
# 27星宿,佛教从印度传入中国,印度把28星宿改为27星宿,把牛宿(牛金牛)纳入了女宿(女土蝠)。
|
||||
XIU_27 = ("角", "亢", "氐", "房", "心", "尾", "箕", "斗", "女", "虚", "危", "室", "壁", "奎", "娄", "胃", "昴", "毕", "觜", "参", "井", "鬼", "柳", "星", "张", "翼", "轸")
|
||||
|
||||
# 每月初一的27星宿偏移
|
||||
XIU_OFFSET = (11, 13, 15, 17, 19, 21, 24, 0, 2, 4, 7, 9)
|
||||
|
||||
@staticmethod
|
||||
def getXiu(month, day):
|
||||
"""
|
||||
获取27星宿
|
||||
:param month: 佛历月
|
||||
:param day: 佛历日
|
||||
:return: 星宿
|
||||
"""
|
||||
return FotoUtil.XIU_27[(FotoUtil.XIU_OFFSET[abs(month)-1] + day - 1) % len(FotoUtil.XIU_27)]
|
||||
|
||||
__DJ = "犯者夺纪"
|
||||
__JS = "犯者减寿"
|
||||
__SS = "犯者损寿"
|
||||
__XL = "犯者削禄夺纪"
|
||||
__JW = "犯者三年内夫妇俱亡"
|
||||
|
||||
__Y = FotoFestival("杨公忌")
|
||||
__T = FotoFestival("四天王巡行", "", True)
|
||||
__D = FotoFestival("斗降", __DJ, True)
|
||||
__S = FotoFestival("月朔", __DJ, True)
|
||||
__W = FotoFestival("月望", __DJ, True)
|
||||
__H = FotoFestival("月晦", __JS, True)
|
||||
__L = FotoFestival("雷斋日", __JS, True)
|
||||
__J = FotoFestival("九毒日", "犯者夭亡,奇祸不测")
|
||||
__R = FotoFestival("人神在阴", "犯者得病", True, "宜先一日即戒")
|
||||
__M = FotoFestival("司命奏事", __JS, True, "如月小,即戒廿九")
|
||||
__HH = FotoFestival("月晦", __JS, True, "如月小,即戒廿九")
|
||||
|
||||
# 日期对应的非正式节日
|
||||
FESTIVAL = {
|
||||
"1-1": [FotoFestival("天腊,玉帝校世人神气禄命", __XL), __S],
|
||||
"1-3": [FotoFestival("万神都会", __DJ), __D],
|
||||
"1-5": [FotoFestival("五虚忌")],
|
||||
"1-6": [FotoFestival("六耗忌"), __L],
|
||||
"1-7": [FotoFestival("上会日", __SS)],
|
||||
"1-8": [FotoFestival("五殿阎罗天子诞", __DJ), __T],
|
||||
"1-9": [FotoFestival("玉皇上帝诞", __DJ)],
|
||||
"1-13": [__Y],
|
||||
"1-14": [FotoFestival("三元降", __JS), __T],
|
||||
"1-15": [FotoFestival("三元降", __JS), FotoFestival("上元神会", __DJ), __W, __T],
|
||||
"1-16": [FotoFestival("三元降", __JS)],
|
||||
"1-19": [FotoFestival("长春真人诞")],
|
||||
"1-23": [FotoFestival("三尸神奏事"), __T],
|
||||
"1-25": [__H, FotoFestival("天地仓开日", "犯者损寿,子带疾")],
|
||||
"1-27": [__D],
|
||||
"1-28": [__R],
|
||||
"1-29": [__T],
|
||||
"1-30": [__HH, __M, __T],
|
||||
"2-1": [FotoFestival("一殿秦广王诞", __DJ), __S],
|
||||
"2-2": [FotoFestival("万神都会", __DJ), FotoFestival("福德土地正神诞", "犯者得祸")],
|
||||
"2-3": [FotoFestival("文昌帝君诞", __XL), __D],
|
||||
"2-6": [FotoFestival("东华帝君诞"), __L],
|
||||
"2-8": [FotoFestival("释迦牟尼佛出家", __DJ), FotoFestival("三殿宋帝王诞", __DJ), FotoFestival("张大帝诞", __DJ), __T],
|
||||
"2-11": [__Y],
|
||||
"2-14": [__T],
|
||||
"2-15": [FotoFestival("释迦牟尼佛涅槃", __XL), FotoFestival("太上老君诞", __XL), FotoFestival("月望", __XL, True), __T],
|
||||
"2-17": [FotoFestival("东方杜将军诞")],
|
||||
"2-18": [FotoFestival("四殿五官王诞", __XL), FotoFestival("至圣先师孔子讳辰", __XL)],
|
||||
"2-19": [FotoFestival("观音大士诞", __DJ)],
|
||||
"2-21": [FotoFestival("普贤菩萨诞")],
|
||||
"2-23": [__T],
|
||||
"2-25": [__H],
|
||||
"2-27": [__D],
|
||||
"2-28": [__R],
|
||||
"2-29": [__T],
|
||||
"2-30": [__HH, __M, __T],
|
||||
"3-1": [FotoFestival("二殿楚江王诞", __DJ), __S],
|
||||
"3-3": [FotoFestival("玄天上帝诞", __DJ), __D],
|
||||
"3-6": [__L],
|
||||
"3-8": [FotoFestival("六殿卞城王诞", __DJ), __T],
|
||||
"3-9": [FotoFestival("牛鬼神出", "犯者产恶胎"), __Y],
|
||||
"3-12": [FotoFestival("中央五道诞")],
|
||||
"3-14": [__T],
|
||||
"3-15": [FotoFestival("昊天上帝诞", __DJ), FotoFestival("玄坛诞", __DJ), __W, __T],
|
||||
"3-16": [FotoFestival("准提菩萨诞", __DJ)],
|
||||
"3-19": [FotoFestival("中岳大帝诞"), FotoFestival("后土娘娘诞"), FotoFestival("三茅降")],
|
||||
"3-20": [FotoFestival("天地仓开日", __SS), FotoFestival("子孙娘娘诞")],
|
||||
"3-23": [__T],
|
||||
"3-25": [__H],
|
||||
"3-27": [FotoFestival("七殿泰山王诞"), __D],
|
||||
"3-28": [__R, FotoFestival("苍颉至圣先师诞", __XL), FotoFestival("东岳大帝诞")],
|
||||
"3-29": [__T],
|
||||
"3-30": [__HH, __M, __T],
|
||||
"4-1": [FotoFestival("八殿都市王诞", __DJ), __S],
|
||||
"4-3": [__D],
|
||||
"4-4": [FotoFestival("万神善会", "犯者失瘼夭胎"), FotoFestival("文殊菩萨诞")],
|
||||
"4-6": [__L],
|
||||
"4-7": [FotoFestival("南斗、北斗、西斗同降", __JS), __Y],
|
||||
"4-8": [FotoFestival("释迦牟尼佛诞", __DJ), FotoFestival("万神善会", "犯者失瘼夭胎"), FotoFestival("善恶童子降", "犯者血死"), FotoFestival("九殿平等王诞"), __T],
|
||||
"4-14": [FotoFestival("纯阳祖师诞", __JS), __T],
|
||||
"4-15": [__W, FotoFestival("钟离祖师诞"), __T],
|
||||
"4-16": [FotoFestival("天地仓开日", __SS)],
|
||||
"4-17": [FotoFestival("十殿转轮王诞", __DJ)],
|
||||
"4-18": [FotoFestival("天地仓开日", __SS), FotoFestival("紫徽大帝诞", __SS)],
|
||||
"4-20": [FotoFestival("眼光圣母诞")],
|
||||
"4-23": [__T],
|
||||
"4-25": [__H],
|
||||
"4-27": [__D],
|
||||
"4-28": [__R],
|
||||
"4-29": [__T],
|
||||
"4-30": [__HH, __M, __T],
|
||||
"5-1": [FotoFestival("南极长生大帝诞", __DJ), __S],
|
||||
"5-3": [__D],
|
||||
"5-5": [FotoFestival("地腊", __XL), FotoFestival("五帝校定生人官爵", __XL), __J, __Y],
|
||||
"5-6": [__J, __L],
|
||||
"5-7": [__J],
|
||||
"5-8": [FotoFestival("南方五道诞"), __T],
|
||||
"5-11": [FotoFestival("天地仓开日", __SS), FotoFestival("天下都城隍诞")],
|
||||
"5-12": [FotoFestival("炳灵公诞")],
|
||||
"5-13": [FotoFestival("关圣降", __XL)],
|
||||
"5-14": [FotoFestival("夜子时为天地交泰", __JW), __T],
|
||||
"5-15": [__W, __J, __T],
|
||||
"5-16": [FotoFestival("九毒日", __JW), FotoFestival("天地元气造化万物之辰", __JW)],
|
||||
"5-17": [__J],
|
||||
"5-18": [FotoFestival("张天师诞")],
|
||||
"5-22": [FotoFestival("孝娥神诞", __DJ)],
|
||||
"5-23": [__T],
|
||||
"5-25": [__J, __H],
|
||||
"5-26": [__J],
|
||||
"5-27": [__J, __D],
|
||||
"5-28": [__R],
|
||||
"5-29": [__T],
|
||||
"5-30": [__HH, __M, __T],
|
||||
"6-1": [__S],
|
||||
"6-3": [FotoFestival("韦驮菩萨圣诞"), __D, __Y],
|
||||
"6-5": [FotoFestival("南赡部洲转大轮", __SS)],
|
||||
"6-6": [FotoFestival("天地仓开日", __SS), __L],
|
||||
"6-8": [__T],
|
||||
"6-10": [FotoFestival("金粟如来诞")],
|
||||
"6-14": [__T],
|
||||
"6-15": [__W, __T],
|
||||
"6-19": [FotoFestival("观世音菩萨成道", __DJ)],
|
||||
"6-23": [FotoFestival("南方火神诞", "犯者遭回禄"), __T],
|
||||
"6-24": [FotoFestival("雷祖诞", __XL), FotoFestival("关帝诞", __XL)],
|
||||
"6-25": [__H],
|
||||
"6-27": [__D],
|
||||
"6-28": [__R],
|
||||
"6-29": [__T],
|
||||
"6-30": [__HH, __M, __T],
|
||||
"7-1": [__S, __Y],
|
||||
"7-3": [__D],
|
||||
"7-5": [FotoFestival("中会日", __SS, False, "一作初七")],
|
||||
"7-6": [__L],
|
||||
"7-7": [FotoFestival("道德腊", __XL), FotoFestival("五帝校生人善恶", __XL), FotoFestival("魁星诞", __XL)],
|
||||
"7-8": [__T],
|
||||
"7-10": [FotoFestival("阴毒日", "", False, "大忌")],
|
||||
"7-12": [FotoFestival("长真谭真人诞")],
|
||||
"7-13": [FotoFestival("大势至菩萨诞", __JS)],
|
||||
"7-14": [FotoFestival("三元降", __JS), __T],
|
||||
"7-15": [__W, FotoFestival("三元降", __DJ), FotoFestival("地官校籍", __DJ), __T],
|
||||
"7-16": [FotoFestival("三元降", __JS)],
|
||||
"7-18": [FotoFestival("西王母诞", __DJ)],
|
||||
"7-19": [FotoFestival("太岁诞", __DJ)],
|
||||
"7-22": [FotoFestival("增福财神诞", __XL)],
|
||||
"7-23": [__T],
|
||||
"7-25": [__H],
|
||||
"7-27": [__D],
|
||||
"7-28": [__R],
|
||||
"7-29": [__Y, __T],
|
||||
"7-30": [FotoFestival("地藏菩萨诞", __DJ), __HH, __M, __T],
|
||||
"8-1": [__S, FotoFestival("许真君诞")],
|
||||
"8-3": [__D, FotoFestival("北斗诞", __XL), FotoFestival("司命灶君诞", "犯者遭回禄")],
|
||||
"8-5": [FotoFestival("雷声大帝诞", __DJ)],
|
||||
"8-6": [__L],
|
||||
"8-8": [__T],
|
||||
"8-10": [FotoFestival("北斗大帝诞")],
|
||||
"8-12": [FotoFestival("西方五道诞")],
|
||||
"8-14": [__T],
|
||||
"8-15": [__W, FotoFestival("太明朝元", "犯者暴亡", False, "宜焚香守夜"), __T],
|
||||
"8-16": [FotoFestival("天曹掠刷真君降", "犯者贫夭")],
|
||||
"8-18": [FotoFestival("天人兴福之辰", "", False, "宜斋戒,存想吉事")],
|
||||
"8-23": [FotoFestival("汉恒候张显王诞"), __T],
|
||||
"8-24": [FotoFestival("灶君夫人诞")],
|
||||
"8-25": [__H],
|
||||
"8-27": [__D, FotoFestival("至圣先师孔子诞", __XL), __Y],
|
||||
"8-28": [__R, FotoFestival("四天会事")],
|
||||
"8-29": [__T],
|
||||
"8-30": [FotoFestival("诸神考校", "犯者夺算"), __HH, __M, __T],
|
||||
"9-1": [__S, FotoFestival("南斗诞", __XL), FotoFestival("北斗九星降世", __DJ, False, "此九日俱宜斋戒")],
|
||||
"9-3": [__D, FotoFestival("五瘟神诞")],
|
||||
"9-6": [__L],
|
||||
"9-8": [__T],
|
||||
"9-9": [FotoFestival("斗母诞", __XL), FotoFestival("酆都大帝诞"), FotoFestival("玄天上帝飞升")],
|
||||
"9-10": [FotoFestival("斗母降", __DJ)],
|
||||
"9-11": [FotoFestival("宜戒")],
|
||||
"9-13": [FotoFestival("孟婆尊神诞")],
|
||||
"9-14": [__T],
|
||||
"9-15": [__W, __T],
|
||||
"9-17": [FotoFestival("金龙四大王诞", "犯者遭水厄")],
|
||||
"9-19": [FotoFestival("日宫月宫会合", __JS), FotoFestival("观世音菩萨诞", __JS)],
|
||||
"9-23": [__T],
|
||||
"9-25": [__H, __Y],
|
||||
"9-27": [__D],
|
||||
"9-28": [__R],
|
||||
"9-29": [__T],
|
||||
"9-30": [FotoFestival("药师琉璃光佛诞", "犯者危疾"), __HH, __M, __T],
|
||||
"10-1": [__S, FotoFestival("民岁腊", __DJ), FotoFestival("四天王降", "犯者一年内死")],
|
||||
"10-3": [__D, FotoFestival("三茅诞")],
|
||||
"10-5": [FotoFestival("下会日", __JS), FotoFestival("达摩祖师诞", __JS)],
|
||||
"10-6": [__L, FotoFestival("天曹考察", __DJ)],
|
||||
"10-8": [FotoFestival("佛涅槃日", "", False, "大忌色欲"), __T],
|
||||
"10-10": [FotoFestival("四天王降", "犯者一年内死")],
|
||||
"10-11": [FotoFestival("宜戒")],
|
||||
"10-14": [FotoFestival("三元降", __JS), __T],
|
||||
"10-15": [__W, FotoFestival("三元降", __DJ), FotoFestival("下元水府校籍", __DJ), __T],
|
||||
"10-16": [FotoFestival("三元降", __JS), __T],
|
||||
"10-23": [__Y, __T],
|
||||
"10-25": [__H],
|
||||
"10-27": [__D, FotoFestival("北极紫徽大帝降")],
|
||||
"10-28": [__R],
|
||||
"10-29": [__T],
|
||||
"10-30": [__HH, __M, __T],
|
||||
"11-1": [__S],
|
||||
"11-3": [__D],
|
||||
"11-4": [FotoFestival("至圣先师孔子诞", __XL)],
|
||||
"11-6": [FotoFestival("西岳大帝诞")],
|
||||
"11-8": [__T],
|
||||
"11-11": [FotoFestival("天地仓开日", __DJ), FotoFestival("太乙救苦天尊诞", __DJ)],
|
||||
"11-14": [__T],
|
||||
"11-15": [FotoFestival("月望", "上半夜犯男死 下半夜犯女死"), FotoFestival("四天王巡行", "上半夜犯男死 下半夜犯女死")],
|
||||
"11-17": [FotoFestival("阿弥陀佛诞")],
|
||||
"11-19": [FotoFestival("太阳日宫诞", "犯者得奇祸")],
|
||||
"11-21": [__Y],
|
||||
"11-23": [FotoFestival("张仙诞", "犯者绝嗣"), __T],
|
||||
"11-25": [FotoFestival("掠刷大夫降", "犯者遭大凶"), __H],
|
||||
"11-26": [FotoFestival("北方五道诞")],
|
||||
"11-27": [__D],
|
||||
"11-28": [__R],
|
||||
"11-29": [__T],
|
||||
"11-30": [__HH, __M, __T],
|
||||
"12-1": [__S],
|
||||
"12-3": [__D],
|
||||
"12-6": [FotoFestival("天地仓开日", __JS), __L],
|
||||
"12-7": [FotoFestival("掠刷大夫降", "犯者得恶疾")],
|
||||
"12-8": [FotoFestival("王侯腊", __DJ), FotoFestival("释迦如来成佛之辰"), __T, FotoFestival("初旬内戊日,亦名王侯腊", __DJ)],
|
||||
"12-12": [FotoFestival("太素三元君朝真")],
|
||||
"12-14": [__T],
|
||||
"12-15": [__W, __T],
|
||||
"12-16": [FotoFestival("南岳大帝诞")],
|
||||
"12-19": [__Y],
|
||||
"12-20": [FotoFestival("天地交道", "犯者促寿")],
|
||||
"12-21": [FotoFestival("天猷上帝诞")],
|
||||
"12-23": [FotoFestival("五岳诞降"), __T],
|
||||
"12-24": [FotoFestival("司今朝天奏人善恶", "犯者得大祸")],
|
||||
"12-25": [FotoFestival("三清玉帝同降,考察善恶", "犯者得奇祸"), __H],
|
||||
"12-27": [__D],
|
||||
"12-28": [__R],
|
||||
"12-29": [FotoFestival("华严菩萨诞"), __T],
|
||||
"12-30": [FotoFestival("诸神下降,察访善恶", "犯者男女俱亡")]
|
||||
}
|
||||
|
||||
OTHER_FESTIVAL = {
|
||||
"1-1": ["弥勒菩萨圣诞"],
|
||||
"1-6": ["定光佛圣诞"],
|
||||
"2-8": ["释迦牟尼佛出家"],
|
||||
"2-15": ["释迦牟尼佛涅槃"],
|
||||
"2-19": ["观世音菩萨圣诞"],
|
||||
"2-21": ["普贤菩萨圣诞"],
|
||||
"3-16": ["准提菩萨圣诞"],
|
||||
"4-4": ["文殊菩萨圣诞"],
|
||||
"4-8": ["释迦牟尼佛圣诞"],
|
||||
"4-15": ["佛吉祥日"],
|
||||
"4-28": ["药王菩萨圣诞"],
|
||||
"5-13": ["伽蓝菩萨圣诞"],
|
||||
"6-3": ["韦驮菩萨圣诞"],
|
||||
"6-19": ["观音菩萨成道"],
|
||||
"7-13": ["大势至菩萨圣诞"],
|
||||
"7-15": ["佛欢喜日"],
|
||||
"7-24": ["龙树菩萨圣诞"],
|
||||
"7-30": ["地藏菩萨圣诞"],
|
||||
"8-15": ["月光菩萨圣诞"],
|
||||
"8-22": ["燃灯佛圣诞"],
|
||||
"9-9": ["摩利支天菩萨圣诞"],
|
||||
"9-19": ["观世音菩萨出家"],
|
||||
"9-30": ["药师琉璃光佛圣诞"],
|
||||
"10-5": ["达摩祖师圣诞"],
|
||||
"10-20": ["文殊菩萨出家"],
|
||||
"11-17": ["阿弥陀佛圣诞"],
|
||||
"11-19": ["日光菩萨圣诞"],
|
||||
"12-8": ["释迦牟尼佛成道"],
|
||||
"12-23": ["监斋菩萨圣诞"],
|
||||
"12-29": ["华严菩萨圣诞"]
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
+179
File diff suppressed because one or more lines are too long
+940
File diff suppressed because one or more lines are too long
+667
@@ -0,0 +1,667 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from math import sin, cos, floor
|
||||
|
||||
|
||||
class ShouXingUtil:
|
||||
"""
|
||||
寿星天文历工具
|
||||
"""
|
||||
PI = 3.141592653589793
|
||||
PI_2 = 2 * PI
|
||||
ONE_THIRD = 1.0 / 3
|
||||
SECOND_PER_DAY = 86400
|
||||
SECOND_PER_RAD = 648000 / PI
|
||||
|
||||
# 中精度章动计算表
|
||||
__NUT_B = (
|
||||
2.1824, -33.75705, 36e-6, -1720, 920,
|
||||
3.5069, 1256.66393, 11e-6, -132, 57,
|
||||
1.3375, 16799.4182, -51e-6, -23, 10,
|
||||
4.3649, -67.5141, 72e-6, 21, -9,
|
||||
0.04, -628.302, 0, -14, 0,
|
||||
2.36, 8328.691, 0, 7, 0,
|
||||
3.46, 1884.966, 0, -5, 2,
|
||||
5.44, 16833.175, 0, -4, 2,
|
||||
3.69, 25128.110, 0, -3, 0,
|
||||
3.55, 628.362, 0, 2, 0
|
||||
)
|
||||
|
||||
# TD - UT1 计算表
|
||||
__DT_AT = (
|
||||
-4000, 108371.7, -13036.80, 392.000, 0.0000,
|
||||
-500, 17201.0, -627.82, 16.170, -0.3413,
|
||||
-150, 12200.6, -346.41, 5.403, -0.1593,
|
||||
150, 9113.8, -328.13, -1.647, 0.0377,
|
||||
500, 5707.5, -391.41, 0.915, 0.3145,
|
||||
900, 2203.4, -283.45, 13.034, -0.1778,
|
||||
1300, 490.1, -57.35, 2.085, -0.0072,
|
||||
1600, 120.0, -9.81, -1.532, 0.1403,
|
||||
1700, 10.2, -0.91, 0.510, -0.0370,
|
||||
1800, 13.4, -0.72, 0.202, -0.0193,
|
||||
1830, 7.8, -1.81, 0.416, -0.0247,
|
||||
1860, 8.3, -0.13, -0.406, 0.0292,
|
||||
1880, -5.4, 0.32, -0.183, 0.0173,
|
||||
1900, -2.3, 2.06, 0.169, -0.0135,
|
||||
1920, 21.2, 1.69, -0.304, 0.0167,
|
||||
1940, 24.2, 1.22, -0.064, 0.0031,
|
||||
1960, 33.2, 0.51, 0.231, -0.0109,
|
||||
1980, 51.0, 1.29, -0.026, 0.0032,
|
||||
2000, 63.87, 0.1, 0, 0,
|
||||
2005, 64.7, 0.21, 0, 0,
|
||||
2012, 66.8, 0.22, 0, 0,
|
||||
2016, 68.1024, 0.5456, -0.0542, -0.001172,
|
||||
2020, 69.3612, 0.0422, -0.0502, 0.006216,
|
||||
2024, 69.1752, -0.0335, -0.0048, 0.000811,
|
||||
2028, 69.0206, -0.0275, 0.0055, -0.000014,
|
||||
2032, 68.9981, 0.0163, 0.0054, 0.000006,
|
||||
2036, 69.1498, 0.0599, 0.0053, 0.000026,
|
||||
2040, 69.4751, 0.1035, 0.0051, 0.000046,
|
||||
2044, 69.9737, 0.1469, 0.0050, 0.000066,
|
||||
2048, 70.6451, 0.1903, 0.0049, 0.000085,
|
||||
2050, 71.0457
|
||||
)
|
||||
__XL0 = (
|
||||
10000000000,
|
||||
20, 578, 920, 1100, 1124, 1136, 1148, 1217, 1226, 1229, 1229, 1229, 1229, 1937, 2363, 2618, 2633, 2660, 2666,
|
||||
17534704567, 0.00000000000, 0.00000000000, 334165646, 4.669256804, 6283.075849991, 3489428, 4.6261024,
|
||||
12566.1517000, 349706, 2.744118, 5753.384885, 341757, 2.828866, 3.523118, 313590, 3.627670, 77713.771468,
|
||||
267622, 4.418084, 7860.419392, 234269, 6.135162, 3930.209696, 132429, 0.742464, 11506.769770, 127317, 2.037097,
|
||||
529.690965, 119917, 1.109629, 1577.343542, 99025, 5.23268, 5884.92685, 90186, 2.04505, 26.29832, 85722, 3.50849,
|
||||
398.14900, 77979, 1.17883, 5223.69392, 75314, 2.53339, 5507.55324, 50526, 4.58293, 18849.22755, 49238, 4.20507,
|
||||
775.52261, 35666, 2.91954, 0.06731, 31709, 5.84902, 11790.62909, 28413, 1.89869, 796.29801, 27104, 0.31489,
|
||||
10977.07880, 24281, 0.34481, 5486.77784, 20616, 4.80647, 2544.31442, 20539, 1.86948, 5573.14280, 20226, 2.45768,
|
||||
6069.77675, 15552, 0.83306, 213.29910, 13221, 3.41118, 2942.46342, 12618, 1.08303, 20.77540, 11513, 0.64545,
|
||||
0.98032, 10285, 0.63600, 4694.00295, 10190, 0.97569, 15720.83878, 10172, 4.26680, 7.11355, 9921, 6.2099,
|
||||
2146.1654, 9761, 0.6810, 155.4204, 8580, 5.9832, 161000.6857, 8513, 1.2987, 6275.9623, 8471, 3.6708, 71430.6956,
|
||||
7964, 1.8079, 17260.1547, 7876, 3.0370, 12036.4607, 7465, 1.7551, 5088.6288, 7387, 3.5032, 3154.6871, 7355,
|
||||
4.6793, 801.8209, 6963, 0.8330, 9437.7629, 6245, 3.9776, 8827.3903, 6115, 1.8184, 7084.8968, 5696, 2.7843,
|
||||
6286.5990, 5612, 4.3869, 14143.4952, 5558, 3.4701, 6279.5527, 5199, 0.1891, 12139.5535, 5161, 1.3328, 1748.0164,
|
||||
5115, 0.2831, 5856.4777, 4900, 0.4874, 1194.4470, 4104, 5.3682, 8429.2413, 4094, 2.3985, 19651.0485, 3920,
|
||||
6.1683, 10447.3878, 3677, 6.0413, 10213.2855, 3660, 2.5696, 1059.3819, 3595, 1.7088, 2352.8662, 3557, 1.7760,
|
||||
6812.7668, 3329, 0.5931, 17789.8456, 3041, 0.4429, 83996.8473, 3005, 2.7398, 1349.8674, 2535, 3.1647, 4690.4798,
|
||||
2474, 0.2148, 3.5904, 2366, 0.4847, 8031.0923, 2357, 2.0653, 3340.6124, 2282, 5.2220, 4705.7323, 2189, 5.5559,
|
||||
553.5694, 2142, 1.4256, 16730.4637, 2109, 4.1483, 951.7184, 2030, 0.3713, 283.8593, 1992, 5.2221, 12168.0027,
|
||||
1986, 5.7747, 6309.3742, 1912, 3.8222, 23581.2582, 1889, 5.3863, 149854.4001, 1790, 2.2149, 13367.9726, 1748,
|
||||
4.5605, 135.0651, 1622, 5.9884, 11769.8537, 1508, 4.1957, 6256.7775, 1442, 4.1932, 242.7286, 1435, 3.7236,
|
||||
38.0277, 1397, 4.4014, 6681.2249, 1362, 1.8893, 7632.9433, 1250, 1.1305, 5.5229, 1205, 2.6223, 955.5997, 1200,
|
||||
1.0035, 632.7837, 1129, 0.1774, 4164.3120, 1083, 0.3273, 103.0928, 1052, 0.9387, 11926.2544, 1050, 5.3591,
|
||||
1592.5960, 1033, 6.1998, 6438.4962, 1001, 6.0291, 5746.2713, 980, 0.999, 11371.705, 980, 5.244, 27511.468, 938,
|
||||
2.624, 5760.498, 923, 0.483, 522.577, 922, 4.571, 4292.331, 905, 5.337, 6386.169, 862, 4.165, 7058.598, 841,
|
||||
3.299, 7234.794, 836, 4.539, 25132.303, 813, 6.112, 4732.031, 812, 6.271, 426.598, 801, 5.821, 28.449, 787,
|
||||
0.996, 5643.179, 776, 2.957, 23013.540, 769, 3.121, 7238.676, 758, 3.974, 11499.656, 735, 4.386, 316.392, 731,
|
||||
0.607, 11513.883, 719, 3.998, 74.782, 706, 0.323, 263.084, 676, 5.911, 90955.552, 663, 3.665, 17298.182, 653,
|
||||
5.791, 18073.705, 630, 4.717, 6836.645, 615, 1.458, 233141.314, 612, 1.075, 19804.827, 596, 3.321, 6283.009,
|
||||
596, 2.876, 6283.143, 555, 2.452, 12352.853, 541, 5.392, 419.485, 531, 0.382, 31441.678, 519, 4.065, 6208.294,
|
||||
513, 2.361, 10973.556, 494, 5.737, 9917.697, 450, 3.272, 11015.106, 449, 3.653, 206.186, 447, 2.064, 7079.374,
|
||||
435, 4.423, 5216.580, 421, 1.906, 245.832, 413, 0.921, 3738.761, 402, 0.840, 20.355, 387, 1.826, 11856.219, 379,
|
||||
2.344, 3.881, 374, 2.954, 3128.389, 370, 5.031, 536.805, 365, 1.018, 16200.773, 365, 1.083, 88860.057, 352,
|
||||
5.978, 3894.182, 352, 2.056, 244287.600, 351, 3.713, 6290.189, 340, 1.106, 14712.317, 339, 0.978, 8635.942, 339,
|
||||
3.202, 5120.601, 333, 0.837, 6496.375, 325, 3.479, 6133.513, 316, 5.089, 21228.392, 316, 1.328, 10873.986, 309,
|
||||
3.646, 10.637, 303, 1.802, 35371.887, 296, 3.397, 9225.539, 288, 6.026, 154717.610, 281, 2.585, 14314.168, 262,
|
||||
3.856, 266.607, 262, 2.579, 22483.849, 257, 1.561, 23543.231, 255, 3.949, 1990.745, 251, 3.744, 10575.407, 240,
|
||||
1.161, 10984.192, 238, 0.106, 7.046, 236, 4.272, 6040.347, 234, 3.577, 10969.965, 211, 3.714, 65147.620, 210,
|
||||
0.754, 13521.751, 207, 4.228, 5650.292, 202, 0.814, 170.673, 201, 4.629, 6037.244, 200, 0.381, 6172.870, 199,
|
||||
3.933, 6206.810, 199, 5.197, 6262.300, 197, 1.046, 18209.330, 195, 1.070, 5230.807, 195, 4.869, 36.028, 194,
|
||||
4.313, 6244.943, 192, 1.229, 709.933, 192, 5.595, 6282.096, 192, 0.602, 6284.056, 189, 3.744, 23.878, 188,
|
||||
1.904, 15.252, 188, 0.867, 22003.915, 182, 3.681, 15110.466, 181, 0.491, 1.484, 179, 3.222, 39302.097, 179,
|
||||
1.259, 12559.038,
|
||||
62833196674749, 0.000000000000, 0.000000000000, 20605886, 2.67823456, 6283.07584999, 430343, 2.635127,
|
||||
12566.151700, 42526, 1.59047, 3.52312, 11926, 5.79557, 26.29832, 10898, 2.96618, 1577.34354, 9348, 2.5921,
|
||||
18849.2275, 7212, 1.1385, 529.6910, 6777, 1.8747, 398.1490, 6733, 4.4092, 5507.5532, 5903, 2.8880, 5223.6939,
|
||||
5598, 2.1747, 155.4204, 4541, 0.3980, 796.2980, 3637, 0.4662, 775.5226, 2896, 2.6471, 7.1135, 2084, 5.3414,
|
||||
0.9803, 1910, 1.8463, 5486.7778, 1851, 4.9686, 213.2991, 1729, 2.9912, 6275.9623, 1623, 0.0322, 2544.3144, 1583,
|
||||
1.4305, 2146.1654, 1462, 1.2053, 10977.0788, 1246, 2.8343, 1748.0164, 1188, 3.2580, 5088.6288, 1181, 5.2738,
|
||||
1194.4470, 1151, 2.0750, 4694.0030, 1064, 0.7661, 553.5694, 997, 1.303, 6286.599, 972, 4.239, 1349.867, 945,
|
||||
2.700, 242.729, 858, 5.645, 951.718, 758, 5.301, 2352.866, 639, 2.650, 9437.763, 610, 4.666, 4690.480, 583,
|
||||
1.766, 1059.382, 531, 0.909, 3154.687, 522, 5.661, 71430.696, 520, 1.854, 801.821, 504, 1.425, 6438.496, 433,
|
||||
0.241, 6812.767, 426, 0.774, 10447.388, 413, 5.240, 7084.897, 374, 2.001, 8031.092, 356, 2.429, 14143.495, 350,
|
||||
4.800, 6279.553, 337, 0.888, 12036.461, 337, 3.862, 1592.596, 325, 3.400, 7632.943, 322, 0.616, 8429.241, 318,
|
||||
3.188, 4705.732, 297, 6.070, 4292.331, 295, 1.431, 5746.271, 290, 2.325, 20.355, 275, 0.935, 5760.498, 270,
|
||||
4.804, 7234.794, 253, 6.223, 6836.645, 228, 5.003, 17789.846, 225, 5.672, 11499.656, 215, 5.202, 11513.883, 208,
|
||||
3.955, 10213.286, 208, 2.268, 522.577, 206, 2.224, 5856.478, 206, 2.550, 25132.303, 203, 0.910, 6256.778, 189,
|
||||
0.532, 3340.612, 188, 4.735, 83996.847, 179, 1.474, 4164.312, 178, 3.025, 5.523, 177, 3.026, 5753.385, 159,
|
||||
4.637, 3.286, 157, 6.124, 5216.580, 155, 3.077, 6681.225, 154, 4.200, 13367.973, 143, 1.191, 3894.182, 138,
|
||||
3.093, 135.065, 136, 4.245, 426.598, 134, 5.765, 6040.347, 128, 3.085, 5643.179, 127, 2.092, 6290.189, 125,
|
||||
3.077, 11926.254, 125, 3.445, 536.805, 114, 3.244, 12168.003, 112, 2.318, 16730.464, 111, 3.901, 11506.770, 111,
|
||||
5.320, 23.878, 105, 3.750, 7860.419, 103, 2.447, 1990.745, 96, 0.82, 3.88, 96, 4.08, 6127.66, 91, 5.42, 206.19,
|
||||
91, 0.42, 7079.37, 88, 5.17, 11790.63, 81, 0.34, 9917.70, 80, 3.89, 10973.56, 78, 2.40, 1589.07, 78, 2.58,
|
||||
11371.70, 77, 3.98, 955.60, 77, 3.36, 36.03, 76, 1.30, 103.09, 75, 5.18, 10969.97, 75, 4.96, 6496.37, 73, 5.21,
|
||||
38.03, 72, 2.65, 6309.37, 70, 5.61, 3738.76, 69, 2.60, 3496.03, 69, 0.39, 15.25, 69, 2.78, 20.78, 65, 1.13,
|
||||
7058.60, 64, 4.28, 28.45, 61, 5.63, 10984.19, 60, 0.73, 419.48, 60, 5.28, 10575.41, 58, 5.55, 17298.18, 58,
|
||||
3.19, 4732.03,
|
||||
5291887, 0.0000000, 0.0000000, 871984, 1.072097, 6283.075850, 30913, 0.86729, 12566.15170, 2734, 0.0530, 3.5231,
|
||||
1633, 5.1883, 26.2983, 1575, 3.6846, 155.4204, 954, 0.757, 18849.228, 894, 2.057, 77713.771, 695, 0.827,
|
||||
775.523, 506, 4.663, 1577.344, 406, 1.031, 7.114, 381, 3.441, 5573.143, 346, 5.141, 796.298, 317, 6.053,
|
||||
5507.553, 302, 1.192, 242.729, 289, 6.117, 529.691, 271, 0.306, 398.149, 254, 2.280, 553.569, 237, 4.381,
|
||||
5223.694, 208, 3.754, 0.980, 168, 0.902, 951.718, 153, 5.759, 1349.867, 145, 4.364, 1748.016, 134, 3.721,
|
||||
1194.447, 125, 2.948, 6438.496, 122, 2.973, 2146.165, 110, 1.271, 161000.686, 104, 0.604, 3154.687, 100, 5.986,
|
||||
6286.599, 92, 4.80, 5088.63, 89, 5.23, 7084.90, 83, 3.31, 213.30, 76, 3.42, 5486.78, 71, 6.19, 4690.48, 68,
|
||||
3.43, 4694.00, 65, 1.60, 2544.31, 64, 1.98, 801.82, 61, 2.48, 10977.08, 50, 1.44, 6836.65, 49, 2.34, 1592.60,
|
||||
46, 1.31, 4292.33, 46, 3.81, 149854.40, 43, 0.04, 7234.79, 40, 4.94, 7632.94, 39, 1.57, 71430.70, 38, 3.17,
|
||||
6309.37, 35, 0.99, 6040.35, 35, 0.67, 1059.38, 31, 3.18, 2352.87, 31, 3.55, 8031.09, 30, 1.92, 10447.39, 30,
|
||||
2.52, 6127.66, 28, 4.42, 9437.76, 28, 2.71, 3894.18, 27, 0.67, 25132.30, 26, 5.27, 6812.77, 25, 0.55, 6279.55,
|
||||
23, 1.38, 4705.73, 22, 0.64, 6256.78, 20, 6.07, 640.88,
|
||||
28923, 5.84384, 6283.07585, 3496, 0.0000, 0.0000, 1682, 5.4877, 12566.1517, 296, 5.196, 155.420, 129, 4.722,
|
||||
3.523, 71, 5.30, 18849.23, 64, 5.97, 242.73, 40, 3.79, 553.57,
|
||||
11408, 3.14159, 0.00000, 772, 4.134, 6283.076, 77, 3.84, 12566.15, 42, 0.42, 155.42,
|
||||
88, 3.14, 0.00, 17, 2.77, 6283.08, 5, 2.01, 155.42, 3, 2.21, 12566.15,
|
||||
27962, 3.19870, 84334.66158, 10164, 5.42249, 5507.55324, 8045, 3.8801, 5223.6939, 4381, 3.7044, 2352.8662, 3193,
|
||||
4.0003, 1577.3435, 2272, 3.9847, 1047.7473, 1814, 4.9837, 6283.0758, 1639, 3.5646, 5856.4777, 1444, 3.7028,
|
||||
9437.7629, 1430, 3.4112, 10213.2855, 1125, 4.8282, 14143.4952, 1090, 2.0857, 6812.7668, 1037, 4.0566,
|
||||
71092.8814, 971, 3.473, 4694.003, 915, 1.142, 6620.890, 878, 4.440, 5753.385, 837, 4.993, 7084.897, 770, 5.554,
|
||||
167621.576, 719, 3.602, 529.691, 692, 4.326, 6275.962, 558, 4.410, 7860.419, 529, 2.484, 4705.732, 521, 6.250,
|
||||
18073.705,
|
||||
903, 3.897, 5507.553, 618, 1.730, 5223.694, 380, 5.244, 2352.866,
|
||||
166, 1.627, 84334.662,
|
||||
10001398880, 0.00000000000, 0.00000000000, 167069963, 3.098463508, 6283.075849991, 1395602, 3.0552461,
|
||||
12566.1517000, 308372, 5.198467, 77713.771468, 162846, 1.173877, 5753.384885, 157557, 2.846852, 7860.419392,
|
||||
92480, 5.45292, 11506.76977, 54244, 4.56409, 3930.20970, 47211, 3.66100, 5884.92685, 34598, 0.96369, 5507.55324,
|
||||
32878, 5.89984, 5223.69392, 30678, 0.29867, 5573.14280, 24319, 4.27350, 11790.62909, 21183, 5.84715, 1577.34354,
|
||||
18575, 5.02194, 10977.07880, 17484, 3.01194, 18849.22755, 10984, 5.05511, 5486.77784, 9832, 0.8868, 6069.7768,
|
||||
8650, 5.6896, 15720.8388, 8583, 1.2708, 161000.6857, 6490, 0.2725, 17260.1547, 6292, 0.9218, 529.6910, 5706,
|
||||
2.0137, 83996.8473, 5574, 5.2416, 71430.6956, 4938, 3.2450, 2544.3144, 4696, 2.5781, 775.5226, 4466, 5.5372,
|
||||
9437.7629, 4252, 6.0111, 6275.9623, 3897, 5.3607, 4694.0030, 3825, 2.3926, 8827.3903, 3749, 0.8295, 19651.0485,
|
||||
3696, 4.9011, 12139.5535, 3566, 1.6747, 12036.4607, 3454, 1.8427, 2942.4634, 3319, 0.2437, 7084.8968, 3192,
|
||||
0.1837, 5088.6288, 3185, 1.7778, 398.1490, 2846, 1.2134, 6286.5990, 2779, 1.8993, 6279.5527, 2628, 4.5890,
|
||||
10447.3878, 2460, 3.7866, 8429.2413, 2393, 4.9960, 5856.4777, 2359, 0.2687, 796.2980, 2329, 2.8078, 14143.4952,
|
||||
2210, 1.9500, 3154.6871, 2035, 4.6527, 2146.1654, 1951, 5.3823, 2352.8662, 1883, 0.6731, 149854.4001, 1833,
|
||||
2.2535, 23581.2582, 1796, 0.1987, 6812.7668, 1731, 6.1520, 16730.4637, 1717, 4.4332, 10213.2855, 1619, 5.2316,
|
||||
17789.8456, 1381, 5.1896, 8031.0923, 1364, 3.6852, 4705.7323, 1314, 0.6529, 13367.9726, 1041, 4.3329,
|
||||
11769.8537, 1017, 1.5939, 4690.4798, 998, 4.201, 6309.374, 966, 3.676, 27511.468, 874, 6.064, 1748.016, 779,
|
||||
3.674, 12168.003, 771, 0.312, 7632.943, 756, 2.626, 6256.778, 746, 5.648, 11926.254, 693, 2.924, 6681.225, 680,
|
||||
1.423, 23013.540, 674, 0.563, 3340.612, 663, 5.661, 11371.705, 659, 3.136, 801.821, 648, 2.650, 19804.827, 615,
|
||||
3.029, 233141.314, 612, 5.134, 1194.447, 563, 4.341, 90955.552, 552, 2.091, 17298.182, 534, 5.100, 31441.678,
|
||||
531, 2.407, 11499.656, 523, 4.624, 6438.496, 513, 5.324, 11513.883, 477, 0.256, 11856.219, 461, 1.722, 7234.794,
|
||||
458, 3.766, 6386.169, 458, 4.466, 5746.271, 423, 1.055, 5760.498, 422, 1.557, 7238.676, 415, 2.599, 7058.598,
|
||||
401, 3.030, 1059.382, 397, 1.201, 1349.867, 379, 4.907, 4164.312, 360, 5.707, 5643.179, 352, 3.626, 244287.600,
|
||||
348, 0.761, 10973.556, 342, 3.001, 4292.331, 336, 4.546, 4732.031, 334, 3.138, 6836.645, 324, 4.164, 9917.697,
|
||||
316, 1.691, 11015.106, 307, 0.238, 35371.887, 298, 1.306, 6283.143, 298, 1.750, 6283.009, 293, 5.738, 16200.773,
|
||||
286, 5.928, 14712.317, 281, 3.515, 21228.392, 280, 5.663, 8635.942, 277, 0.513, 26.298, 268, 4.207, 18073.705,
|
||||
266, 0.900, 12352.853, 260, 2.962, 25132.303, 255, 2.477, 6208.294, 242, 2.800, 709.933, 231, 1.054, 22483.849,
|
||||
229, 1.070, 14314.168, 216, 1.314, 154717.610, 215, 6.038, 10873.986, 200, 0.561, 7079.374, 198, 2.614, 951.718,
|
||||
197, 4.369, 167283.762, 186, 2.861, 5216.580, 183, 1.660, 39302.097, 183, 5.912, 3738.761, 175, 2.145, 6290.189,
|
||||
173, 2.168, 10575.407, 171, 3.702, 1592.596, 171, 1.343, 3128.389, 164, 5.550, 6496.375, 164, 5.856, 10984.192,
|
||||
161, 1.998, 10969.965, 161, 1.909, 6133.513, 157, 4.955, 25158.602, 154, 6.216, 23543.231, 153, 5.357,
|
||||
13521.751, 150, 5.770, 18209.330, 150, 5.439, 155.420, 139, 1.778, 9225.539, 139, 1.626, 5120.601, 128, 2.460,
|
||||
13916.019, 123, 0.717, 143571.324, 122, 2.654, 88860.057, 121, 4.414, 3894.182, 121, 1.192, 3.523, 120, 4.030,
|
||||
553.569, 119, 1.513, 17654.781, 117, 3.117, 14945.316, 113, 2.698, 6040.347, 110, 3.085, 43232.307, 109, 0.998,
|
||||
955.600, 108, 2.939, 17256.632, 107, 5.285, 65147.620, 103, 0.139, 11712.955, 103, 5.850, 213.299, 102, 3.046,
|
||||
6037.244, 101, 2.842, 8662.240, 100, 3.626, 6262.300, 98, 2.36, 6206.81, 98, 5.11, 6172.87, 98, 2.00, 15110.47,
|
||||
97, 2.67, 5650.29, 97, 2.75, 6244.94, 96, 4.02, 6282.10, 96, 5.31, 6284.06, 92, 0.10, 29088.81, 85, 3.26,
|
||||
20426.57, 84, 2.60, 28766.92, 81, 3.58, 10177.26, 80, 5.81, 5230.81, 78, 2.53, 16496.36, 77, 4.06, 6127.66, 73,
|
||||
0.04, 5481.25, 72, 5.96, 12559.04, 72, 5.92, 4136.91, 71, 5.49, 22003.91, 70, 3.41, 7.11, 69, 0.62, 11403.68,
|
||||
69, 3.90, 1589.07, 69, 1.96, 12416.59, 69, 4.51, 426.60, 67, 1.61, 11087.29, 66, 4.50, 47162.52, 66, 5.08,
|
||||
283.86, 66, 4.32, 16858.48, 65, 1.04, 6062.66, 64, 1.59, 18319.54, 63, 5.70, 45892.73, 63, 4.60, 66567.49, 63,
|
||||
3.82, 13517.87, 62, 2.62, 11190.38, 61, 1.54, 33019.02, 60, 5.58, 10344.30, 60, 5.38, 316428.23, 60, 5.78,
|
||||
632.78, 59, 6.12, 9623.69, 57, 0.16, 17267.27, 57, 3.86, 6076.89, 57, 1.98, 7668.64, 56, 4.78, 20199.09, 55,
|
||||
4.56, 18875.53, 55, 3.51, 17253.04, 54, 3.07, 226858.24, 54, 4.83, 18422.63, 53, 5.02, 12132.44, 52, 3.63,
|
||||
5333.90, 52, 0.97, 155427.54, 51, 3.36, 20597.24, 50, 0.99, 11609.86, 50, 2.21, 1990.75, 48, 1.62, 12146.67, 48,
|
||||
1.17, 12569.67, 47, 4.62, 5436.99, 47, 1.81, 12562.63, 47, 0.59, 21954.16, 47, 0.76, 7342.46, 46, 0.27, 4590.91,
|
||||
46, 3.77, 156137.48, 45, 5.66, 10454.50, 44, 5.84, 3496.03, 43, 0.24, 17996.03, 41, 5.93, 51092.73, 41, 4.21,
|
||||
12592.45, 40, 5.14, 1551.05, 40, 5.28, 15671.08, 39, 3.69, 18052.93, 39, 4.94, 24356.78, 38, 2.72, 11933.37, 38,
|
||||
5.23, 7477.52, 38, 4.99, 9779.11, 37, 3.70, 9388.01, 37, 4.44, 4535.06, 36, 2.16, 28237.23, 36, 2.54, 242.73,
|
||||
36, 0.22, 5429.88, 35, 6.15, 19800.95, 35, 2.92, 36949.23, 34, 5.63, 2379.16, 34, 5.73, 16460.33, 34, 5.11,
|
||||
5849.36, 33, 6.19, 6268.85,
|
||||
10301861, 1.10748970, 6283.07584999, 172124, 1.064423, 12566.151700, 70222, 3.14159, 0.00000, 3235, 1.0217,
|
||||
18849.2275, 3080, 2.8435, 5507.5532, 2497, 1.3191, 5223.6939, 1849, 1.4243, 1577.3435, 1008, 5.9138, 10977.0788,
|
||||
865, 1.420, 6275.962, 863, 0.271, 5486.778, 507, 1.686, 5088.629, 499, 6.014, 6286.599, 467, 5.987, 529.691,
|
||||
440, 0.518, 4694.003, 410, 1.084, 9437.763, 387, 4.750, 2544.314, 375, 5.071, 796.298, 352, 0.023, 83996.847,
|
||||
344, 0.949, 71430.696, 341, 5.412, 775.523, 322, 6.156, 2146.165, 286, 5.484, 10447.388, 284, 3.420, 2352.866,
|
||||
255, 6.132, 6438.496, 252, 0.243, 398.149, 243, 3.092, 4690.480, 225, 3.689, 7084.897, 220, 4.952, 6812.767,
|
||||
219, 0.420, 8031.092, 209, 1.282, 1748.016, 193, 5.314, 8429.241, 185, 1.820, 7632.943, 175, 3.229, 6279.553,
|
||||
173, 1.537, 4705.732, 158, 4.097, 11499.656, 158, 5.539, 3154.687, 150, 3.633, 11513.883, 148, 3.222, 7234.794,
|
||||
147, 3.653, 1194.447, 144, 0.817, 14143.495, 135, 6.151, 5746.271, 134, 4.644, 6836.645, 128, 2.693, 1349.867,
|
||||
123, 5.650, 5760.498, 118, 2.577, 13367.973, 113, 3.357, 17789.846, 110, 4.497, 4292.331, 108, 5.828, 12036.461,
|
||||
102, 5.621, 6256.778, 99, 1.14, 1059.38, 98, 0.66, 5856.48, 93, 2.32, 10213.29, 92, 0.77, 16730.46, 88, 1.50,
|
||||
11926.25, 86, 1.42, 5753.38, 85, 0.66, 155.42, 81, 1.64, 6681.22, 80, 4.11, 951.72, 66, 4.55, 5216.58, 65, 0.98,
|
||||
25132.30, 64, 4.19, 6040.35, 64, 0.52, 6290.19, 63, 1.51, 5643.18, 59, 6.18, 4164.31, 57, 2.30, 10973.56, 55,
|
||||
2.32, 11506.77, 55, 2.20, 1592.60, 55, 5.27, 3340.61, 54, 5.54, 553.57, 53, 5.04, 9917.70, 53, 0.92, 11371.70,
|
||||
52, 3.98, 17298.18, 52, 3.60, 10969.97, 49, 5.91, 3894.18, 49, 2.51, 6127.66, 48, 1.67, 12168.00, 46, 0.31,
|
||||
801.82, 42, 3.70, 10575.41, 42, 4.05, 10984.19, 40, 2.17, 7860.42, 40, 4.17, 26.30, 38, 5.82, 7058.60, 37, 3.39,
|
||||
6496.37, 36, 1.08, 6309.37, 36, 5.34, 7079.37, 34, 3.62, 11790.63, 32, 0.32, 16200.77, 31, 4.24, 3738.76, 29,
|
||||
4.55, 11856.22, 29, 1.26, 8635.94, 27, 3.45, 5884.93, 26, 5.08, 10177.26, 26, 5.38, 21228.39, 24, 2.26,
|
||||
11712.96, 24, 1.05, 242.73, 24, 5.59, 6069.78, 23, 3.63, 6284.06, 23, 1.64, 4732.03, 22, 3.46, 213.30, 21, 1.05,
|
||||
3496.03, 21, 3.92, 13916.02, 21, 4.01, 5230.81, 20, 5.16, 12352.85, 20, 0.69, 1990.75, 19, 2.73, 6062.66, 19,
|
||||
5.01, 11015.11, 18, 6.04, 6283.01, 18, 2.85, 7238.68, 18, 5.60, 6283.14, 18, 5.16, 17253.04, 18, 2.54, 14314.17,
|
||||
17, 1.58, 7.11, 17, 0.98, 3930.21, 17, 4.75, 17267.27, 16, 2.19, 6076.89, 16, 2.19, 18073.70, 16, 6.12, 3.52,
|
||||
16, 4.61, 9623.69, 16, 3.40, 16496.36, 15, 0.19, 9779.11, 15, 5.30, 13517.87, 15, 4.26, 3128.39, 15, 0.81,
|
||||
709.93, 14, 0.50, 25158.60, 14, 4.38, 4136.91, 13, 0.98, 65147.62, 13, 3.31, 154717.61, 13, 2.11, 1589.07, 13,
|
||||
1.92, 22483.85, 12, 6.03, 9225.54, 12, 1.53, 12559.04, 12, 5.82, 6282.10, 12, 5.61, 5642.20, 12, 2.38,
|
||||
167283.76, 12, 0.39, 12132.44, 12, 3.98, 4686.89, 12, 5.81, 12569.67, 12, 0.56, 5849.36, 11, 0.45, 6172.87, 11,
|
||||
5.80, 16858.48, 11, 6.22, 12146.67, 11, 2.27, 5429.88,
|
||||
435939, 5.784551, 6283.075850, 12363, 5.57935, 12566.15170, 1234, 3.1416, 0.0000, 879, 3.628, 77713.771, 569,
|
||||
1.870, 5573.143, 330, 5.470, 18849.228, 147, 4.480, 5507.553, 110, 2.842, 161000.686, 101, 2.815, 5223.694, 85,
|
||||
3.11, 1577.34, 65, 5.47, 775.52, 61, 1.38, 6438.50, 50, 4.42, 6286.60, 47, 3.66, 7084.90, 46, 5.39, 149854.40,
|
||||
42, 0.90, 10977.08, 40, 3.20, 5088.63, 35, 1.81, 5486.78, 32, 5.35, 3154.69, 30, 3.52, 796.30, 29, 4.62,
|
||||
4690.48, 28, 1.84, 4694.00, 27, 3.14, 71430.70, 27, 6.17, 6836.65, 26, 1.42, 2146.17, 25, 2.81, 1748.02, 24,
|
||||
2.18, 155.42, 23, 4.76, 7234.79, 21, 3.38, 7632.94, 21, 0.22, 4705.73, 20, 4.22, 1349.87, 20, 2.01, 1194.45, 20,
|
||||
4.58, 529.69, 19, 1.59, 6309.37, 18, 5.70, 6040.35, 18, 6.03, 4292.33, 17, 2.90, 9437.76, 17, 2.00, 8031.09, 17,
|
||||
5.78, 83996.85, 16, 0.05, 2544.31, 15, 0.95, 6127.66, 14, 0.36, 10447.39, 14, 1.48, 2352.87, 13, 0.77, 553.57,
|
||||
13, 5.48, 951.72, 13, 5.27, 6279.55, 13, 3.76, 6812.77, 11, 5.41, 6256.78, 10, 0.68, 1592.60, 10, 4.95, 398.15,
|
||||
10, 1.15, 3894.18, 10, 5.20, 244287.60, 10, 1.94, 11856.22, 9, 5.39, 25132.30, 8, 6.18, 1059.38, 8, 0.69,
|
||||
8429.24, 8, 5.85, 242.73, 7, 5.26, 14143.50, 7, 0.52, 801.82, 6, 2.24, 8635.94, 6, 4.00, 13367.97, 6, 2.77,
|
||||
90955.55, 6, 5.17, 7058.60, 5, 1.46, 233141.31, 5, 4.13, 7860.42, 5, 3.91, 26.30, 5, 3.89, 12036.46, 5, 5.58,
|
||||
6290.19, 5, 5.54, 1990.75, 5, 0.83, 11506.77, 5, 6.22, 6681.22, 4, 5.26, 10575.41, 4, 1.91, 7477.52, 4, 0.43,
|
||||
10213.29, 4, 1.09, 709.93, 4, 5.09, 11015.11, 4, 4.22, 88860.06, 4, 3.57, 7079.37, 4, 1.98, 6284.06, 4, 3.93,
|
||||
10973.56, 4, 6.18, 9917.70, 4, 0.36, 10177.26, 4, 2.75, 3738.76, 4, 3.33, 5643.18, 4, 5.36, 25158.60,
|
||||
14459, 4.27319, 6283.07585, 673, 3.917, 12566.152, 77, 0.00, 0.00, 25, 3.73, 18849.23, 4, 2.80, 6286.60,
|
||||
386, 2.564, 6283.076, 31, 2.27, 12566.15, 5, 3.44, 5573.14, 2, 2.05, 18849.23, 1, 2.06, 77713.77, 1, 4.41,
|
||||
161000.69, 1, 3.82, 149854.40, 1, 4.08, 6127.66, 1, 5.26, 6438.50,
|
||||
9, 1.22, 6283.08, 1, 0.66, 12566.15
|
||||
)
|
||||
|
||||
__XL1 = (
|
||||
(22639.586, 0.78475822, 8328.691424623, 1.5229241, 25.0719, -0.123598, 4586.438, 0.1873974, 7214.06286536, -2.184756, -18.860, 0.08280, 2369.914, 2.5429520, 15542.75428998, -0.661832, 6.212, -0.04080, 769.026, 3.140313, 16657.38284925, 3.04585, 50.144, -0.2472, 666.418, 1.527671, 628.30195521, -0.02664, 0.062, -0.0054, 411.596, 4.826607, 16866.9323150, -1.28012, -1.07, -0.0059, 211.656, 4.115028, -1114.6285593, -3.70768, -43.93, 0.2064, 205.436, 0.230523, 6585.7609101, -2.15812, -18.92, 0.0882, 191.956, 4.898507, 23871.4457146, 0.86109, 31.28, -0.164, 164.729, 2.586078, 14914.4523348, -0.6352, 6.15, -0.035, 147.321, 5.45530, -7700.3894694, -1.5496, -25.01, 0.118, 124.988, 0.48608, 7771.3771450, -0.3309, 3.11, -0.020, 109.380, 3.88323, 8956.9933798, 1.4963, 25.13, -0.129, 55.177,
|
||||
5.57033, -1324.1780250, 0.6183, 7.3, -0.035, 45.100, 0.89898, 25195.623740, 0.2428, 24.0, -0.129, 39.533, 3.81213, -8538.240890, 2.8030, 26.1, -0.118, 38.430, 4.30115, 22756.817155, -2.8466, -12.6, 0.042, 36.124, 5.49587, 24986.074274, 4.5688, 75.2, -0.371, 30.773, 1.94559, 14428.125731, -4.3695, -37.7, 0.166, 28.397, 3.28586, 7842.364821, -2.2114, -18.8, 0.077, 24.358, 5.64142, 16171.056245, -0.6885, 6.3, -0.046, 18.585, 4.41371, -557.314280, -1.8538, -22.0, 0.10, 17.954, 3.58454, 8399.679100, -0.3576, 3.2, -0.03, 14.530, 4.9416, 23243.143759, 0.888, 31.2, -0.16, 14.380, 0.9709, 32200.137139, 2.384, 56.4, -0.29, 14.251, 5.7641, -2.301200, 1.523, 25.1, -0.12, 13.899, 0.3735, 31085.508580, -1.324, 12.4, -0.08, 13.194, 1.7595, -9443.319984, -5.231, -69.0, 0.33, 9.679, 3.0997,
|
||||
-16029.080894, -3.072, -50.1, 0.24, 9.366, 0.3016, 24080.995180, -3.465, -19.9, 0.08, 8.606, 4.1582, -1742.930514, -3.681, -44.0, 0.21, 8.453, 2.8416, 16100.068570, 1.192, 28.2, -0.14, 8.050, 2.6292, 14286.150380, -0.609, 6.1, -0.03, 7.630, 6.2388, 17285.684804, 3.019, 50.2, -0.25, 7.447, 1.4845, 1256.603910, -0.053, 0.1, -0.01, 7.371, 0.2736, 5957.458955, -2.131, -19.0, 0.09, 7.063, 5.6715, 33.757047, -0.308, -3.6, 0.02, 6.383, 4.7843, 7004.513400, 2.141, 32.4, -0.16, 5.742, 2.6572, 32409.686605, -1.942, 5, -0.05, 4.374, 4.3443, 22128.51520, -2.820, -13, 0.05, 3.998, 3.2545, 33524.31516, 1.766, 49, -0.25, 3.210, 2.2443, 14985.44001, -2.516, -16, 0.06, 2.915, 1.7138, 24499.74767, 0.834, 31, -0.17, 2.732, 1.9887, 13799.82378, -4.343, -38, 0.17, 2.568, 5.4122, -7072.08751, -1.576,
|
||||
-25, 0.11, 2.521, 3.2427, 8470.66678, -2.238, -19, 0.07, 2.489, 4.0719, -486.32660, -3.734, -44, 0.20, 2.146, 5.6135, -1952.47998, 0.645, 7, -0.03, 1.978, 2.7291, 39414.20000, 0.199, 37, -0.21, 1.934, 1.5682, 33314.76570, 6.092, 100, -0.5, 1.871, 0.4166, 30457.20662, -1.297, 12, -0.1, 1.753, 2.0582, -8886.00570, -3.38, -47, 0.2, 1.437, 2.386, -695.87607, 0.59, 7, 0, 1.373, 3.026, -209.54947, 4.33, 51, -0.2, 1.262, 5.940, 16728.37052, 1.17, 28, -0.1, 1.224, 6.172, 6656.74859, -4.04, -41, 0.2, 1.187, 5.873, 6099.43431, -5.89, -63, 0.3, 1.177, 1.014, 31571.83518, 2.41, 56, -0.3, 1.162, 3.840, 9585.29534, 1.47, 25, -0.1, 1.143, 5.639, 8364.73984, -2.18, -19, 0.1, 1.078, 1.229, 70.98768, -1.88, -22, 0.1, 1.059, 3.326, 40528.82856, 3.91, 81, -0.4, 0.990, 5.013, 40738.37803, -0.42, 30,
|
||||
-0.2, 0.948, 5.687, -17772.01141, -6.75, -94, 0.5, 0.876, 0.298, -0.35232, 0, 0, 0, 0.822, 2.994, 393.02097, 0, 0, 0, 0.788, 1.836, 8326.39022, 3.05, 50, -0.2, 0.752, 4.985, 22614.84180, 0.91, 31, -0.2, 0.740, 2.875, 8330.99262, 0, 0, 0, 0.669, 0.744, -24357.77232, -4.60, -75, 0.4, 0.644, 1.314, 8393.12577, -2.18, -19, 0.1, 0.639, 5.888, 575.33849, 0, 0, 0, 0.635, 1.116, 23385.11911, -2.87, -13, 0, 0.584, 5.197, 24428.75999, 2.71, 53, -0.3, 0.583, 3.513, -9095.55517, 0.95, 4, 0, 0.572, 6.059, 29970.88002, -5.03, -32, 0.1, 0.565, 2.960, 0.32863, 1.52, 25, -0.1, 0.561, 4.001, -17981.56087, -2.43, -43, 0.2, 0.557, 0.529, 7143.07519, -0.30, 3, 0, 0.546, 2.311, 25614.37623, 4.54, 75, -0.4, 0.536, 4.229, 15752.30376, -4.99, -45, 0.2, 0.493, 3.316, -8294.9344, -1.83, -29, 0.1, 0.491,
|
||||
1.744, 8362.4485, 1.21, 21, -0.1, 0.478, 1.803, -10071.6219, -5.20, -69, 0.3, 0.454, 0.857, 15333.2048, 3.66, 57, -0.3, 0.445, 2.071, 8311.7707, -2.18, -19, 0.1, 0.426, 0.345, 23452.6932, -3.44, -20, 0.1, 0.420, 4.941, 33733.8646, -2.56, -2, 0, 0.413, 1.642, 17495.2343, -1.31, -1, 0, 0.404, 1.458, 23314.1314, -0.99, 9, -0.1, 0.395, 2.132, 38299.5714, -3.51, -6, 0, 0.382, 2.700, 31781.3846, -1.92, 5, 0, 0.375, 4.827, 6376.2114, 2.17, 32, -0.2, 0.361, 3.867, 16833.1753, -0.97, 3, 0, 0.358, 5.044, 15056.4277, -4.40, -38, 0.2, 0.350, 5.157, -8257.7037, -3.40, -47, 0.2, 0.344, 4.233, 157.7344, 0, 0, 0, 0.340, 2.672, 13657.8484, -0.58, 6, 0, 0.329, 5.610, 41853.0066, 3.29, 74, -0.4, 0.325, 5.895, -39.8149, 0, 0, 0, 0.309, 4.387, 21500.2132, -2.79, -13, 0.1, 0.302, 1.278, 786.0419, 0, 0,
|
||||
0, 0.302, 5.341, -24567.3218, -0.27, -24, 0.1, 0.301, 1.045, 5889.8848, -1.57, -12, 0, 0.294, 4.201, -2371.2325, -3.65, -44, 0.2, 0.293, 3.704, 21642.1886, -6.55, -57, 0.2, 0.290, 4.069, 32828.4391, 2.36, 56, -0.3, 0.289, 3.472, 31713.8105, -1.35, 12, -0.1, 0.285, 5.407, -33.7814, 0.31, 4, 0, 0.283, 5.998, -16.9207, -3.71, -44, 0.2, 0.283, 2.772, 38785.8980, 0.23, 37, -0.2, 0.274, 5.343, 15613.7420, -2.54, -16, 0.1, 0.263, 3.997, 25823.9257, 0.22, 24, -0.1, 0.254, 0.600, 24638.3095, -1.61, 2, 0, 0.253, 1.344, 6447.1991, 0.29, 10, -0.1, 0.250, 0.887, 141.9754, -3.76, -44, 0.2, 0.247, 0.317, 5329.1570, -2.10, -19, 0.1, 0.245, 0.141, 36.0484, -3.71, -44, 0.2, 0.231, 2.287, 14357.1381, -2.49, -16, 0.1, 0.227, 5.158, 2.6298, 0, 0, 0, 0.219, 5.085, 47742.8914, 1.72, 63, -0.3, 0.211,
|
||||
2.145, 6638.7244, -2.18, -19, 0.1, 0.201, 4.415, 39623.7495, -4.13, -14, 0, 0.194, 2.091, 588.4927, 0, 0, 0, 0.193, 3.057, -15400.7789, -3.10, -50, 0, 0.186, 5.598, 16799.3582, -0.72, 6, 0, 0.185, 3.886, 1150.6770, 0, 0, 0, 0.183, 1.619, 7178.0144, 1.52, 25, 0, 0.181, 2.635, 8328.3391, 1.52, 25, 0, 0.181, 2.077, 8329.0437, 1.52, 25, 0, 0.179, 3.215, -9652.8694, -0.90, -18, 0, 0.176, 1.716, -8815.0180, -5.26, -69, 0, 0.175, 5.673, 550.7553, 0, 0, 0, 0.170, 2.060, 31295.0580, -5.6, -39, 0, 0.167, 1.239, 7211.7617, -0.7, 6, 0, 0.165, 4.499, 14967.4158, -0.7, 6, 0, 0.164, 3.595, 15540.4531, 0.9, 31, 0, 0.164, 4.237, 522.3694, 0, 0, 0, 0.163, 4.633, 15545.0555, -2.2, -19, 0, 0.161, 0.478, 6428.0209, -2.2, -19, 0, 0.158, 2.03, 13171.5218, -4.3, -38, 0, 0.157, 2.28, 7216.3641, -3.7, -44,
|
||||
0, 0.154, 5.65, 7935.6705, 1.5, 25, 0, 0.152, 0.46, 29828.9047, -1.3, 12, 0, 0.151, 1.19, -0.7113, 0, 0, 0, 0.150, 1.42, 23942.4334, -1.0, 9, 0, 0.144, 2.75, 7753.3529, 1.5, 25, 0, 0.137, 2.08, 7213.7105, -2.2, -19, 0, 0.137, 1.44, 7214.4152, -2.2, -19, 0, 0.136, 4.46, -1185.6162, -1.8, -22, 0, 0.136, 3.03, 8000.1048, -2.2, -19, 0, 0.134, 2.83, 14756.7124, -0.7, 6, 0, 0.131, 5.05, 6821.0419, -2.2, -19, 0, 0.128, 5.99, -17214.6971, -4.9, -72, 0, 0.127, 5.35, 8721.7124, 1.5, 25, 0, 0.126, 4.49, 46628.2629, -2.0, 19, 0, 0.125, 5.94, 7149.6285, 1.5, 25, 0, 0.124, 1.09, 49067.0695, 1.1, 55, 0, 0.121, 2.88, 15471.7666, 1.2, 28, 0, 0.111, 3.92, 41643.4571, 7.6, 125, -1, 0.110, 1.96, 8904.0299, 1.5, 25, 0, 0.106, 3.30, -18.0489, -2.2, -19, 0, 0.105, 2.30, -4.9310, 1.5, 25, 0, 0.104, 2.22,
|
||||
-6.5590, -1.9, -22, 0, 0.101, 1.44, 1884.9059, -0.1, 0, 0, 0.100, 5.92, 5471.1324, -5.9, -63, 0, 0.099, 1.12, 15149.7333, -0.7, 6, 0, 0.096, 4.73, 15508.9972, -0.4, 10, 0, 0.095, 5.18, 7230.9835, 1.5, 25, 0, 0.093, 3.37, 39900.5266, 3.9, 81, 0, 0.092, 2.01, 25057.0619, 2.7, 53, 0, 0.092, 1.21, -79.6298, 0, 0, 0, 0.092, 1.65, -26310.2523, -4.0, -68, 0, 0.091, 1.01, 42062.5561, -1.0, 23, 0, 0.090, 6.10, 29342.5781, -5.0, -32, 0, 0.090, 4.43, 15542.4020, -0.7, 6, 0, 0.090, 3.80, 15543.1066, -0.7, 6, 0, 0.089, 4.15, 6063.3859, -2.2, -19, 0, 0.086, 4.03, 52.9691, 0, 0, 0, 0.085, 0.49, 47952.4409, -2.6, 11, 0, 0.085, 1.60, 7632.8154, 2.1, 32, 0, 0.084, 0.22, 14392.0773, -0.7, 6, 0, 0.083, 6.22, 6028.4466, -4.0, -41, 0, 0.083, 0.63, -7909.9389, 2.8, 26, 0, 0.083, 5.20, -77.5523, 0, 0, 0,
|
||||
0.082, 2.74, 8786.1467, -2.2, -19, 0, 0.080, 2.43, 9166.5428, -2.8, -26, 0, 0.080, 3.70, -25405.1732, 4.1, 27, 0, 0.078, 5.68, 48857.5200, 5.4, 106, -1, 0.077, 1.85, 8315.5735, -2.2, -19, 0, 0.075, 5.46, -18191.1103, 1.9, 8, 0, 0.075, 1.41, -16238.6304, 1.3, 1, 0, 0.074, 5.06, 40110.0761, -0.4, 30, 0, 0.072, 2.10, 64.4343, -3.7, -44, 0, 0.071, 2.17, 37671.2695, -3.5, -6, 0, 0.069, 1.71, 16693.4313, -0.7, 6, 0, 0.069, 3.33, -26100.7028, -8.3, -119, 1, 0.068, 1.09, 8329.4028, 1.5, 25, 0, 0.068, 3.62, 8327.9801, 1.5, 25, 0, 0.068, 2.41, 16833.1509, -1.0, 3, 0, 0.067, 3.40, 24709.2971, -3.5, -20, 0, 0.067, 1.65, 8346.7156, -0.3, 3, 0, 0.066, 2.61, 22547.2677, 1.5, 39, 0, 0.066, 3.50, 15576.5113, -1.0, 3, 0, 0.065, 5.76, 33037.9886, -2.0, 5, 0, 0.065, 4.58, 8322.1325, -0.3, 3, 0,
|
||||
0.065, 6.20, 17913.9868, 3.0, 50, 0, 0.065, 1.50, 22685.8295, -1.0, 9, 0, 0.065, 2.37, 7180.3058, -1.9, -15, 0, 0.064, 1.06, 30943.5332, 2.4, 56, 0, 0.064, 1.89, 8288.8765, 1.5, 25, 0, 0.064, 4.70, 6.0335, 0.3, 4, 0, 0.063, 2.83, 8368.5063, 1.5, 25, 0, 0.063, 5.66, -2580.7819, 0.7, 7, 0, 0.062, 3.78, 7056.3285, -2.2, -19, 0, 0.061, 1.49, 8294.9100, 1.8, 29, 0, 0.061, 0.12, -10281.1714, -0.9, -18, 0, 0.061, 3.06, -8362.4729, -1.2, -21, 0, 0.061, 4.43, 8170.9571, 1.5, 25, 0, 0.059, 5.78, -13.1179, -3.7, -44, 0, 0.059, 5.97, 6625.5702, -2.2, -19, 0, 0.058, 5.01, -0.5080, -0.3, 0, 0, 0.058, 2.73, 7161.0938, -2.2, -19, 0, 0.057, 0.19, 7214.0629, -2.2, -19, 0, 0.057, 4.00, 22199.5029, -4.7, -35, 0, 0.057, 5.38, 8119.1420, 5.8, 76, 0, 0.056, 1.07, 7542.6495, 1.5, 25, 0, 0.056, 0.28,
|
||||
8486.4258, 1.5, 25, 0, 0.054, 4.19, 16655.0816, 4.6, 75, 0, 0.053, 0.72, 7267.0320, -2.2, -19, 0, 0.053, 3.12, 12.6192, 0.6, 7, 0, 0.052, 2.99, -32896.013, -1.8, -49, 0, 0.052, 3.46, 1097.708, 0, 0, 0, 0.051, 5.37, -6443.786, -1.6, -25, 0, 0.051, 1.35, 7789.401, -2.2, -19, 0, 0.051, 5.83, 40042.502, 0.2, 38, 0, 0.051, 3.63, 9114.733, 1.5, 25, 0, 0.050, 1.51, 8504.484, -2.5, -22, 0, 0.050, 5.23, 16659.684, 1.5, 25, 0, 0.050, 1.15, 7247.820, -2.5, -23, 0, 0.047, 0.25, -1290.421, 0.3, 0, 0, 0.047, 4.67, -32686.464, -6.1, -100, 0, 0.047, 3.49, 548.678, 0, 0, 0, 0.047, 2.37, 6663.308, -2.2, -19, 0, 0.046, 0.98, 1572.084, 0, 0, 0, 0.046, 2.04, 14954.262, -0.7, 6, 0, 0.046, 3.72, 6691.693, -2.2, -19, 0, 0.045, 6.19, -235.287, 0, 0, 0, 0.044, 2.96, 32967.001, -0.1, 27, 0, 0.044, 3.82,
|
||||
-1671.943, -5.6, -66, 0, 0.043, 5.82, 1179.063, 0, 0, 0, 0.043, 0.07, 34152.617, 1.7, 49, 0, 0.043, 3.71, 6514.773, -0.3, 0, 0, 0.043, 5.62, 15.732, -2.5, -23, 0, 0.043, 5.80, 8351.233, -2.2, -19, 0, 0.042, 0.27, 7740.199, 1.5, 25, 0, 0.042, 6.14, 15385.020, -0.7, 6, 0, 0.042, 6.13, 7285.051, -4.1, -41, 0, 0.041, 1.27, 32757.451, 4.2, 78, 0, 0.041, 4.46, 8275.722, 1.5, 25, 0, 0.040, 0.23, 8381.661, 1.5, 25, 0, 0.040, 5.87, -766.864, 2.5, 29, 0, 0.040, 1.66, 254.431, 0, 0, 0, 0.040, 0.40, 9027.981, -0.4, 0, 0, 0.040, 2.96, 7777.936, 1.5, 25, 0, 0.039, 4.67, 33943.068, 6.1, 100, 0, 0.039, 3.52, 8326.062, 1.5, 25, 0, 0.039, 3.75, 21013.887, -6.5, -57, 0, 0.039, 5.60, 606.978, 0, 0, 0, 0.039, 1.19, 8331.321, 1.5, 25, 0, 0.039, 2.84, 7211.433, -2.2, -19, 0, 0.038, 0.67, 7216.693, -2.2,
|
||||
-19, 0, 0.038, 6.22, 25161.867, 0.6, 28, 0, 0.038, 4.40, 7806.322, 1.5, 25, 0, 0.038, 4.16, 9179.168, -2.2, -19, 0, 0.037, 4.73, 14991.999, -0.7, 6, 0, 0.036, 0.35, 67.514, -0.6, -7, 0, 0.036, 3.70, 25266.611, -1.6, 0, 0, 0.036, 5.39, 16328.796, -0.7, 6, 0, 0.035, 1.44, 7174.248, -2.2, -19, 0, 0.035, 5.00, 15684.730, -4.4, -38, 0, 0.035, 0.39, -15.419, -2.2, -19, 0, 0.035, 6.07, 15020.385, -0.7, 6, 0, 0.034, 6.01, 7371.797, -2.2, -19, 0, 0.034, 0.96, -16623.626, -3.4, -54, 0, 0.033, 6.24, 9479.368, 1.5, 25, 0, 0.033, 3.21, 23661.896, 5.2, 82, 0, 0.033, 4.06, 8311.418, -2.2, -19, 0, 0.033, 2.40, 1965.105, 0, 0, 0, 0.033, 5.17, 15489.785, -0.7, 6, 0, 0.033, 5.03, 21986.540, 0.9, 31, 0, 0.033, 4.10, 16691.140, 2.7, 46, 0, 0.033, 5.13, 47114.589, 1.7, 63, 0, 0.033, 4.45, 8917.184,
|
||||
1.5, 25, 0, 0.033, 4.23, 2.078, 0, 0, 0, 0.032, 2.33, 75.251, 1.5, 25, 0, 0.032, 2.10, 7253.878, -2.2, -19, 0, 0.032, 3.11, -0.224, 1.5, 25, 0, 0.032, 4.43, 16640.462, -0.7, 6, 0, 0.032, 5.68, 8328.363, 0, 0, 0, 0.031, 5.32, 8329.020, 3.0, 50, 0, 0.031, 3.70, 16118.093, -0.7, 6, 0, 0.030, 3.67, 16721.817, -0.7, 6, 0, 0.030, 5.27, -1881.492, -1.2, -15, 0, 0.030, 5.72, 8157.839, -2.2, -19, 0, 0.029, 5.73, -18400.313, -6.7, -94, 0, 0.029, 2.76, 16.000, -2.2, -19, 0, 0.029, 1.75, 8879.447, 1.5, 25, 0, 0.029, 0.32, 8851.061, 1.5, 25, 0, 0.029, 0.90, 14704.903, 3.7, 57, 0, 0.028, 2.90, 15595.723, -0.7, 6, 0, 0.028, 5.88, 16864.631, 0.2, 24, 0, 0.028, 0.63, 16869.234, -2.8, -26, 0, 0.028, 4.04, -18609.863, -2.4, -43, 0, 0.027, 5.83, 6727.736, -5.9, -63, 0, 0.027, 6.12, 418.752, 4.3, 51,
|
||||
0, 0.027, 0.14, 41157.131, 3.9, 81, 0, 0.026, 3.80, 15.542, 0, 0, 0, 0.026, 1.68, 50181.698, 4.8, 99, -1, 0.026, 0.32, 315.469, 0, 0, 0, 0.025, 5.67, 19.188, 0.3, 0, 0, 0.025, 3.16, 62.133, -2.2, -19, 0, 0.025, 3.76, 15502.939, -0.7, 6, 0, 0.025, 4.53, 45999.961, -2.0, 19, 0, 0.024, 3.21, 837.851, -4.4, -51, 0, 0.024, 2.82, 38157.596, 0.3, 37, 0, 0.024, 5.21, 15540.124, -0.7, 6, 0, 0.024, 0.26, 14218.576, 0, 13, 0, 0.024, 3.01, 15545.384, -0.7, 6, 0, 0.024, 1.16, -17424.247, -0.6, -21, 0, 0.023, 2.34, -67.574, 0.6, 7, 0, 0.023, 2.44, 18.024, -1.9, -22, 0, 0.023, 3.70, 469.400, 0, 0, 0, 0.023, 0.72, 7136.511, -2.2, -19, 0, 0.023, 4.50, 15582.569, -0.7, 6, 0, 0.023, 2.80, -16586.395, -4.9, -72, 0, 0.023, 1.51, 80.182, 0, 0, 0, 0.023, 1.09, 5261.583, -1.5, -12, 0, 0.023, 0.56,
|
||||
54956.954, -0.5, 44, 0, 0.023, 4.01, 8550.860, -2.2, -19, 0, 0.023, 4.46, 38995.448, -4.1, -14, 0, 0.023, 3.82, 2358.126, 0, 0, 0, 0.022, 3.77, 32271.125, 0.5, 34, 0, 0.022, 0.82, 15935.775, -0.7, 6, 0, 0.022, 1.07, 24013.421, -2.9, -13, 0, 0.022, 0.40, 8940.078, -2.2, -19, 0, 0.022, 2.06, 15700.489, -0.7, 6, 0, 0.022, 4.27, 15124.002, -5.0, -45, 0, 0.021, 1.16, 56071.583, 3.2, 88, 0, 0.021, 5.58, 9572.189, -2.2, -19, 0, 0.020, 1.70, -17.273, -3.7, -44, 0, 0.020, 3.05, 214.617, 0, 0, 0, 0.020, 4.41, 8391.048, -2.2, -19, 0, 0.020, 5.95, 23869.145, 2.4, 56, 0, 0.020, 0.42, 40947.927, -4.7, -21, 0, 0.019, 1.39, 5818.897, 0.3, 10, 0, 0.019, 0.71, 23873.747, -0.7, 6, 0, 0.019, 2.81, 7291.615, -2.2, -19, 0, 0.019, 5.09, 8428.018, -2.2, -19, 0, 0.019, 4.14, 6518.187, -1.6, -12, 0, 0.019,
|
||||
3.85, 21.330, 0, 0, 0, 0.018, 0.66, 14445.046, -0.7, 6, 0, 0.018, 1.65, 0.966, -4.0, -48, 0, 0.018, 5.64, -17143.709, -6.8, -94, 0, 0.018, 6.01, 7736.432, -2.2, -19, 0, 0.018, 2.74, 31153.083, -1.9, 5, 0, 0.018, 4.58, 6116.355, -2.2, -19, 0, 0.018, 2.28, 46.401, 0.3, 0, 0, 0.018, 3.80, 10213.597, 1.4, 25, 0, 0.018, 2.84, 56281.132, -1.1, 36, 0, 0.018, 3.53, 8249.062, 1.5, 25, 0, 0.017, 4.43, 20871.911, -3, -13, 0, 0.017, 4.44, 627.596, 0, 0, 0, 0.017, 1.85, 628.308, 0, 0, 0, 0.017, 1.19, 8408.321, 2, 25, 0, 0.017, 1.95, 7214.056, -2, -19, 0, 0.017, 1.57, 7214.070, -2, -19, 0, 0.017, 1.65, 13870.811, -6, -60, 0, 0.017, 0.30, 22.542, -4, -44, 0, 0.017, 2.62, -119.445, 0, 0, 0, 0.016, 4.87, 5747.909, 2, 32, 0, 0.016, 4.45, 14339.108, -1, 6, 0, 0.016, 1.83, 41366.680, 0, 30, 0, 0.016,
|
||||
4.53, 16309.618, -3, -23, 0, 0.016, 2.54, 15542.754, -1, 6, 0, 0.016, 6.05, 1203.646, 0, 0, 0, 0.015, 5.2, 2751.147, 0, 0, 0, 0.015, 1.8, -10699.924, -5, -69, 0, 0.015, 0.4, 22824.391, -3, -20, 0, 0.015, 2.1, 30666.756, -6, -39, 0, 0.015, 2.1, 6010.417, -2, -19, 0, 0.015, 0.7, -23729.470, -5, -75, 0, 0.015, 1.4, 14363.691, -1, 6, 0, 0.015, 5.8, 16900.689, -2, 0, 0, 0.015, 5.2, 23800.458, 3, 53, 0, 0.015, 5.3, 6035.000, -2, -19, 0, 0.015, 1.2, 8251.139, 2, 25, 0, 0.015, 3.6, -8.860, 0, 0, 0, 0.015, 0.8, 882.739, 0, 0, 0, 0.015, 3.0, 1021.329, 0, 0, 0, 0.015, 0.6, 23296.107, 1, 31, 0, 0.014, 5.4, 7227.181, 2, 25, 0, 0.014, 0.1, 7213.352, -2, -19, 0, 0.014, 4.0, 15506.706, 3, 50, 0, 0.014, 3.4, 7214.774, -2, -19, 0, 0.014, 4.6, 6665.385, -2, -19, 0, 0.014, 0.1, -8.636, -2, -22, 0,
|
||||
0.014, 3.1, 15465.202, -1, 6, 0, 0.014, 4.9, 508.863, 0, 0, 0, 0.014, 3.5, 8406.244, 2, 25, 0, 0.014, 1.3, 13313.497, -8, -82, 0, 0.014, 2.8, 49276.619, -3, 0, 0, 0.014, 0.1, 30528.194, -3, -10, 0, 0.013, 1.7, 25128.050, 1, 31, 0, 0.013, 2.9, 14128.405, -1, 6, 0, 0.013, 3.4, 57395.761, 3, 80, 0, 0.013, 2.7, 13029.546, -1, 6, 0, 0.013, 3.9, 7802.556, -2, -19, 0, 0.013, 1.6, 8258.802, -2, -19, 0, 0.013, 2.2, 8417.709, -2, -19, 0, 0.013, 0.7, 9965.210, -2, -19, 0, 0.013, 3.4, 50391.247, 0, 48, 0, 0.013, 3.0, 7134.433, -2, -19, 0, 0.013, 2.9, 30599.182, -5, -31, 0, 0.013, 3.6, -9723.857, 1, 0, 0, 0.013, 4.8, 7607.084, -2, -19, 0, 0.012, 0.8, 23837.689, 1, 35, 0, 0.012, 3.6, 4.409, -4, -44, 0, 0.012, 5.0, 16657.031, 3, 50, 0, 0.012, 4.4, 16657.735, 3, 50, 0, 0.012, 1.1, 15578.803, -4,
|
||||
-38, 0, 0.012, 6.0, -11.490, 0, 0, 0, 0.012, 1.9, 8164.398, 0, 0, 0, 0.012, 2.4, 31852.372, -4, -17, 0, 0.012, 2.4, 6607.085, -2, -19, 0, 0.012, 4.2, 8359.870, 0, 0, 0, 0.012, 0.5, 5799.713, -2, -19, 0, 0.012, 2.7, 7220.622, 0, 0, 0, 0.012, 4.3, -139.720, 0, 0, 0, 0.012, 2.3, 13728.836, -2, -16, 0, 0.011, 3.6, 14912.146, 1, 31, 0, 0.011, 4.7, 14916.748, -2, -19, 0),
|
||||
(1.67680, 4.66926, 628.301955, -0.0266, 0.1, -0.005, 0.51642, 3.3721, 6585.760910, -2.158, -18.9, 0.09, 0.41383, 5.7277, 14914.452335, -0.635, 6.2, -0.04, 0.37115, 3.9695, 7700.389469, 1.550, 25.0, -0.12, 0.27560, 0.7416, 8956.993380, 1.496, 25.1, -0.13, 0.24599, 4.2253, -2.301200, 1.523, 25.1, -0.12, 0.07118, 0.1443, 7842.36482, -2.211, -19, 0.08, 0.06128, 2.4998, 16171.05625, -0.688, 6, 0, 0.04516, 0.443, 8399.67910, -0.36, 3, 0, 0.04048, 5.771, 14286.15038, -0.61, 6, 0, 0.03747, 4.626, 1256.60391, -0.05, 0, 0, 0.03707, 3.415, 5957.45895, -2.13, -19, 0.1, 0.03649, 1.800, 23243.14376, 0.89, 31, -0.2, 0.02438, 0.042, 16029.08089, 3.07, 50, -0.2, 0.02165, 1.017, -1742.93051, -3.68, -44, 0.2, 0.01923, 3.097, 17285.68480, 3.02, 50, -0.3, 0.01692, 1.280, 0.3286, 1.52, 25, -0.1,
|
||||
0.01361, 0.298, 8326.3902, 3.05, 50, -0.2, 0.01293, 4.013, 7072.0875, 1.58, 25, -0.1, 0.01276, 4.413, 8330.9926, 0, 0, 0, 0.01270, 0.101, 8470.6668, -2.24, -19, 0.1, 0.01097, 1.203, 22128.5152, -2.82, -13, 0, 0.01088, 2.545, 15542.7543, -0.66, 6, 0, 0.00835, 0.190, 7214.0629, -2.18, -19, 0.1, 0.00734, 4.855, 24499.7477, 0.83, 31, -0.2, 0.00686, 5.130, 13799.8238, -4.34, -38, 0.2, 0.00631, 0.930, -486.3266, -3.73, -44, 0, 0.00585, 0.699, 9585.2953, 1.5, 25, 0, 0.00566, 4.073, 8328.3391, 1.5, 25, 0, 0.00566, 0.638, 8329.0437, 1.5, 25, 0, 0.00539, 2.472, -1952.4800, 0.6, 7, 0, 0.00509, 2.88, -0.7113, 0, 0, 0, 0.00469, 3.56, 30457.2066, -1.3, 12, 0, 0.00387, 0.78, -0.3523, 0, 0, 0, 0.00378, 1.84, 22614.8418, 0.9, 31, 0, 0.00362, 5.53, -695.8761, 0.6, 7, 0, 0.00317, 2.80, 16728.3705,
|
||||
1.2, 28, 0, 0.00303, 6.07, 157.7344, 0, 0, 0, 0.00300, 2.53, 33.7570, -0.3, -4, 0, 0.00295, 4.16, 31571.8352, 2.4, 56, 0, 0.00289, 5.98, 7211.7617, -0.7, 6, 0, 0.00285, 2.06, 15540.4531, 0.9, 31, 0, 0.00283, 2.65, 2.6298, 0, 0, 0, 0.00282, 6.17, 15545.0555, -2.2, -19, 0, 0.00278, 1.23, -39.8149, 0, 0, 0, 0.00272, 3.82, 7216.3641, -3.7, -44, 0, 0.00270, 4.37, 70.9877, -1.9, -22, 0, 0.00256, 5.81, 13657.8484, -0.6, 6, 0, 0.00244, 5.64, -0.2237, 1.5, 25, 0, 0.00240, 2.96, 8311.7707, -2.2, -19, 0, 0.00239, 0.87, -33.7814, 0.3, 4, 0, 0.00216, 2.31, 15.9995, -2.2, -19, 0, 0.00186, 3.46, 5329.1570, -2.1, -19, 0, 0.00169, 2.40, 24357.772, 4.6, 75, 0, 0.00161, 5.80, 8329.403, 1.5, 25, 0, 0.00161, 5.20, 8327.980, 1.5, 25, 0, 0.00160, 4.26, 23385.119, -2.9, -13, 0, 0.00156, 1.26, 550.755, 0,
|
||||
0, 0, 0.00155, 1.25, 21500.213, -2.8, -13, 0, 0.00152, 0.60, -16.921, -3.7, -44, 0, 0.00150, 2.71, -79.630, 0, 0, 0, 0.00150, 5.29, 15.542, 0, 0, 0, 0.00148, 1.06, -2371.232, -3.7, -44, 0, 0.00141, 0.77, 8328.691, 1.5, 25, 0, 0.00141, 3.67, 7143.075, -0.3, 0, 0, 0.00138, 5.45, 25614.376, 4.5, 75, 0, 0.00129, 4.90, 23871.446, 0.9, 31, 0, 0.00126, 4.03, 141.975, -3.8, -44, 0, 0.00124, 6.01, 522.369, 0, 0, 0, 0.00120, 4.94, -10071.622, -5.2, -69, 0, 0.00118, 5.07, -15.419, -2.2, -19, 0, 0.00107, 3.49, 23452.693, -3.4, -20, 0, 0.00104, 4.78, 17495.234, -1.3, 0, 0, 0.00103, 1.44, -18.049, -2.2, -19, 0, 0.00102, 5.63, 15542.402, -0.7, 6, 0, 0.00102, 2.59, 15543.107, -0.7, 6, 0, 0.00100, 4.11, -6.559, -1.9, -22, 0, 0.00097, 0.08, 15400.779, 3.1, 50, 0, 0.00096, 5.84, 31781.385, -1.9, 5,
|
||||
0, 0.00094, 1.08, 8328.363, 0, 0, 0, 0.00094, 2.46, 16799.358, -0.7, 6, 0, 0.00094, 1.69, 6376.211, 2.2, 32, 0, 0.00093, 3.64, 8329.020, 3.0, 50, 0, 0.00093, 2.65, 16655.082, 4.6, 75, 0, 0.00090, 1.90, 15056.428, -4.4, -38, 0, 0.00089, 1.59, 52.969, 0, 0, 0, 0.00088, 2.02, -8257.704, -3.4, -47, 0, 0.00088, 3.02, 7213.711, -2.2, -19, 0, 0.00087, 0.50, 7214.415, -2.2, -19, 0, 0.00087, 0.49, 16659.684, 1.5, 25, 0, 0.00082, 5.64, -4.931, 1.5, 25, 0, 0.00079, 5.17, 13171.522, -4.3, -38, 0, 0.00076, 3.60, 29828.905, -1.3, 12, 0, 0.00076, 4.08, 24567.322, 0.3, 24, 0, 0.00076, 4.58, 1884.906, -0.1, 0, 0, 0.00073, 0.33, 31713.811, -1.4, 12, 0, 0.00073, 0.93, 32828.439, 2.4, 56, 0, 0.00071, 5.91, 38785.898, 0.2, 37, 0, 0.00069, 2.20, 15613.742, -2.5, -16, 0, 0.00066, 3.87, 15.732, -2.5,
|
||||
-23, 0, 0.00066, 0.86, 25823.926, 0.2, 24, 0, 0.00065, 2.52, 8170.957, 1.5, 25, 0, 0.00063, 0.18, 8322.132, -0.3, 0, 0, 0.00060, 5.84, 8326.062, 1.5, 25, 0, 0.00060, 5.15, 8331.321, 1.5, 25, 0, 0.00060, 2.18, 8486.426, 1.5, 25, 0, 0.00058, 2.30, -1.731, -4, -44, 0, 0.00058, 5.43, 14357.138, -2, -16, 0, 0.00057, 3.09, 8294.910, 2, 29, 0, 0.00057, 4.67, -8362.473, -1, -21, 0, 0.00056, 4.15, 16833.151, -1, 0, 0, 0.00054, 1.93, 7056.329, -2, -19, 0, 0.00054, 5.27, 8315.574, -2, -19, 0, 0.00052, 5.6, 8311.418, -2, -19, 0, 0.00052, 2.7, -77.552, 0, 0, 0, 0.00051, 4.3, 7230.984, 2, 25, 0, 0.00050, 0.4, -0.508, 0, 0, 0, 0.00049, 5.4, 7211.433, -2, -19, 0, 0.00049, 4.4, 7216.693, -2, -19, 0, 0.00049, 4.3, 16864.631, 0, 24, 0, 0.00049, 2.2, 16869.234, -3, -26, 0, 0.00047, 6.1, 627.596, 0,
|
||||
0, 0, 0.00047, 5.0, 12.619, 1, 7, 0, 0.00045, 4.9, -8815.018, -5, -69, 0, 0.00044, 1.6, 62.133, -2, -19, 0, 0.00042, 2.9, -13.118, -4, -44, 0, 0.00042, 4.1, -119.445, 0, 0, 0, 0.00041, 4.3, 22756.817, -3, -13, 0, 0.00041, 3.6, 8288.877, 2, 25, 0, 0.00040, 0.5, 6663.308, -2, -19, 0, 0.00040, 1.1, 8368.506, 2, 25, 0, 0.00039, 4.1, 6443.786, 2, 25, 0, 0.00039, 3.1, 16657.383, 3, 50, 0, 0.00038, 0.1, 16657.031, 3, 50, 0, 0.00038, 3.0, 16657.735, 3, 50, 0, 0.00038, 4.6, 23942.433, -1, 9, 0, 0.00037, 4.3, 15385.020, -1, 6, 0, 0.00037, 5.0, 548.678, 0, 0, 0, 0.00036, 1.8, 7213.352, -2, -19, 0, 0.00036, 1.7, 7214.774, -2, -19, 0, 0.00035, 1.1, 7777.936, 2, 25, 0, 0.00035, 1.6, -8.860, 0, 0, 0, 0.00035, 4.4, 23869.145, 2, 56, 0, 0.00035, 2.0, 6691.693, -2, -19, 0, 0.00034, 1.3, -1185.616,
|
||||
-2, -22, 0, 0.00034, 2.2, 23873.747, -1, 6, 0, 0.00033, 2.0, -235.287, 0, 0, 0, 0.00033, 3.1, 17913.987, 3, 50, 0, 0.00033, 1.0, 8351.233, -2, -19, 0),
|
||||
(0.004870, 4.6693, 628.30196, -0.027, 0, -0.01, 0.002280, 2.6746, -2.30120, 1.523, 25, -0.12, 0.001500, 3.372, 6585.76091, -2.16, -19, 0.1, 0.001200, 5.728, 14914.45233, -0.64, 6, 0, 0.001080, 3.969, 7700.38947, 1.55, 25, -0.1, 0.000800, 0.742, 8956.99338, 1.50, 25, -0.1, 0.000254, 6.002, 0.3286, 1.52, 25, -0.1, 0.000210, 0.144, 7842.3648, -2.21, -19, 0, 0.000180, 2.500, 16171.0562, -0.7, 6, 0, 0.000130, 0.44, 8399.6791, -0.4, 3, 0, 0.000126, 5.03, 8326.3902, 3.0, 50, 0, 0.000120, 5.77, 14286.1504, -0.6, 6, 0, 0.000118, 5.96, 8330.9926, 0, 0, 0, 0.000110, 1.80, 23243.1438, 0.9, 31, 0, 0.000110, 3.42, 5957.4590, -2.1, -19, 0, 0.000110, 4.63, 1256.6039, -0.1, 0, 0, 0.000099, 4.70, -0.7113, 0, 0, 0, 0.000070, 0.04, 16029.0809, 3.1, 50, 0, 0.000070, 5.14, 8328.3391, 1.5, 25, 0,
|
||||
0.000070, 5.85, 8329.0437, 1.5, 25, 0, 0.000060, 1.02, -1742.9305, -3.7, -44, 0, 0.000060, 3.10, 17285.6848, 3.0, 50, 0, 0.000054, 5.69, -0.352, 0, 0, 0, 0.000043, 0.52, 15.542, 0, 0, 0, 0.000041, 2.03, 2.630, 0, 0, 0, 0.000040, 0.10, 8470.667, -2.2, -19, 0, 0.000040, 4.01, 7072.088, 1.6, 25, 0, 0.000036, 2.93, -8.860, -0.3, 0, 0, 0.000030, 1.20, 22128.515, -2.8, -13, 0, 0.000030, 2.54, 15542.754, -0.7, 6, 0, 0.000027, 4.43, 7211.762, -0.7, 6, 0, 0.000026, 0.51, 15540.453, 0.9, 31, 0, 0.000026, 1.44, 15545.055, -2.2, -19, 0, 0.000025, 5.37, 7216.364, -3.7, -44, 0),
|
||||
(0.00001200, 1.041, -2.3012, 1.52, 25, -0.1, 0.00000170, 0.31, -0.711, 0, 0, 0)
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def __decode(s):
|
||||
o = "0000000000"
|
||||
o2 = o + o
|
||||
s = s.replace("J", "00")
|
||||
s = s.replace("I", "000")
|
||||
s = s.replace("H", "0000")
|
||||
s = s.replace("G", "00000")
|
||||
s = s.replace("t", "02")
|
||||
s = s.replace("s", "002")
|
||||
s = s.replace("r", "0002")
|
||||
s = s.replace("q", "00002")
|
||||
s = s.replace("p", "000002")
|
||||
s = s.replace("o", "0000002")
|
||||
s = s.replace("n", "00000002")
|
||||
s = s.replace("m", "000000002")
|
||||
s = s.replace("l", "0000000002")
|
||||
s = s.replace("k", "01")
|
||||
s = s.replace("j", "0101")
|
||||
s = s.replace("i", "001")
|
||||
s = s.replace("h", "001001")
|
||||
s = s.replace("g", "0001")
|
||||
s = s.replace("f", "00001")
|
||||
s = s.replace("e", "000001")
|
||||
s = s.replace("d", "0000001")
|
||||
s = s.replace("c", "00000001")
|
||||
s = s.replace("b", "000000001")
|
||||
s = s.replace("a", "0000000001")
|
||||
s = s.replace("A", o2 + o2 + o2)
|
||||
s = s.replace("B", o2 + o2 + o)
|
||||
s = s.replace("C", o2 + o2)
|
||||
s = s.replace("D", o2 + o)
|
||||
s = s.replace("E", o2)
|
||||
s = s.replace("F", o)
|
||||
return s
|
||||
|
||||
__QI_KB = (
|
||||
1640650.479938, 15.21842500, # -221-11-09 h=0.01709 古历·秦汉
|
||||
1642476.703182, 15.21874996, # -216-11-09 h=0.01557 古历·秦汉
|
||||
1683430.515601, 15.218750011, # -104-12-25 h=0.01560 汉书·律历志(太初历)平气平朔 回归年=365.25000
|
||||
1752157.640664, 15.218749978, # 85-02-23 h=0.01559 后汉书·律历志(四分历) 回归年=365.25000
|
||||
1807675.003759, 15.218620279, # 237-02-22 h=0.00010 晋书·律历志(景初历) 回归年=365.24689
|
||||
1883627.765182, 15.218612292, # 445-02-03 h=0.00026 宋书·律历志(何承天元嘉历) 回归年=365.24670
|
||||
1907369.128100, 15.218449176, # 510-02-03 h=0.00027 宋书·律历志(祖冲之大明历) 回归年=365.24278
|
||||
1936603.140413, 15.218425000, # 590-02-17 h=0.00149 随书·律历志(开皇历) 回归年=365.24220
|
||||
1939145.524180, 15.218466998, # 597-02-03 h=0.00121 随书·律历志(大业历) 回归年=365.24321
|
||||
1947180.798300, 15.218524844, # 619-02-03 h=0.00052 新唐书·历志(戊寅元历)平气定朔 回归年=365.24460
|
||||
1964362.041824, 15.218533526, # 666-02-17 h=0.00059 新唐书·历志(麟德历) 回归年=365.24480
|
||||
1987372.340971, 15.218513908, # 729-02-16 h=0.00096 新唐书·历志(大衍历,至德历) 回归年=365.24433
|
||||
1999653.819126, 15.218530782, # 762-10-03 h=0.00093 新唐书·历志(五纪历) 回归年=365.24474
|
||||
2007445.469786, 15.218535181, # 784-02-01 h=0.00059 新唐书·历志(正元历,观象历) 回归年=365.24484
|
||||
2021324.917146, 15.218526248, # 822-02-01 h=0.00022 新唐书·历志(宣明历) 回归年=365.24463
|
||||
2047257.232342, 15.218519654, # 893-01-31 h=0.00015 新唐书·历志(崇玄历) 回归年=365.24447
|
||||
2070282.898213, 15.218425000, # 956-02-16 h=0.00149 旧五代·历志(钦天历) 回归年=365.24220
|
||||
2073204.872850, 15.218515221, # 964-02-16 h=0.00166 宋史·律历志(应天历) 回归年=365.24437
|
||||
2080144.500926, 15.218530782, # 983-02-16 h=0.00093 宋史·律历志(乾元历) 回归年=365.24474
|
||||
2086703.688963, 15.218523776, # 1001-01-31 h=0.00067 宋史·律历志(仪天历,崇天历) 回归年=365.24457
|
||||
2110033.182763, 15.218425000, # 1064-12-15 h=0.00669 宋史·律历志(明天历) 回归年=365.24220
|
||||
2111190.300888, 15.218425000, # 1068-02-15 h=0.00149 宋史·律历志(崇天历) 回归年=365.24220
|
||||
2113731.271005, 15.218515671, # 1075-01-30 h=0.00038 李锐补修(奉元历) 回归年=365.24438
|
||||
2120670.840263, 15.218425000, # 1094-01-30 h=0.00149 宋史·律历志 回归年=365.24220
|
||||
2123973.309063, 15.218425000, # 1103-02-14 h=0.00669 李锐补修(占天历) 回归年=365.24220
|
||||
2125068.997336, 15.218477932, # 1106-02-14 h=0.00056 宋史·律历志(纪元历) 回归年=365.24347
|
||||
2136026.312633, 15.218472436, # 1136-02-14 h=0.00088 宋史·律历志(统元历,乾道历,淳熙历) 回归年=365.24334
|
||||
2156099.495538, 15.218425000, # 1191-01-29 h=0.00149 宋史·律历志(会元历) 回归年=365.24220
|
||||
2159021.324663, 15.218425000, # 1199-01-29 h=0.00149 宋史·律历志(统天历) 回归年=365.24220
|
||||
2162308.575254, 15.218461742, # 1208-01-30 h=0.00146 宋史·律历志(开禧历) 回归年=365.24308
|
||||
2178485.706538, 15.218425000, # 1252-05-15 h=0.04606 淳祐历 回归年=365.24220
|
||||
2178759.662849, 15.218445786, # 1253-02-13 h=0.00231 会天历 回归年=365.24270
|
||||
2185334.020800, 15.218425000, # 1271-02-13 h=0.00520 宋史·律历志(成天历) 回归年=365.24220
|
||||
2187525.481425, 15.218425000, # 1277-02-12 h=0.00520 本天历 回归年=365.24220
|
||||
2188621.191481, 15.218437494, # 1280-02-13 h=0.00015 元史·历志(郭守敬授时历) 回归年=365.24250
|
||||
2322147.76 # 1645-09-21
|
||||
)
|
||||
# 1645-09-23开始7567个节气修正表
|
||||
__QB = ""
|
||||
__SHUO_KB = (1457698.231017, 29.53067166, 1546082.512234, 29.53085106, 1640640.735300, 29.53060000, 1642472.151543, 29.53085439, 1683430.509300, 29.53086148, 1752148.041079, 29.53085097, 1807665.420323, 29.53059851, 1883618.114100, 29.53060000, 1907360.704700, 29.53060000, 1936596.224900, 29.53060000, 1939135.675300, 29.53060000, 1947168.00)
|
||||
# 619-01-21开始16598个朔日修正表 d0=1947168
|
||||
__SB = ""
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def nutationLon2(t):
|
||||
t2 = t * t
|
||||
dl = 0
|
||||
for i in range(0, len(ShouXingUtil.__NUT_B), 5):
|
||||
if i == 0:
|
||||
a = -1.742 * t
|
||||
else:
|
||||
a = 0
|
||||
dl += (ShouXingUtil.__NUT_B[i + 3] + a) * sin(ShouXingUtil.__NUT_B[i] + ShouXingUtil.__NUT_B[i + 1] * t + ShouXingUtil.__NUT_B[i + 2] * t2)
|
||||
return dl / 100 / ShouXingUtil.SECOND_PER_RAD
|
||||
|
||||
@staticmethod
|
||||
def eLon(t, n):
|
||||
t /= 10
|
||||
v = 0
|
||||
tn = 1
|
||||
pn = 1
|
||||
m0 = ShouXingUtil.__XL0[pn + 1] - ShouXingUtil.__XL0[pn]
|
||||
for i in range(0, 6):
|
||||
n1 = int(ShouXingUtil.__XL0[pn + i])
|
||||
n2 = int(ShouXingUtil.__XL0[pn + 1 + i])
|
||||
n0 = n2 - n1
|
||||
if n0 == 0:
|
||||
continue
|
||||
if n < 0:
|
||||
m = n2
|
||||
else:
|
||||
m = int(3 * n * n0 / m0 + 0.5) + n1
|
||||
if i != 0:
|
||||
m += 3
|
||||
if m > n2:
|
||||
m = n2
|
||||
c = 0
|
||||
for j in range(n1, m, 3):
|
||||
c += ShouXingUtil.__XL0[j] * cos(ShouXingUtil.__XL0[j + 1] + t * ShouXingUtil.__XL0[j + 2])
|
||||
v += c * tn
|
||||
tn *= t
|
||||
v /= ShouXingUtil.__XL0[0]
|
||||
t2 = t * t
|
||||
t3 = t2 * t
|
||||
v += (-0.0728 - 2.7702 * t - 1.1019 * t2 - 0.0996 * t3) / ShouXingUtil.SECOND_PER_RAD
|
||||
return v
|
||||
|
||||
@staticmethod
|
||||
def mLon(t, n):
|
||||
ob = ShouXingUtil.__XL1
|
||||
obl = len(ob[0])
|
||||
tn = 1
|
||||
v = 0
|
||||
t2 = t * t
|
||||
t3 = t2 * t
|
||||
t4 = t3 * t
|
||||
t5 = t4 * t
|
||||
tx = t - 10
|
||||
v += (3.81034409 + 8399.684730072 * t - 3.319e-05 * t2 + 3.11e-08 * t3 - 2.033e-10 * t4) * ShouXingUtil.SECOND_PER_RAD
|
||||
v += 5028.792262 * t + 1.1124406 * t2 + 0.00007699 * t3 - 0.000023479 * t4 - 0.0000000178 * t5
|
||||
if tx > 0:
|
||||
v += -0.866 + 1.43 * tx + 0.054 * tx * tx
|
||||
t2 /= 1e4
|
||||
t3 /= 1e8
|
||||
t4 /= 1e8
|
||||
|
||||
n *= 6
|
||||
if n < 0:
|
||||
n = obl
|
||||
for i in range(len(ob)):
|
||||
f = ob[i]
|
||||
size = len(f)
|
||||
m = int(n * size / obl + 0.5)
|
||||
if i > 0:
|
||||
m += 6
|
||||
if m >= size:
|
||||
m = size
|
||||
c = 0
|
||||
for j in range(0, m, 6):
|
||||
c += f[j] * cos(f[j + 1] + t * f[j + 2] + t2 * f[j + 3] + t3 * f[j + 4] + t4 * f[j + 5])
|
||||
v += c * tn
|
||||
tn *= t
|
||||
v /= ShouXingUtil.SECOND_PER_RAD
|
||||
return v
|
||||
|
||||
@staticmethod
|
||||
def gxcSunLon(t):
|
||||
v = -0.043126 + 628.301955 * t - 0.000002732 * t * t
|
||||
e = 0.016708634 - 0.000042037 * t - 0.0000001267 * t * t
|
||||
return -20.49552 * (1 + e * cos(v)) / ShouXingUtil.SECOND_PER_RAD
|
||||
|
||||
@staticmethod
|
||||
def ev(t):
|
||||
f = 628.307585 * t
|
||||
return 628.332 + 21 * sin(1.527 + f) + 0.44 * sin(1.48 + f * 2) + 0.129 * sin(5.82 + f) * t + 0.00055 * sin(4.21 + f) * t * t
|
||||
|
||||
@staticmethod
|
||||
def mv(t):
|
||||
v = 8399.71 - 914 * sin(0.7848 + 8328.691425 * t + 0.0001523 * t * t)
|
||||
v -= 179 * sin(2.543 + 15542.7543 * t) + 160 * sin(0.1874 + 7214.0629 * t) + 62 * sin(3.14 + 16657.3828 * t) + 34 * sin(4.827 + 16866.9323 * t) + 22 * sin(4.9 + 23871.4457 * t) + 12 * sin(2.59 + 14914.4523 * t) + 7 * sin(0.23 + 6585.7609 * t) + 5 * sin(0.9 + 25195.624 * t) + 5 * sin(2.32 - 7700.3895 * t) + 5 * sin(3.88 + 8956.9934 * t) + 5 * sin(0.49 + 7771.3771 * t)
|
||||
return v
|
||||
|
||||
@staticmethod
|
||||
def saLon(t, n):
|
||||
return ShouXingUtil.eLon(t, n) + ShouXingUtil.nutationLon2(t) + ShouXingUtil.gxcSunLon(t) + ShouXingUtil.PI
|
||||
|
||||
@staticmethod
|
||||
def dtExt(y, jsd):
|
||||
dy = (y - 1820) * 1.0 / 100
|
||||
return - 20 + jsd * dy * dy
|
||||
|
||||
@staticmethod
|
||||
def dtCalc(y):
|
||||
size = len(ShouXingUtil.__DT_AT)
|
||||
y0 = ShouXingUtil.__DT_AT[size - 2]
|
||||
t0 = ShouXingUtil.__DT_AT[size - 1]
|
||||
if y >= y0:
|
||||
jsd = 31
|
||||
if y > y0 + 100:
|
||||
return ShouXingUtil.dtExt(y, jsd)
|
||||
v = ShouXingUtil.dtExt(y, jsd)
|
||||
dv = ShouXingUtil.dtExt(y0, jsd) - t0
|
||||
return v - dv * (y0 + 100 - y) / 100
|
||||
i = 0
|
||||
for i in range(0, size, 5):
|
||||
if y < ShouXingUtil.__DT_AT[i + 5]:
|
||||
break
|
||||
t1 = (y - ShouXingUtil.__DT_AT[i]) / (ShouXingUtil.__DT_AT[i + 5] - ShouXingUtil.__DT_AT[i]) * 10
|
||||
t2 = t1 * t1
|
||||
t3 = t2 * t1
|
||||
return ShouXingUtil.__DT_AT[i + 1] + ShouXingUtil.__DT_AT[i + 2] * t1 + ShouXingUtil.__DT_AT[i + 3] * t2 + ShouXingUtil.__DT_AT[i + 4] * t3
|
||||
|
||||
@staticmethod
|
||||
def dtT(t):
|
||||
return ShouXingUtil.dtCalc(t / 365.2425 + 2000) / ShouXingUtil.SECOND_PER_DAY
|
||||
|
||||
@staticmethod
|
||||
def saLonT(w):
|
||||
v = 628.3319653318
|
||||
t = (w - 1.75347 - ShouXingUtil.PI) / v
|
||||
v = ShouXingUtil.ev(t)
|
||||
t += (w - ShouXingUtil.saLon(t, 10)) / v
|
||||
v = ShouXingUtil.ev(t)
|
||||
t += (w - ShouXingUtil.saLon(t, -1)) / v
|
||||
return t
|
||||
|
||||
@staticmethod
|
||||
def msaLon(t, mn, sn):
|
||||
return ShouXingUtil.mLon(t, mn) + (-3.4E-6) - (ShouXingUtil.eLon(t, sn) + ShouXingUtil.gxcSunLon(t) + ShouXingUtil.PI)
|
||||
|
||||
@staticmethod
|
||||
def msaLonT(w):
|
||||
v = 7771.37714500204
|
||||
t = (w + 1.08472) / v
|
||||
t += (w - ShouXingUtil.msaLon(t, 3, 3)) / v
|
||||
v = ShouXingUtil.mv(t) - ShouXingUtil.ev(t)
|
||||
t += (w - ShouXingUtil.msaLon(t, 20, 10)) / v
|
||||
t += (w - ShouXingUtil.msaLon(t, -1, 60)) / v
|
||||
return t
|
||||
|
||||
@staticmethod
|
||||
def saLonT2(w):
|
||||
v = 628.3319653318
|
||||
t = (w - 1.75347 - ShouXingUtil.PI) / v
|
||||
t -= (0.000005297 * t * t + 0.0334166 * cos(4.669257 + 628.307585 * t) + 0.0002061 * cos(2.67823 + 628.307585 * t) * t) / v
|
||||
t += (w - ShouXingUtil.eLon(t, 8) - ShouXingUtil.PI + (20.5 + 17.2 * sin(2.1824 - 33.75705 * t)) / ShouXingUtil.SECOND_PER_RAD) / v
|
||||
return t
|
||||
|
||||
@staticmethod
|
||||
def msaLonT2(w):
|
||||
v = 7771.37714500204
|
||||
t = (w + 1.08472) / v
|
||||
t2 = t * t
|
||||
t -= (-0.00003309 * t2 + 0.10976 * cos(0.784758 + 8328.6914246 * t + 0.000152292 * t2) + 0.02224 * cos(0.18740 + 7214.0628654 * t - 0.00021848 * t2) - 0.03342 * cos(4.669257 + 628.307585 * t)) / v
|
||||
t2 = t * t
|
||||
n = ShouXingUtil.mLon(t, 20) - (4.8950632 + 628.3319653318 * t + 0.000005297 * t2 + 0.0334166 * cos(4.669257 + 628.307585 * t) + 0.0002061 * cos(2.67823 + 628.307585 * t) * t + 0.000349 * cos(4.6261 + 1256.61517 * t) - 20.5 / ShouXingUtil.SECOND_PER_RAD)
|
||||
v = 7771.38 - 914 * sin(0.7848 + 8328.691425 * t + 0.0001523 * t2) - 179 * sin(2.543 + 15542.7543 * t) - 160 * sin(0.1874 + 7214.0629 * t)
|
||||
t += (w - n) / v
|
||||
return t
|
||||
|
||||
@staticmethod
|
||||
def qiHigh(w):
|
||||
t = ShouXingUtil.saLonT2(w) * 36525
|
||||
t = t - ShouXingUtil.dtT(t) + ShouXingUtil.ONE_THIRD
|
||||
v = ((t + 0.5) % 1) * ShouXingUtil.SECOND_PER_DAY
|
||||
if v < 1200 or v > ShouXingUtil.SECOND_PER_DAY - 1200:
|
||||
t = ShouXingUtil.saLonT(w) * 36525 - ShouXingUtil.dtT(t) + ShouXingUtil.ONE_THIRD
|
||||
return t
|
||||
|
||||
@staticmethod
|
||||
def qiLow(w):
|
||||
v = 628.3319653318
|
||||
t = (w - 4.895062166) / v
|
||||
t -= (53 * t * t + 334116 * cos(4.67 + 628.307585 * t) + 2061 * cos(2.678 + 628.3076 * t) * t) / v / 10000000
|
||||
n = 48950621.66 + 6283319653.318 * t + 53 * t * t + 334166 * cos(4.669257 + 628.307585 * t) + 3489 * cos(4.6261 + 1256.61517 * t) + 2060.6 * cos(2.67823 + 628.307585 * t) * t - 994 - 834 * sin(2.1824 - 33.75705 * t)
|
||||
t -= (n / 10000000 - w) / 628.332 + (32 * (t + 1.8) * (t + 1.8) - 20) / ShouXingUtil.SECOND_PER_DAY / 36525
|
||||
return t * 36525 + ShouXingUtil.ONE_THIRD
|
||||
|
||||
@staticmethod
|
||||
def shuoHigh(w):
|
||||
t = ShouXingUtil.msaLonT2(w) * 36525
|
||||
t = t - ShouXingUtil.dtT(t) + ShouXingUtil.ONE_THIRD
|
||||
v = ((t + 0.5) % 1) * ShouXingUtil.SECOND_PER_DAY
|
||||
if v < 1800 or v > ShouXingUtil.SECOND_PER_DAY - 1800:
|
||||
t = ShouXingUtil.msaLonT(w) * 36525 - ShouXingUtil.dtT(t) + ShouXingUtil.ONE_THIRD
|
||||
return t
|
||||
|
||||
@staticmethod
|
||||
def shuoLow(w):
|
||||
v = 7771.37714500204
|
||||
t = (w + 1.08472) / v
|
||||
t -= (-0.0000331 * t * t + 0.10976 * cos(0.785 + 8328.6914 * t) + 0.02224 * cos(0.187 + 7214.0629 * t) - 0.03342 * cos(4.669 + 628.3076 * t)) / v + (32 * (t + 1.8) * (t + 1.8) - 20) / ShouXingUtil.SECOND_PER_DAY / 36525
|
||||
return t * 36525 + ShouXingUtil.ONE_THIRD
|
||||
|
||||
@staticmethod
|
||||
def calcShuo(jd):
|
||||
if len(ShouXingUtil.__SB) < 1:
|
||||
ShouXingUtil.__SB = ShouXingUtil.__decode("EqoFscDcrFpmEsF2DfFideFelFpFfFfFiaipqti1ksttikptikqckstekqttgkqttgkqteksttikptikq2fjstgjqttjkqttgkqtekstfkptikq2tijstgjiFkirFsAeACoFsiDaDiADc1AFbBfgdfikijFifegF1FhaikgFag1E2btaieeibggiffdeigFfqDfaiBkF1kEaikhkigeidhhdiegcFfakF1ggkidbiaedksaFffckekidhhdhdikcikiakicjF1deedFhFccgicdekgiFbiaikcfi1kbFibefgEgFdcFkFeFkdcfkF1kfkcickEiFkDacFiEfbiaejcFfffkhkdgkaiei1ehigikhdFikfckF1dhhdikcfgjikhfjicjicgiehdikcikggcifgiejF1jkieFhegikggcikFegiegkfjebhigikggcikdgkaFkijcfkcikfkcifikiggkaeeigefkcdfcfkhkdgkegieidhijcFfakhfgeidieidiegikhfkfckfcjbdehdikggikgkfkicjicjF1dbidikFiggcifgiejkiegkigcdiegfggcikdbgfgefjF1kfegikggcikdgFkeeijcfkcikfkekcikdgkabhkFikaffcfkhkdgkegbiaekfkiakicjhfgqdq2fkiakgkfkhfkfcjiekgFebicggbedF1jikejbbbiakgbgkacgiejkijjgigfiakggfggcibFifjefjF1kfekdgjcibFeFkijcfkfhkfkeaieigekgbhkfikidfcjeaibgekgdkiffiffkiakF1jhbakgdki1dj1ikfkicjicjieeFkgdkicggkighdF1jfgkgfgbdkicggfggkidFkiekgijkeigfiskiggfaidheigF1jekijcikickiggkidhhdbgcfkFikikhkigeidieFikggikhkffaffijhidhhakgdkhkijF1kiakF1kfheakgdkifiggkigicjiejkieedikgdfcggkigieeiejfgkgkigbgikicggkiaideeijkefjeijikhkiggkiaidheigcikaikffikijgkiahi1hhdikgjfifaakekighie1hiaikggikhkffakicjhiahaikggikhkijF1kfejfeFhidikggiffiggkigicjiekgieeigikggiffiggkidheigkgfjkeigiegikifiggkidhedeijcfkFikikhkiggkidhh1ehigcikaffkhkiggkidhh1hhigikekfiFkFikcidhh1hitcikggikhkfkicjicghiediaikggikhkijbjfejfeFhaikggifikiggkigiejkikgkgieeigikggiffiggkigieeigekijcijikggifikiggkideedeijkefkfckikhkiggkidhh1ehijcikaffkhkiggkidhh1hhigikhkikFikfckcidhh1hiaikgjikhfjicjicgiehdikcikggifikigiejfejkieFhegikggifikiggfghigkfjeijkhigikggifikiggkigieeijcijcikfksikifikiggkidehdeijcfdckikhkiggkhghh1ehijikifffffkhsFngErD1pAfBoDd1BlEtFqA2AqoEpDqElAEsEeB2BmADlDkqBtC1FnEpDqnEmFsFsAFnllBbFmDsDiCtDmAB2BmtCgpEplCpAEiBiEoFqFtEqsDcCnFtADnFlEgdkEgmEtEsCtDmADqFtAFrAtEcCqAE1BoFqC1F1DrFtBmFtAC2ACnFaoCgADcADcCcFfoFtDlAFgmFqBq2bpEoAEmkqnEeCtAE1bAEqgDfFfCrgEcBrACfAAABqAAB1AAClEnFeCtCgAADqDoBmtAAACbFiAAADsEtBqAB2FsDqpFqEmFsCeDtFlCeDtoEpClEqAAFrAFoCgFmFsFqEnAEcCqFeCtFtEnAEeFtAAEkFnErAABbFkADnAAeCtFeAfBoAEpFtAABtFqAApDcCGJ")
|
||||
from .. import Solar
|
||||
size = len(ShouXingUtil.__SHUO_KB)
|
||||
d = 0
|
||||
pc = 14
|
||||
i = 0
|
||||
jd += Solar.J2000
|
||||
f1 = ShouXingUtil.__SHUO_KB[0] - pc
|
||||
f2 = ShouXingUtil.__SHUO_KB[size - 1] - pc
|
||||
f3 = 2436935
|
||||
if jd < f1 or jd >= f3:
|
||||
d = floor(ShouXingUtil.shuoHigh(floor((jd + pc - 2451551) / 29.5306) * ShouXingUtil.PI * 2) + 0.5)
|
||||
elif f1 <= jd < f2:
|
||||
for i in range(0, size, 2):
|
||||
if jd + pc < ShouXingUtil.__SHUO_KB[i + 2]:
|
||||
break
|
||||
d = ShouXingUtil.__SHUO_KB[i] + ShouXingUtil.__SHUO_KB[i + 1] * floor((jd + pc - ShouXingUtil.__SHUO_KB[i]) / ShouXingUtil.__SHUO_KB[i + 1])
|
||||
d = floor(d + 0.5)
|
||||
if d == 1683460:
|
||||
d += 1
|
||||
d -= Solar.J2000
|
||||
elif f2 <= jd < f3:
|
||||
d = floor(ShouXingUtil.shuoLow(floor((jd + pc - 2451551) / 29.5306) * ShouXingUtil.PI * 2) + 0.5)
|
||||
index = floor((jd - f2) / 29.5306)
|
||||
n = ShouXingUtil.__SB[index:index + 1]
|
||||
if "1" == n:
|
||||
d += 1
|
||||
elif "2" == n:
|
||||
d -= 1
|
||||
return d
|
||||
|
||||
@staticmethod
|
||||
def calcQi(jd):
|
||||
if len(ShouXingUtil.__QB) < 1:
|
||||
ShouXingUtil.__QB = ShouXingUtil.__decode("FrcFs22AFsckF2tsDtFqEtF1posFdFgiFseFtmelpsEfhkF2anmelpFlF1ikrotcnEqEq2FfqmcDsrFor22FgFrcgDscFs22FgEeFtE2sfFs22sCoEsaF2tsD1FpeE2eFsssEciFsFnmelpFcFhkF2tcnEqEpFgkrotcnEqrEtFermcDsrE222FgBmcmr22DaEfnaF222sD1FpeForeF2tssEfiFpEoeFssD1iFstEqFppDgFstcnEqEpFg11FscnEqrAoAF2ClAEsDmDtCtBaDlAFbAEpAAAAAD2FgBiBqoBbnBaBoAAAAAAAEgDqAdBqAFrBaBoACdAAf1AACgAAAeBbCamDgEifAE2AABa1C1BgFdiAAACoCeE1ADiEifDaAEqAAFe1AcFbcAAAAAF1iFaAAACpACmFmAAAAAAAACrDaAAADG0")
|
||||
from .. import Solar
|
||||
size = len(ShouXingUtil.__QI_KB)
|
||||
d = 0
|
||||
pc = 7
|
||||
i = 0
|
||||
jd += Solar.J2000
|
||||
f1 = ShouXingUtil.__QI_KB[0] - pc
|
||||
f2 = ShouXingUtil.__QI_KB[size - 1] - pc
|
||||
f3 = 2436935
|
||||
if jd < f1 or jd >= f3:
|
||||
# 2451259是1999.3.21,太阳视黄经为0,春分 定气计算
|
||||
d = floor(ShouXingUtil.qiHigh(floor((jd + pc - 2451259) / 365.2422 * 24) * ShouXingUtil.PI / 12) + 0.5)
|
||||
elif f1 <= jd < f2:
|
||||
for i in range(0, size, 2):
|
||||
if jd + pc < ShouXingUtil.__QI_KB[i + 2]:
|
||||
break
|
||||
d = ShouXingUtil.__QI_KB[i] + ShouXingUtil.__QI_KB[i + 1] * floor((jd + pc - ShouXingUtil.__QI_KB[i]) / ShouXingUtil.__QI_KB[i + 1])
|
||||
d = floor(d + 0.5)
|
||||
if d == 1683460:
|
||||
d += 1
|
||||
d -= Solar.J2000
|
||||
elif f2 <= jd < f3:
|
||||
d = floor(ShouXingUtil.qiLow(floor((jd + pc - 2451259) / 365.2422 * 24) * ShouXingUtil.PI / 12) + 0.5)
|
||||
# 找定气修正值
|
||||
index = floor((jd - f2) / 365.2422 * 24)
|
||||
n = ShouXingUtil.__QB[index:index + 1]
|
||||
if "1" == n:
|
||||
d += 1
|
||||
elif "2" == n:
|
||||
d -= 1
|
||||
return d
|
||||
|
||||
@staticmethod
|
||||
def qiAccurate(w):
|
||||
t = ShouXingUtil.saLonT(w) * 36525
|
||||
return t - ShouXingUtil.dtT(t) + ShouXingUtil.ONE_THIRD
|
||||
|
||||
@staticmethod
|
||||
def qiAccurate2(jd):
|
||||
d = ShouXingUtil.PI / 12
|
||||
w = floor((jd + 293) / 365.2422 * 24) * d
|
||||
a = ShouXingUtil.qiAccurate(w)
|
||||
if a - jd > 5:
|
||||
return ShouXingUtil.qiAccurate(w - d)
|
||||
if a - jd < -5:
|
||||
return ShouXingUtil.qiAccurate(w + d)
|
||||
return a
|
||||
+273
@@ -0,0 +1,273 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from math import ceil
|
||||
|
||||
|
||||
class SolarUtil:
|
||||
"""
|
||||
阳历工具
|
||||
"""
|
||||
|
||||
# 星期
|
||||
WEEK = ("日", "一", "二", "三", "四", "五", "六")
|
||||
|
||||
# 每月天数
|
||||
DAYS_OF_MONTH = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
|
||||
|
||||
# 星座
|
||||
XING_ZUO = ("白羊", "金牛", "双子", "巨蟹", "狮子", "处女", "天秤", "天蝎", "射手", "摩羯", "水瓶", "双鱼")
|
||||
|
||||
# 日期对应的节日
|
||||
FESTIVAL = {
|
||||
"1-1": "元旦节",
|
||||
"2-14": "情人节",
|
||||
"3-8": "妇女节",
|
||||
"3-12": "植树节",
|
||||
"3-15": "消费者权益日",
|
||||
"4-1": "愚人节",
|
||||
"5-1": "劳动节",
|
||||
"5-4": "青年节",
|
||||
"6-1": "儿童节",
|
||||
"7-1": "建党节",
|
||||
"8-1": "建军节",
|
||||
"9-10": "教师节",
|
||||
"10-1": "国庆节",
|
||||
"12-24": "平安夜",
|
||||
"12-25": "圣诞节",
|
||||
"10-31": "万圣节前夜",
|
||||
"11-1": "万圣节"
|
||||
}
|
||||
|
||||
# 几月第几个星期几对应的节日
|
||||
WEEK_FESTIVAL = {
|
||||
"3-0-1": "全国中小学生安全教育日",
|
||||
"5-2-0": "母亲节",
|
||||
"5-3-0": "全国助残日",
|
||||
"6-3-0": "父亲节",
|
||||
"9-3-6": "全民国防教育日",
|
||||
"10-1-1": "世界住房日",
|
||||
"11-4-4": "感恩节"
|
||||
}
|
||||
|
||||
# 日期对应的非正式节日
|
||||
OTHER_FESTIVAL = {
|
||||
"1-8": ["周恩来逝世纪念日"],
|
||||
"1-10": ["中国人民警察节"],
|
||||
"1-14": ["日记情人节"],
|
||||
"1-21": ["列宁逝世纪念日"],
|
||||
"1-26": ["国际海关日"],
|
||||
"1-27": ["国际大屠杀纪念日"],
|
||||
"2-2": ["世界湿地日"],
|
||||
"2-4": ["世界抗癌日"],
|
||||
"2-7": ["京汉铁路罢工纪念日"],
|
||||
"2-10": ["国际气象节"],
|
||||
"2-19": ["邓小平逝世纪念日"],
|
||||
"2-20": ["世界社会公正日"],
|
||||
"2-21": ["国际母语日"],
|
||||
"2-24": ["第三世界青年日"],
|
||||
"3-1": ["国际海豹日"],
|
||||
"3-3": ["世界野生动植物日", "全国爱耳日"],
|
||||
"3-5": ["周恩来诞辰纪念日", "中国青年志愿者服务日"],
|
||||
"3-6": ["世界青光眼日"],
|
||||
"3-7": ["女生节"],
|
||||
"3-12": ["孙中山逝世纪念日"],
|
||||
"3-14": ["马克思逝世纪念日", "白色情人节"],
|
||||
"3-17": ["国际航海日"],
|
||||
"3-18": ["全国科技人才活动日", "全国爱肝日"],
|
||||
"3-20": ["国际幸福日"],
|
||||
"3-21": ["世界森林日", "世界睡眠日", "国际消除种族歧视日"],
|
||||
"3-22": ["世界水日"],
|
||||
"3-23": ["世界气象日"],
|
||||
"3-24": ["世界防治结核病日"],
|
||||
"3-29": ["中国黄花岗七十二烈士殉难纪念日"],
|
||||
"4-2": ["国际儿童图书日", "世界自闭症日"],
|
||||
"4-4": ["国际地雷行动日"],
|
||||
"4-7": ["世界卫生日"],
|
||||
"4-8": ["国际珍稀动物保护日"],
|
||||
"4-12": ["世界航天日"],
|
||||
"4-14": ["黑色情人节"],
|
||||
"4-15": ["全民国家安全教育日"],
|
||||
"4-22": ["世界地球日", "列宁诞辰纪念日"],
|
||||
"4-23": ["世界读书日"],
|
||||
"4-24": ["中国航天日"],
|
||||
"4-25": ["儿童预防接种宣传日"],
|
||||
"4-26": ["世界知识产权日", "全国疟疾日"],
|
||||
"4-28": ["世界安全生产与健康日"],
|
||||
"4-30": ["全国交通安全反思日"],
|
||||
"5-2": ["世界金枪鱼日"],
|
||||
"5-3": ["世界新闻自由日"],
|
||||
"5-5": ["马克思诞辰纪念日"],
|
||||
"5-8": ["世界红十字日"],
|
||||
"5-11": ["世界肥胖日"],
|
||||
"5-12": ["全国防灾减灾日", "护士节"],
|
||||
"5-14": ["玫瑰情人节"],
|
||||
"5-15": ["国际家庭日"],
|
||||
"5-19": ["中国旅游日"],
|
||||
"5-20": ["网络情人节"],
|
||||
"5-22": ["国际生物多样性日"],
|
||||
"5-25": ["525心理健康节"],
|
||||
"5-27": ["上海解放日"],
|
||||
"5-29": ["国际维和人员日"],
|
||||
"5-30": ["中国五卅运动纪念日"],
|
||||
"5-31": ["世界无烟日"],
|
||||
"6-3": ["世界自行车日"],
|
||||
"6-5": ["世界环境日"],
|
||||
"6-6": ["全国爱眼日"],
|
||||
"6-8": ["世界海洋日"],
|
||||
"6-11": ["中国人口日"],
|
||||
"6-14": ["世界献血日", "亲亲情人节"],
|
||||
"6-17": ["世界防治荒漠化与干旱日"],
|
||||
"6-20": ["世界难民日"],
|
||||
"6-21": ["国际瑜伽日"],
|
||||
"6-25": ["全国土地日"],
|
||||
"6-26": ["国际禁毒日", "联合国宪章日"],
|
||||
"7-1": ["香港回归纪念日"],
|
||||
"7-6": ["国际接吻日", "朱德逝世纪念日"],
|
||||
"7-7": ["七七事变纪念日"],
|
||||
"7-11": ["世界人口日", "中国航海日"],
|
||||
"7-14": ["银色情人节"],
|
||||
"7-18": ["曼德拉国际日"],
|
||||
"7-30": ["国际友谊日"],
|
||||
"8-3": ["男人节"],
|
||||
"8-5": ["恩格斯逝世纪念日"],
|
||||
"8-6": ["国际电影节"],
|
||||
"8-8": ["全民健身日"],
|
||||
"8-9": ["国际土著人日"],
|
||||
"8-12": ["国际青年节"],
|
||||
"8-14": ["绿色情人节"],
|
||||
"8-19": ["世界人道主义日", "中国医师节"],
|
||||
"8-22": ["邓小平诞辰纪念日"],
|
||||
"8-29": ["全国测绘法宣传日"],
|
||||
"9-3": ["中国抗日战争胜利纪念日"],
|
||||
"9-5": ["中华慈善日"],
|
||||
"9-8": ["世界扫盲日"],
|
||||
"9-9": ["毛泽东逝世纪念日", "全国拒绝酒驾日"],
|
||||
"9-14": ["世界清洁地球日", "相片情人节"],
|
||||
"9-15": ["国际民主日"],
|
||||
"9-16": ["国际臭氧层保护日"],
|
||||
"9-17": ["世界骑行日"],
|
||||
"9-18": ["九一八事变纪念日"],
|
||||
"9-20": ["全国爱牙日"],
|
||||
"9-21": ["国际和平日"],
|
||||
"9-27": ["世界旅游日"],
|
||||
"9-30": ["中国烈士纪念日"],
|
||||
"10-1": ["国际老年人日"],
|
||||
"10-2": ["国际非暴力日"],
|
||||
"10-4": ["世界动物日"],
|
||||
"10-11": ["国际女童日"],
|
||||
"10-10": ["辛亥革命纪念日"],
|
||||
"10-13": ["国际减轻自然灾害日", "中国少年先锋队诞辰日"],
|
||||
"10-14": ["葡萄酒情人节"],
|
||||
"10-16": ["世界粮食日"],
|
||||
"10-17": ["全国扶贫日"],
|
||||
"10-20": ["世界统计日"],
|
||||
"10-24": ["世界发展信息日", "程序员节"],
|
||||
"10-25": ["抗美援朝纪念日"],
|
||||
"11-5": ["世界海啸日"],
|
||||
"11-8": ["记者节"],
|
||||
"11-9": ["全国消防日"],
|
||||
"11-11": ["光棍节"],
|
||||
"11-12": ["孙中山诞辰纪念日"],
|
||||
"11-14": ["电影情人节"],
|
||||
"11-16": ["国际宽容日"],
|
||||
"11-17": ["国际大学生节"],
|
||||
"11-19": ["世界厕所日"],
|
||||
"11-28": ["恩格斯诞辰纪念日"],
|
||||
"11-29": ["国际声援巴勒斯坦人民日"],
|
||||
"12-1": ["世界艾滋病日"],
|
||||
"12-2": ["全国交通安全日"],
|
||||
"12-3": ["世界残疾人日"],
|
||||
"12-4": ["全国法制宣传日"],
|
||||
"12-5": ["世界弱能人士日", "国际志愿人员日"],
|
||||
"12-7": ["国际民航日"],
|
||||
"12-9": ["世界足球日", "国际反腐败日"],
|
||||
"12-10": ["世界人权日"],
|
||||
"12-11": ["国际山岳日"],
|
||||
"12-12": ["西安事变纪念日"],
|
||||
"12-13": ["国家公祭日"],
|
||||
"12-14": ["拥抱情人节"],
|
||||
"12-18": ["国际移徙者日"],
|
||||
"12-26": ["毛泽东诞辰纪念日"]
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def isLeapYear(year):
|
||||
"""
|
||||
是否闰年
|
||||
:param year: 年
|
||||
:return: True/False 闰年/非闰年
|
||||
"""
|
||||
if year < 1600:
|
||||
return year % 4 == 0
|
||||
return (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0)
|
||||
|
||||
@staticmethod
|
||||
def getDaysOfYear(year):
|
||||
if 1582 == year:
|
||||
return 355
|
||||
d = 365
|
||||
if SolarUtil.isLeapYear(year):
|
||||
d = 366
|
||||
return d
|
||||
|
||||
@staticmethod
|
||||
def getDaysOfMonth(year, month):
|
||||
"""
|
||||
获取某年某月有多少天
|
||||
:param year: 年
|
||||
:param month: 月
|
||||
:return: 天数
|
||||
"""
|
||||
if 1582 == year and 10 == month:
|
||||
return 21
|
||||
d = SolarUtil.DAYS_OF_MONTH[month - 1]
|
||||
# 公历闰年2月多一天
|
||||
if month == 2 and SolarUtil.isLeapYear(year):
|
||||
d += 1
|
||||
return d
|
||||
|
||||
@staticmethod
|
||||
def getDaysInYear(year, month, day):
|
||||
days = 0
|
||||
for i in range(1, month):
|
||||
days += SolarUtil.getDaysOfMonth(year, i)
|
||||
d = day
|
||||
if 1582 == year and 10 == month:
|
||||
if day >= 15:
|
||||
d -= 10
|
||||
elif day > 4:
|
||||
raise Exception("wrong solar year %d month %d day %d" % (year, month, day))
|
||||
days += d
|
||||
return days
|
||||
|
||||
@staticmethod
|
||||
def getWeeksOfMonth(year, month, start):
|
||||
"""
|
||||
获取某年某月有多少周
|
||||
:param year: 年
|
||||
:param month: 月
|
||||
:param start: 星期几作为一周的开始,1234560分别代表星期一至星期天
|
||||
:return: 天数
|
||||
"""
|
||||
from .. import Solar
|
||||
return int(ceil((SolarUtil.getDaysOfMonth(year, month) + Solar.fromYmd(year, month, 1).getWeek() - start) * 1.0 / len(SolarUtil.WEEK)))
|
||||
|
||||
@staticmethod
|
||||
def getDaysBetween(ay: int, am: int, ad: int, by: int, bm: int, bd: int):
|
||||
if ay == by:
|
||||
n = SolarUtil.getDaysInYear(by, bm, bd) - SolarUtil.getDaysInYear(ay, am, ad)
|
||||
elif ay > by:
|
||||
days = SolarUtil.getDaysOfYear(by) - SolarUtil.getDaysInYear(by, bm, bd)
|
||||
for i in range(by + 1, ay):
|
||||
days += SolarUtil.getDaysOfYear(i)
|
||||
days += SolarUtil.getDaysInYear(ay, am, ad)
|
||||
n = -days
|
||||
else:
|
||||
days = SolarUtil.getDaysOfYear(ay) - SolarUtil.getDaysInYear(ay, am, ad)
|
||||
for i in range(ay + 1, by):
|
||||
days += SolarUtil.getDaysOfYear(i)
|
||||
days += SolarUtil.getDaysInYear(by, bm, bd)
|
||||
n = days
|
||||
return n
|
||||
+147
@@ -0,0 +1,147 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from ..TaoFestival import TaoFestival
|
||||
|
||||
|
||||
class TaoUtil:
|
||||
"""
|
||||
道历工具
|
||||
"""
|
||||
|
||||
# 三会日
|
||||
SAN_HUI = ("1-7", "7-7", "10-15")
|
||||
|
||||
# 三元日
|
||||
SAN_YUAN = ("1-15", "7-15", "10-15")
|
||||
|
||||
# 五腊日
|
||||
WU_LA = ("1-1", "5-5", "7-7", "10-1", "12-8")
|
||||
|
||||
# 暗戊
|
||||
AN_WU = ("未", "戌", "辰", "寅", "午", "子", "酉", "申", "巳", "亥", "卯", "丑")
|
||||
|
||||
# 八会日
|
||||
BA_HUI = {
|
||||
"丙午": "天会",
|
||||
"壬午": "地会",
|
||||
"壬子": "人会",
|
||||
"庚午": "日会",
|
||||
"庚申": "月会",
|
||||
"辛酉": "星辰会",
|
||||
"甲辰": "五行会",
|
||||
"甲戌": "四时会"
|
||||
}
|
||||
|
||||
# 八节日
|
||||
BA_JIE = {
|
||||
"立春": "东北方度仙上圣天尊同梵炁始青天君下降",
|
||||
"春分": "东方玉宝星上天尊同青帝九炁天君下降",
|
||||
"立夏": "东南方好生度命天尊同梵炁始丹天君下降",
|
||||
"夏至": "南方玄真万福天尊同赤帝三炁天君下降",
|
||||
"立秋": "西南方太灵虚皇天尊同梵炁始素天君下降",
|
||||
"秋分": "西方太妙至极天尊同白帝七炁天君下降",
|
||||
"立冬": "西北方无量太华天尊同梵炁始玄天君下降",
|
||||
"冬至": "北方玄上玉宸天尊同黑帝五炁天君下降"
|
||||
}
|
||||
|
||||
# 日期对应的节日
|
||||
FESTIVAL = {
|
||||
"1-1": [TaoFestival("天腊之辰", "天腊,此日五帝会于东方九炁青天")],
|
||||
"1-3": [TaoFestival("郝真人圣诞"), TaoFestival("孙真人圣诞")],
|
||||
"1-5": [TaoFestival("孙祖清静元君诞")],
|
||||
"1-7": [TaoFestival("举迁赏会", "此日上元赐福,天官同地水二官考校罪福")],
|
||||
"1-9": [TaoFestival("玉皇上帝圣诞")],
|
||||
"1-13": [TaoFestival("关圣帝君飞升")],
|
||||
"1-15": [TaoFestival("上元天官圣诞"), TaoFestival("老祖天师圣诞")],
|
||||
"1-19": [TaoFestival("长春邱真人(邱处机)圣诞")],
|
||||
"1-28": [TaoFestival("许真君(许逊天师)圣诞")],
|
||||
"2-1": [TaoFestival("勾陈天皇大帝圣诞"), TaoFestival("长春刘真人(刘渊然)圣诞")],
|
||||
"2-2": [TaoFestival("土地正神诞"), TaoFestival("姜太公圣诞")],
|
||||
"2-3": [TaoFestival("文昌梓潼帝君圣诞")],
|
||||
"2-6": [TaoFestival("东华帝君圣诞")],
|
||||
"2-13": [TaoFestival("度人无量葛真君圣诞")],
|
||||
"2-15": [TaoFestival("太清道德天尊(太上老君)圣诞")],
|
||||
"2-19": [TaoFestival("慈航真人圣诞")],
|
||||
"3-1": [TaoFestival("谭祖(谭处端)长真真人圣诞")],
|
||||
"3-3": [TaoFestival("玄天上帝圣诞")],
|
||||
"3-6": [TaoFestival("眼光娘娘圣诞")],
|
||||
"3-15": [TaoFestival("天师张大真人圣诞"), TaoFestival("财神赵公元帅圣诞")],
|
||||
"3-16": [TaoFestival("三茅真君得道之辰"), TaoFestival("中岳大帝圣诞")],
|
||||
"3-18": [TaoFestival("王祖(王处一)玉阳真人圣诞"), TaoFestival("后土娘娘圣诞")],
|
||||
"3-19": [TaoFestival("太阳星君圣诞")],
|
||||
"3-20": [TaoFestival("子孙娘娘圣诞")],
|
||||
"3-23": [TaoFestival("天后妈祖圣诞")],
|
||||
"3-26": [TaoFestival("鬼谷先师诞")],
|
||||
"3-28": [TaoFestival("东岳大帝圣诞")],
|
||||
"4-1": [TaoFestival("长生谭真君成道之辰")],
|
||||
"4-10": [TaoFestival("何仙姑圣诞")],
|
||||
"4-14": [TaoFestival("吕祖纯阳祖师圣诞")],
|
||||
"4-15": [TaoFestival("钟离祖师圣诞")],
|
||||
"4-18": [TaoFestival("北极紫微大帝圣诞"), TaoFestival("泰山圣母碧霞元君诞"), TaoFestival("华佗神医先师诞")],
|
||||
"4-20": [TaoFestival("眼光圣母娘娘诞")],
|
||||
"4-28": [TaoFestival("神农先帝诞")],
|
||||
"5-1": [TaoFestival("南极长生大帝圣诞")],
|
||||
"5-5": [TaoFestival("地腊之辰", "地腊,此日五帝会于南方三炁丹天"), TaoFestival("南方雷祖圣诞"), TaoFestival("地祗温元帅圣诞"), TaoFestival("雷霆邓天君圣诞")],
|
||||
"5-11": [TaoFestival("城隍爷圣诞")],
|
||||
"5-13": [TaoFestival("关圣帝君降神"), TaoFestival("关平太子圣诞")],
|
||||
"5-18": [TaoFestival("张天师圣诞")],
|
||||
"5-20": [TaoFestival("马祖丹阳真人圣诞")],
|
||||
"5-29": [TaoFestival("紫青白祖师圣诞")],
|
||||
"6-1": [TaoFestival("南斗星君下降")],
|
||||
"6-2": [TaoFestival("南斗星君下降")],
|
||||
"6-3": [TaoFestival("南斗星君下降")],
|
||||
"6-4": [TaoFestival("南斗星君下降")],
|
||||
"6-5": [TaoFestival("南斗星君下降")],
|
||||
"6-6": [TaoFestival("南斗星君下降")],
|
||||
"6-10": [TaoFestival("刘海蟾祖师圣诞")],
|
||||
"6-15": [TaoFestival("灵官王天君圣诞")],
|
||||
"6-19": [TaoFestival("慈航(观音)成道日")],
|
||||
"6-23": [TaoFestival("火神圣诞")],
|
||||
"6-24": [TaoFestival("南极大帝中方雷祖圣诞"), TaoFestival("关圣帝君圣诞")],
|
||||
"6-26": [TaoFestival("二郎真君圣诞")],
|
||||
"7-7": [TaoFestival("道德腊之辰", "道德腊,此日五帝会于西方七炁素天"), TaoFestival("庆生中会", "此日中元赦罪,地官同天水二官考校罪福")],
|
||||
"7-12": [TaoFestival("西方雷祖圣诞")],
|
||||
"7-15": [TaoFestival("中元地官大帝圣诞")],
|
||||
"7-18": [TaoFestival("王母娘娘圣诞")],
|
||||
"7-20": [TaoFestival("刘祖(刘处玄)长生真人圣诞")],
|
||||
"7-22": [TaoFestival("财帛星君文财神增福相公李诡祖圣诞")],
|
||||
"7-26": [TaoFestival("张三丰祖师圣诞")],
|
||||
"8-1": [TaoFestival("许真君飞升日")],
|
||||
"8-3": [TaoFestival("九天司命灶君诞")],
|
||||
"8-5": [TaoFestival("北方雷祖圣诞")],
|
||||
"8-10": [TaoFestival("北岳大帝诞辰")],
|
||||
"8-15": [TaoFestival("太阴星君诞")],
|
||||
"9-1": [TaoFestival("北斗九皇降世之辰")],
|
||||
"9-2": [TaoFestival("北斗九皇降世之辰")],
|
||||
"9-3": [TaoFestival("北斗九皇降世之辰")],
|
||||
"9-4": [TaoFestival("北斗九皇降世之辰")],
|
||||
"9-5": [TaoFestival("北斗九皇降世之辰")],
|
||||
"9-6": [TaoFestival("北斗九皇降世之辰")],
|
||||
"9-7": [TaoFestival("北斗九皇降世之辰")],
|
||||
"9-8": [TaoFestival("北斗九皇降世之辰")],
|
||||
"9-9": [TaoFestival("北斗九皇降世之辰"), TaoFestival("斗姥元君圣诞"), TaoFestival("重阳帝君圣诞"), TaoFestival("玄天上帝飞升"), TaoFestival("酆都大帝圣诞")],
|
||||
"9-22": [TaoFestival("增福财神诞")],
|
||||
"9-23": [TaoFestival("萨翁真君圣诞")],
|
||||
"9-28": [TaoFestival("五显灵官马元帅圣诞")],
|
||||
"10-1": [TaoFestival("民岁腊之辰", "民岁腊,此日五帝会于北方五炁黑天"), TaoFestival("东皇大帝圣诞")],
|
||||
"10-3": [TaoFestival("三茅应化真君圣诞")],
|
||||
"10-6": [TaoFestival("天曹诸司五岳五帝圣诞")],
|
||||
"10-15": [TaoFestival("下元水官大帝圣诞"), TaoFestival("建生大会", "此日下元解厄,水官同天地二官考校罪福")],
|
||||
"10-18": [TaoFestival("地母娘娘圣诞")],
|
||||
"10-19": [TaoFestival("长春邱真君飞升")],
|
||||
"10-20": [TaoFestival("虚靖天师(即三十代天师弘悟张真人)诞")],
|
||||
"11-6": [TaoFestival("西岳大帝圣诞")],
|
||||
"11-9": [TaoFestival("湘子韩祖圣诞")],
|
||||
"11-11": [TaoFestival("太乙救苦天尊圣诞")],
|
||||
"11-26": [TaoFestival("北方五道圣诞")],
|
||||
"12-8": [TaoFestival("王侯腊之辰", "王侯腊,此日五帝会于上方玄都玉京")],
|
||||
"12-16": [TaoFestival("南岳大帝圣诞"), TaoFestival("福德正神诞")],
|
||||
"12-20": [TaoFestival("鲁班先师圣诞")],
|
||||
"12-21": [TaoFestival("天猷上帝圣诞")],
|
||||
"12-22": [TaoFestival("重阳祖师圣诞")],
|
||||
"12-23": [TaoFestival("祭灶王", "最适宜谢旧年太岁,开启拜新年太岁")],
|
||||
"12-25": [TaoFestival("玉帝巡天"), TaoFestival("天神下降")],
|
||||
"12-29": [TaoFestival("清静孙真君(孙不二)成道")]
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from .HolidayUtil import HolidayUtil
|
||||
from .ShouXingUtil import ShouXingUtil
|
||||
from .SolarUtil import SolarUtil
|
||||
from .LunarUtil import LunarUtil
|
||||
from .FotoUtil import FotoUtil
|
||||
from .TaoUtil import TaoUtil
|
||||
Reference in New Issue
Block a user