およそ5等星以上の恒星データや星座線,惑星の軌道要素などを使ってある年月日,時刻の星空を再現するプログラムを作ってみました。惑星位置の元期は2008年で,200年前後なら月や惑星の位置にそれほど誤差は生じません(ステラナビゲータで確認しました)。また,1000年単位では,歳差の影響が出ますので,その補正も追加しました。ソースコードはおよそ700行もあって,長いかもしれません。すなわちあまり上手なプログラムとは言えないしろものですが,教材として参考にしていただけたらと思います。恒星データは Astro Commons (アストロ・コモンズ)。 http://astronomy.webcrow.jp/help/ から。計算などは,中野主一著「マイコンで解く天体の謎」と長沢工著「天体の位置計算」をもとにしています。実行には,numpyモジュールを同梱しているAnacondaをインストールする必要があります。下記のCSVファイルを同一ディレクトリに置いてpythonを起動して試してください。


import tkinter as tk
import csv
import math
import numpy as np
import pandas as pd

def JDT(mjd):   #ユリウス日をグレゴリオ暦に直す計算(こよみ便利帳より)
    jd = mjd + 2400000.5
    Z = int(jd + 0.5)
    if Z >=2299161:
        a = int((Z - 1867216.25) / 36524.25)
        A = Z + 1 + a - int(a / 4)
    else:
        A = Z
    B = A + 1524
    C = int((B - 122.1) / 365.25)
    K = int(365.25 * C)
    E = int((B - K)/30.6001)
    DD = B - K - int(30.6001 * E) + (jd + 0.5) - int(jd + 0.5)
    if E < 13.5:
        MM = E -1
    else:
        MM = E -13
    if MM > 2.5:
        YY = C - 4716
    else:
        YY = C - 4715
    if MM >= 13:
        YY = YY + 1
        MM = MM -12

    hh = DD - int(DD)
    DD = int(DD)
    hh = round(hh*24 + 9)
    return [YY,MM,DD,hh]

def koseji(mjd):    # 恒星時の計算
    ST = 0.67239 + 1.00273781*(mjd-40000) + 139.754/360
    ST = (ST - int(ST))*24
    return ST


def rotate_X1(deg):   # X軸回転の行列
    r = np.radians(deg)
    C = np.cos(r)
    S = np.sin(r)
    R_x = np.matrix((
        (1, 0, 0),
        (0, C, S),
        (0, -S, C)
    ))
    return R_x

def rotate_Y1(deg):   # 緯度を天頂方向にY軸回転の行列
    r = np.radians(deg)
    C = np.cos(r)
    S = np.sin(r)
    R_y = np.matrix((
        (C, 0, -S),
        (0, 1, 0),
        (S, 0, C)
    ))
    return R_y

def rotate_Z1(deg):   # 恒星時に直すZ軸回転の行列
    r = np.radians(deg)
    C = np.cos(r)
    S = np.sin(r)
    R_z = np.matrix((
        (C, S, 0),
        (-S, C, 0),
        (0, 0, 1)
    ))
    return R_z

def yogen_AD(arfa,drta):  #方向余弦の計算
    a = math.radians(arfa)
    d = math.radians(drta)
    L = math.cos(a) * math.cos(d)
    M = math.cos(d) * math.sin(a)
    N = math.sin(d)
    AD = np.array([L,M,N])
    AD = AD.reshape(3,1)
    return AD

def saisa_hosei(ad):  #歳差補正(ニューカムのパラメータによる)
    t = T1/100
    f = 0.640616 * t + 0.0000839* t*t + 0.000005*t**3
    z = 0.640616 * t + 0.000304 * t*t + 0.00000506*t**3
    s = 0.556753 * t - 0.000119 * t*t - 0.0000116*t**3
    a = rotate_Z1(-z-90)
    b = rotate_X1(s)
    c = rotate_Z1(90-f)
    e =  a * b * c * ad
    return e

