人生的意义就是思考其意义分享 http://blog.sciencenet.cn/u/qianlivan 天体物理工作者,家乡云南昆明。

博文

Commissioning tools

已有 3127 次阅读 2015-12-23 14:38 |个人分类:存档|系统分类:科研笔记| telescope, commissioning


tablecube.pro

table_cube.pro.txt


radec2azel.py

radec2azel.py.txt


azel2radec.py

azel2radec.py.txt


j2000tojnow.py

j2000tojnow.py.txt


rise_set.py

rise_set.py.txt



=========================================================================

#radec2azel.py

import ephem

import numpy as np

import time

import sys


if (len(sys.argv)<3):

 print 'too few input parameters, format:'

 print 'python radec2azel ra dec'

 print 'example:'

 print 'python radec2azel 20.0 20.0'

 sys.exit()




convert=np.pi/180.0


class coordinate:

     def __init__(place):

         place.name=''

         place.ra=''

         place.dec=''


Dawodang=coordinate()

Dawodang.name='Dawodang'

Dawodang.ra='106.856594'

Dawodang.dec='25.652939'


def ectolocal(ra,dec):

   global convert

   getlocal = ephem.Observer()

   getlocal.long, getlocal.lat = Dawodang.ra,Dawodang.dec # at Dawodang

   ct = time.gmtime()

   ct3 = time.strftime("%Y/%m/%d %H:%M:%S",ct)

   getlocal.date = ct3 # UT

   body = ephem.FixedBody()

   body._ra = ra

   body._dec = dec

   body._epoch = ephem.J2000

   body.compute(getlocal)

   x= float(body.az)*180/np.pi

   y= float(body.alt)*180/np.pi

   return x,y


#ra0=float(sys.argv[1])*convert

#dec0=float(sys.argv[2])*convert

ra0=ephem.degrees(ephem.hours(sys.argv[1]))

dec0=ephem.degrees(sys.argv[2])

print ra0,dec0

az,el=ectolocal(ra0,dec0)

print az,el

=========================================================================


=========================================================================

#azel2radec.py

import ephem

import numpy as np

import time

import sys


if (len(sys.argv)<3):

 print 'too few input parameters, format:'

 print 'python azel2radec az el'

 print 'example:'

 print 'python azel2radec 20.0 20.0'

 sys.exit()




convert=np.pi/180.0


class coordinate:

     def __init__(place):

         place.name=''

         place.ra=''

         place.dec=''

         place.alt=''


Dawodang=coordinate()

Dawodang.name='Dawodang'

Dawodang.ra='106.856594'

Dawodang.dec='25.652939'

Dawodang.alt='1138.72178'


def localtoec(az,el):

   global convert

   getlocal = ephem.Observer()

   getlocal.long, getlocal.lat = Dawodang.ra,Dawodang.dec # at Dawodang

   getlocal.pressure = 0

   getlocal.epoch = ephem.J2000

   ct = time.gmtime()

   ct3 = time.strftime("%Y/%m/%d %H:%M:%S",ct)

   getlocal.date = ct3 # UT

   ra,dec = getlocal.radec_of(az,el)

   return ra,dec



az0 = float(sys.argv[1])*convert

el0 = float(sys.argv[2])*convert


ra,dec=localtoec(az0,el0)

print ra,dec

#print float(ra)/convert,float(dec)/convert

print ephem.degrees(ra)/convert,ephem.degrees(dec)/convert

=========================================================================


=========================================================================

#j2000tojnow.py

import ephem

import numpy as np

import time

import sys


if(len(sys.argv)<3):

 print 'too few input parameters, format:'

 print 'python j2000tojnow ra dec'

 print 'example:'

 print 'python j2000tojnow 20.0 20.0'

 sys.exit()


convert=np.pi/180.0



ra0=ephem.degrees(ephem.hours(sys.argv[1]))

dec0=ephem.degrees(sys.argv[2])


star = ephem.FixedBody()

star._ra = ra0

star._dec = dec0

star._epoch = '2000'

star.compute(epoch=ephem.now())

print star.ra,star.dec

print ephem.degrees(star.ra)/convert,ephem.degrees(star.dec)/convert

=========================================================================


=========================================================================

# rise_set.py

import ephem

import numpy as np

import time

import sys


if (len(sys.argv)<3):

 print 'too few input parameters, format:'

 print 'python rise_set ra dec'

 print 'example:'

 print 'python rise_set 20.0 20.0'

 sys.exit()


convert=np.pi/180.0


Dawodang=ephem.Observer()

Dawodang.lat='25.652939'

Dawodang.lon='106.856594'


body = ephem.FixedBody()


ra0=ephem.hours(sys.argv[1])

dec0=ephem.degrees(sys.argv[2])

body._ra=ra0

body._dec=dec0


trise=Dawodang.previous_rising(body)

print 'previous rise'

print body.alt,body.az,trise

ttrans=Dawodang.next_transit(body)

print 'next transit'

print body.alt,body.az,ttrans

tset=Dawodang.next_setting(body)

print 'next setting'

print body.alt,body.az,tset

=========================================================================

20160813.zip

pyfast.zip

testgetvelo_Ngaussian.zip




https://blog.sciencenet.cn/blog-117333-945360.html

上一篇:轻量矢量图工具
下一篇:发布python脚本的土办法
收藏 IP: 159.226.171.*| 热度|

0

该博文允许实名用户评论 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-24 11:22

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部