def horizon(ad):   # 地平座標の計算(ST;恒星時 F;緯度 ad;方向余弦)
    a = rotate_Y1(90 - F)
    b = rotate_Z1(ST)
    c = a * b * ad
    h = math.asin(c[2])
    h = math.degrees(h)
    A = math.atan(-c[1]/c[0])
    A = math.degrees(A)
    if c[0] < 0. :
        A = A + 180.
    return [h,A]

def dispXY(hh,AA):
    dot = 580  #画面のパラメータ 中心座標(600,450)
    r = dot * math.sin(math.radians((90-hh)/2))
    x = r * math.sin(math.radians(AA)) + 600
    y = r * math.cos(math.radians(AA)) + 450
    return  [x,y]

def kepler(e,L0,n):  #ケプラー方程式の解を求める
    L1 = n * T0 + L0
    L1 = math.radians(L1)
    u0 = L1
    du = (L1 - u0 + e*math.sin(u0))/(1 - e*math.cos(u0))
    u1 = u0 + du
    while du  > 0.00000001:
        du = (L1 - u1 + e*math.sin(u1))/(1 - e*math.cos(u1))
        u1 = u1 + du
    return u1

def solarpos(x,y,i,Om,w):  #惑星の日心赤道座標の計算
    i = math.radians(i)
    Om = math.radians(Om)
    w = math.radians(w)
    c = 0.917436958
    s = 0.397881172
    xc = x*(math.cos(Om)*math.cos(w) - math.sin(Om)*math.cos(i)*math.sin(w)) - \
         y*(math.cos(Om)*math.sin(w) + math.sin(Om)*math.cos(i)*math.cos(w))
    yc = x*(math.sin(Om)*math.cos(w) + math.cos(Om)*math.cos(i)*math.sin(w)) - \
         y*(math.sin(Om)*math.sin(w) - math.cos(Om)*math.cos(i)*math.cos(w))
    zc = x*math.sin(i)*math.sin(w) + y*math.sin(i)*math.cos(w)
    xq = xc
    yq = yc*c - zc*s
    zq = yc*s + zc*c
    r = [xq,yq,zq]
    return r   

def magnitude(m):
    if m < 0.0:
       rd = 7
    elif m < 1.0:
       rd = 6
    elif m < 2.0:
       rd = 5
    elif m < 3.0:
       rd = 4
    elif m < 4.0:
        rd = 3
    else:
       rd = 2
    return rd

class Conline:  # 星座線クラス
    def __init__(self):
        self.lcnum = 0
        self.linRas = 0
        self.linDcs = 0
        self.linRae = 0
        self.linDce = 0

class Star:  #星クラス
    def __init__(self):
        self.stcnum = 0
        self.stRA = 0
        self.stDC = 0
        self.stMg = 0
class Constelation:  #星座クラス
    def __init__(self):
        self.con_name = ""
        self.con_Ra = 0
        self.con_Dc = 0
class Planet:   #惑星クラス
    def __init__(self):
        self.pl_name = ""
        self.pl_a = 0
        self.pl_e = 0
        self.pl_i = 0
        self.pl_w = 0
        self.pl_O = 0
        self.pl_L0 = 0
        self.pl_n = 0
        self.pl_CL = 0
        self.pl_mag = 0
class Planetarium:  #プラネタリウムクラス
    # 惑星表示のための変数
    Xq = [0.0] * 8
    Yq = [0.0] * 8
    Zq = [0.0] * 8
    Aq = [0.0] * 8
    Bq = [0.0] * 8
    Cq = [0.0] * 8
    R = [0.0] * 8
    pR = [0.0] * 8
    pmag = [0.0] * 8
    pl_RA = [0.0] * 8
    pl_DC = [0.0] * 8
    ph = [0.0] * 8
    pA = [0.0] * 8
    pname = [0] * 8
    pcolor = [0] * 8
    xp = [0.0] * 8
    yp = [0.0] * 8
    dr = [0.0] * 8
    plane_counter = 0
    #星表示のための変数
    XX = [0.0] * 1000
    YY = [0.0] * 1000
    hh = [0.0] * 1000
    AA = [0.0] * 1000
    MG = [0.0] * 1000
    rd = [0] * 1000
    hLs = [0.0] * 500
    hLe = [0.0] * 500
    ALs = [0.0] * 500
    ALe = [0.0] * 500
    x1 = [0.0] * 500
    y1 = [0.0] * 500
    x2 = [0.0] * 500
    y2 = [0.0] * 500
    nh = [0.0] * 60
    nA = [0.0] * 60
    xn = [0.0] * 60
    yn = [0.0] * 60
    coname = [""] * 60
    star_counter = 0
    line_counter = 0
    con_counter = 0

    def __init__(self):
        #星、星座線リストを作る
        self.star_list = list()
        self.conline_list = list()
        self.conste_list = list()
        self.planet_list = list()
        
        for i in range(3215):
            self.star_list.append(Star())

        for i in range(673):
            self.conline_list.append(Conline())

        for i in range(89):
            self.conste_list.append(Constelation())

        for i in range(8):
            self.planet_list.append(Planet())

        #データ読み込み
        with open("star.csv", "r") as f:  # 恒星ファイル読み込み
            stDATA = csv.reader(f, delimiter=",")
            i = 0
            for row in stDATA:
                self.star_list[i].stcnum = int(row[1])
                self.star_list[i].stRA = float(row[2])*15  #赤経
                self.star_list[i].stDC = float(row[3])     #赤緯
                self.star_list[i].stMg = float(row[4])
                i += 1

        with open("con-line.csv","r") as f:  #星座線ファイル読み込み
            szL=csv.reader(f,delimiter=",")
            i=0
            for row in szL:
                self.conline_list[i].lcnum = int(row[0]) #星座コード
                self.conline_list[i].linRas = float(row[1])  #始点
                self.conline_list[i].linDcs = float(row[2])
                self.conline_list[i].linRae = float(row[3])  #終点
                self.conline_list[i].linDce = float(row[4])
                i +=1
        with open("con-name.csv","r") as f:  #星座名ファイル読み込み
            szM=csv.reader(f,delimiter=",")
            i=0
            for row in szM:
                self.conste_list[i].con_name = str(row[0]) #星座名
                self.conste_list[i].con_Ra = float(int(row[1])*15+int(row[2])*0.25)
                self.conste_list[i].con_Dc = float(row[3])
                i +=1
        with open("planet-element-2008.csv","r") as f:
            t=csv.reader(f,delimiter=",")
            i=0
            for row in t:
                self.planet_list[i].pl_a = float(row[0])
                self.planet_list[i].pl_e = float(row[1])
                self.planet_list[i].pl_i = float(row[2])
                self.planet_list[i].pl_w = float(row[3])
                self.planet_list[i].pl_O = float(row[4])
                self.planet_list[i].pl_L0 = float(row[6])
                self.planet_list[i].pl_n = float(row[5])
                self.planet_list[i].pl_name =row[7]
                self.planet_list[i].pl_CL = row[8]
                self.planet_list[i].pl_mag = float(row[9])
                i +=1
                
    def star_culc(self):       #恒星表示メソッド

        m = 0             #星座線の地平座標計算
        for line in self.conline_list:
            ad = yogen_AD(line.linRas,line.linDcs)
            ad = saisa_hosei(ad)
            h = horizon(ad)
            if h[0] < 8.0:
                continue
            self.hLs[m] = h[0]
            self.ALs[m] = h[1]
            ad = yogen_AD(line.linRae,line.linDce)
            ad = saisa_hosei(ad)
            h = horizon(ad)
            self.hLe[m] = h[0]
            self.ALe[m] = h[1]
            m += 1
        self.line_counter = m

        i = 0
        for i in range( self.line_counter):   #画面上の座標
            xy= dispXY(self.hLs[i],self.ALs[i])
            self.x1[i] = xy[0]
            self.y1[i] = xy[1]
            xy= dispXY(self.hLe[i],self.ALe[i])
            self.x2[i] = xy[0]
            self.y2[i] = xy[1]


            
        n = 0              # 恒星の地平座標計算
        for star in self.star_list:
            ad = yogen_AD(star.stRA,star.stDC)
            ad = saisa_hosei(ad)
            h = horizon(ad)
            if h[0] < 0.0:
                continue
            if star.stMg > 4.8:
                continue
            self.hh[n] = h[0]
            self.AA[n] = h[1]
            self.MG[n] = star.stMg
            n += 1
        self.star_counter = n

        for i in range(self.star_counter):
            xy= dispXY(self.hh[i],self.AA[i])
            self.XX[i] = xy[0]
            self.YY[i] = xy[1]
            

        n = 0            #星座名表示の地平座標計算
        for c in self.conste_list:
            ad = yogen_AD(c.con_Ra,c.con_Dc)
            ad = saisa_hosei(ad)
            h = horizon(ad)
            if h[0] < 0.0:
                continue
            self.nh[n] = h[0]
            self.nA[n] = h[1]
            self.coname[n] = c.con_name
            n += 1
        self.con_counter = n

        for i in range(self.con_counter):    
            xy= dispXY(self.nh[i],self.nA[i])
            self.xn[i] = xy[0]
            self.yn[i] = xy[1]
            


    def star_display(self):
        # 星座線を引く
        for i in range( self.line_counter):
            c0.create_line(self.x1[i],self. y1[i], self.x2[i], self.y2[i], fill = 'blue')
            c0.pack()

        # 星のプロット
        for i in range(self.star_counter):
            self.rd[i] = magnitude(self.MG[i])
            self.rd[i] = self.rd[i]/2
            c0.create_oval(self.XX[i]-self.rd[i], self.YY[i]-self.rd[i],self.XX[i]+self.rd[i],self.YY[i]+self.rd[i],fill = 'white')

        #星座名の表示
        for i in range(self.con_counter):
            c0.create_text(self.xn[i],self.yn[i],text = self.coname[i],font = ('',8),fill = 'red')
            c0.pack()

    def planet_culc(self):  #惑星の位置計算と表示
        i = 0
        for p in self.planet_list:
            self.pname[i] = p.pl_name
            self.pcolor[i] = p.pl_CL
            self.pmag[i] = p.pl_mag
            u = kepler(p.pl_e,p.pl_L0,p.pl_n)
            x = p.pl_a*(math.cos(u) - p.pl_e)
            y = p.pl_a*math.sqrt(1-p.pl_e**2)*math.sin(u)
            r = solarpos(x,y,p.pl_i,p.pl_O,p.pl_w)
            self.Xq[i] = r[0]
            self.Yq[i] = r[1]
            self.Zq[i] = r[2]
            self.pR[i] = math.sqrt(self.Xq[i]**2 + self.Yq[i]**2 + self.Zq[i]**2)
            if i == 2:   #地球の座標から太陽の方向を求める
                eu = self.Xq[i]
                ev = self.Yq[i]
                ew = self.Zq[i]
                self.Xq[i] = -self.Xq[i]
                self.Yq[i] = -self.Yq[i]
                self.Zq[i] = -self.Zq[i]
                dE = math.sqrt(eu*eu + ev*ev + ew*ew) #地球と太陽の距離
            i += 1
            
        for i in range(8):   # 地心赤道座標への変換
            if i ==2:
                self.Aq[i] = self.Xq[i]
                self.Bq[i] = self.Yq[i]
                self.Cq[i] = self.Zq[i]
            else:
                self.Aq[i] = self.Xq[i] - eu
                self.Bq[i] = self.Yq[i] - ev
                self.Cq[i] = self.Zq[i] - ew
            self.R[i] = math.sqrt(self.Aq[i]**2 + self.Bq[i]**2 +self. Cq[i]**2)
            self.pl_RA[i] = math.degrees(math.atan(self.Bq[i]/self.Aq[i]))
            if self.Aq[i] <= 0.0:
                self.pl_RA[i] = self.pl_RA[i] + 180
            self.pl_DC[i] = math.degrees(math.asin(self.Cq[i]/self.R[i]))
            if i == 2:
                continue
            mg = self.pmag[i] + 5*math.log10(self.pR[i]*self.R[i])
            self.dr[i] = magnitude(mg)
            
        self.plane_counter = 0            #惑星の地平座標を計算
        for i in range(8): 
            ad = yogen_AD(self.pl_RA[i],self.pl_DC[i])
            ad = saisa_hosei(ad)
            h = horizon(ad)
            if h[0] < 0.0 :
                continue
            self.ph[self.plane_counter] = h[0]
            self.pA[self.plane_counter] = h[1]
            self.pname[self.plane_counter] =self. pname[i]
            self.dr[self.plane_counter] = self.dr[i]
            self.pcolor[self.plane_counter] = self.pcolor[i]
            self.plane_counter += 1
        
        for i in range(self.plane_counter):
            self.xy= dispXY(self.ph[i],self.pA[i])
            self.xp[i] = self.xy[0]
            self.yp[i] = self.xy[1]


    def planet_display(self):
        #惑星の表示
        for i in range(self.plane_counter):
            if self.pname[i] == "Solar":
                c0.create_oval(self.xp[i]-6, self.yp[i]-6, self.xp[i]+6, self.yp[i]+6, fill = self.pcolor[i])
                c0.create_text(self.xp[i]-10,self.yp[i]-12,text = self.pname[i], fill = 'white')
            else:    
                self.dr[i] = self.dr[i]/2
                c0.create_oval(self.xp[i]-self.dr[i], self.yp[i]-self.dr[i], self.xp[i]+self.dr[i], self.yp[i]+self.dr[i], fill = self.pcolor[i])
                c0.create_text(self.xp[i]-10,self.yp[i]-8,text = self.pname[i], fill = 'white')
                c0.pack()
    def luna_display(self):    #月の位置計算と表示
        df = pd.read_csv('luna-element.csv',encoding='Shift_JIS')
        A = 0
        for i in range(64,68):
            A = A + df.iat[i,1] * math.sin(math.radians(df.iat[i,2] + df.iat[i,3]*T1))
        B = 0
        for i in range(48,53):
            B = B + df.iat[i,5] * math.sin(math.radians(df.iat[i,6] + df.iat[i,7]*T1))
        sigmaA = 0
        for i in range(0,62):
            sigmaA = sigmaA + df.iat[i,1] * math.sin(math.radians(df.iat[i,2]+df.iat[i,3]*T1))
        sigmaB = 0
        for i in range(0,46):
            sigmaB = sigmaB + df.iat[i,5] * math.sin(math.radians(df.iat[i,6]+df.iat[i,7]*T1))

        ramda = 218.3161 + 4812.67881 * T1 + 6.2887 * math.sin(math.radians(134.961  \
             + 4771.9886 * T1 + A)) +  sigmaA        
        beta = 5.1282 * math.sin(math.radians(93.273 + 4832.0202 * T1 + B)) + sigmaB
        ramda = 360*(ramda/360 - int(ramda/360))
        
        #黄道座標から赤道座標へ変換
        U = math.cos(math.radians(beta)) * math.cos(math.radians(ramda))
        V = math.cos(math.radians(beta)) * math.sin(math.radians(ramda))
        W = math.sin(math.radians(beta))
        c = 0.917436958
        s = 0.397881172
        xq = U
        yq = V*c - W*s
        zq = V*s + W*c
        r  = math.sqrt(xq*xq + yq*yq + zq*zq)
        luna_RA = math.degrees(math.atan(yq/xq))
        if xq <= 0.0:
            luna_RA = luna_RA + 180
        luna_DC = math.degrees(math.asin(zq/r))

        ad = yogen_AD(luna_RA,luna_DC)
        ad = saisa_hosei(ad)
        h = horizon(ad)
        if h[0] > 0.0 :
            xy= dispXY(h[0],h[1]) 
            c0.create_oval(xy[0]-6, xy[1]-6, xy[0]+6,xy[1]+6, fill ='pink')
            c0.create_text(xy[0]-8,xy[1]-12,text = "Moon", fill = 'white')
            
class Time:
    def __init__(self,Y,D):
        self.Ydate = Y
        self.Dtime = D
        self.F = 35
        self.MJD = 0
        self.ST = 0
        self.T0 = 0
        self.T1 = 0
    
    def Julian(self):  #(修正ユリウス日)の計算
        self.MJD = 0
        if self.Ydate != abs(self.Ydate):
            SP1 = -1
            self.Ydate = abs(self.Ydate)
        else:
            SP1 = 1
        YY = int(self.Ydate/10000)
        MD = int(self.Ydate-10000*YY)
        MM = int(MD/100)
        DD = MD - 100 * MM
        HH = int(self.Dtime/100)
        MS = self.Dtime-100*HH
        if SP1 < 0:
            YY = YY * SP1
        SP2 = YY + (MM-1)/12 + DD/365.25
        if MM <= 2 :
            MM = MM + 12
            YY = YY - 1
        if SP2 > 1582.78:  #グレゴリオ暦以降
            self.MJD = int(365.25*YY) + int(YY/400) - int(YY/100) + int(30.59*(MM-2)) - 678912
        elif YY < 0:
            self.MJD = int(365.25*YY) + int(30.59*(MM-2)) - 678915
        else:
            self.MJD = int(365.25*YY) + int(30.59*(MM-2)) - 678914
        self.MJD = self.MJD + DD
        self.MJD = self.MJD + HH/24 + MS/1440 - 0.375   #日本標準時で
        self.ST  = koseji(self.MJD)*15      # ST 恒星時(度で)
        self.T0  = self.MJD -  54799.625     # 元期2008年11月1日
        self.T1  = (self.MJD - 51544.5)/ 365.25     #月の略算引数用
        

def update(event):
    global F
    global ymd
    global ST
    global T0
    global T1
    global MJD
    Ydate = inputbox2.get()
    Ydate = int(Ydate)
    tm = Time(Ydate,2000)
    tm.Julian()
    MJD = tm.MJD
    ST  = tm.ST
    T0  = tm.T0
    T1  = tm.T1
    ymd = JDT(MJD)
    F = inputbox1.get()
    F = int(F)

    refresh_draw()
    p.star_culc()
    p.star_display()
    p.planet_culc()
    p.planet_display()
    p.luna_display()

def Timeforward():
    global ST
    global T0
    global T1
    ymd[3] = ymd[3] + 1
    ST = ST + 15
    T0 = T0 + (1/24)
    T1 = T1 + (1/24)/365.25

    refresh_draw()
    p.star_culc()
    p.star_display()
    p.planet_culc()
    p.planet_display()
    p.luna_display()
    
def Timeback():
    global ST
    global T0
    global T1
    ymd[3] = ymd[3] - 1
    ST = ST - 15
    T0 = T0 - (1/24)
    T1 = T1 - (1/24)/365.25

    refresh_draw()
    p.star_culc()
    p.star_display()
    p.planet_culc()
    p.planet_display()
    p.luna_display()
def Dateforward():
    global ST
    global T0
    global T1
    ymd[2] = ymd[2] + 1
    ST = ST + 1.002738
    T0 = T0 + 1
    T1 = T1 + 1/365.25

    refresh_draw()
    p.star_culc()
    p.star_display()
    p.planet_culc()
    p.planet_display()
    p.luna_display()
def Dateback():
    global ST
    global T0
    global T1
    ymd[2] = ymd[2] - 1
    ST = ST - 1.002738 
    T0 = T0 - 1
    T1 = T1 - 1/365.25

    refresh_draw()
    p.star_culc()
    p.star_display()
    p.planet_culc()
    p.planet_display()
    p.luna_display()
def refresh_draw():
    # 再表示
    
    c0.itemconfigure(id, fill = '#001766')
    lb3 = tk.Label(text=f"{ymd[0]}年 {ymd[1]}月 {ymd[2]}日  夜 {ymd[3] - 12} 時の星空   ", fg='white', \
                   bg="#001766", anchor='w', font=('', 14))
    lb3.place(x=30, y=25)
    lb4 = tk.Label(text=f"緯度= {F}°経度 139.74°(東京)", fg='white', bg="#001766", anchor \
        ='w', font=('', 14))
    lb4.place(x=30, y=60)
    c0.create_oval(185, 35, 1015, 865, fill='black', outline='skyblue', width=1)
    lb5 = tk.Label(text=f" 修正ユリウス日は = {round(MJD, 2)} 日  ", fg='white', bg="#001766", anchor \
        ='w', font=('', 10))
    lb5.place(x=30, y=750)
    lb6 = tk.Label(text=f" 恒星時は = {round(ST / 15, 1)}  時    ", fg='white', bg="#001766", anchor \
        ='w', font=('', 10))
    lb6.place(x=30, y=780)

    # ======  星座早見プログラム  ======

# Tkinterによる画面の設定

p = Planetarium()

root = tk.Tk()
c0 = tk.Canvas(root, width = 1200, height = 900,bg="#001766")
root.title(u"星座早見")

id = c0.create_oval(185, 35, 1015, 865, fill = 'black',outline = 'skyblue',width =1)
c0.pack
c0.create_text(600 ,20 ,text = "N",font = ('',18),fill ="yellow")
c0.create_text(600 ,880,text = "S",font = ('',18),fill ="yellow")
c0.create_text(170 ,450,text = "E",font = ('',18),fill ="yellow")
c0.create_text(1030,450,text = "W",font = ('',18),fill ="yellow")
c0.create_text(1055,720, text = "その日の時刻を1時間",font = ('',12),anchor = 'c',fill ="white")
c0.create_text(1055,785, text = "日付を1日",font = ('',12),anchor = 'c',fill='white')
c0.create_text(35, 820,text = "惑星位置の元期は2008年11月1日",font = ('',10),fill = 'white',anchor = 'w')
# 日時の計算
tm  = Time(20190101,2000)
tm.Julian()
MJD = tm.MJD
ST  = tm.ST
T0  = tm.T0
T1  = tm.T1
F   = tm.F  #Fは緯度
ymd = JDT(MJD)

refresh_draw()
p.star_culc()
p.star_display()
p.planet_culc()
p.planet_display()
p.luna_display()

lb1 = tk.Label(text= u"観測地の緯度(南緯は-)で",fg = 'white',bg = "#001766",anchor ='w',font = ('',14)).place(x=900,y=35)
inputbox1 = tk.Entry(width = 5,font = ('',14))
inputbox1.place(x=980,y=65)
inputbox1.insert(tk.END,"35")
inputbox1.bind("<KeyPress-Return>",update)
lb2 = tk.Label(text= "日付(YYYYMMDD)を入力してください",fg = 'white',bg = "#001766",anchor ='w',font = ('',14)).place(x=900,y=95)
inputbox2 = tk.Entry(width = 10,font = ('',14))
inputbox2.place(x=980,y=120)
inputbox2.insert(tk.END,"20190101")
inputbox2.bind("<KeyPress-Return>",update)
lb3 = tk.Label(text=u'Enterで夜8時を表示します',width=22,font = ('',12),fg='#001766',bg='skyblue').place(x=980 , y=165)
Button1 = tk.Button(text=u'進む>>',command = Timeforward,width=10,font = ('',10) ).place(x=1060 , y=740)
Button2 = tk.Button(text=u'<<もどる',command = Timeback,width=10,font = ('',10) ).place(x=960 , y=740)
Button3 = tk.Button(text=u'進む>',command = Dateforward,width=10 ,font = ('',10)).place(x=1060 , y=800)
Button4 = tk.Button(text=u'<もどる',command = Dateback,width=10 ,font = ('',10)).place(x=960 , y=800)
root.resizable(width=False, height=False)
root.mainloop()