牧夫天文网

 找回密码
 加入牧夫(请注明天文爱好者,否则无法通过审核)

QQ登录

只需一步,快速开始

[DIY咨询] 关于RADEC-ALTAZ的算法

  [复制链接]
马铃鼠 发表于 2015-3-4 17:35 | 显示全部楼层 |阅读模式 来自: 河北省秦皇岛市 联通

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?加入牧夫(请注明天文爱好者,否则无法通过审核)

x
本帖最后由 马铃鼠 于 2015-3-4 17:43 编辑

关于赤道坐标系和地平坐标系的转换问题,查了很多资料,在《天文爱好者手册》和《天文学手册》中都只有类似的时角坐标和地平坐标转换的计算公式,在这个网站(http://www.stargazing.net/kepler/altaz.html)中有具体的算法,但是没怎么看懂。。。

偶然间发现了这里,貌似是NASA的很高大上的东西:The IDL Astronomy User's Library
捕获.JPG
http://idlastro.gsfc.nasa.gov/contents.html
http://rpackages.ianhowson.com/cran/astrolibR/man/altaz2hadec.html


这里的源码算法涉及了天文中很多方面的问题,其中有HADEC2ALTAZ Convert Hour Angle and Declination to Horizon (alt-az) coordinates(http://idlastro.gsfc.nasa.gov/ftp/pro/astro/hadec2altaz.pro
虽然还不是我做需要的,但还毕竟是现成的算法,这里的代码看着像是VB,但好像又不是,貌似是什么IDL语言,总之是都没学过的。。。

在此特地复制粘贴过来,求大神指教


  • PRO hadec2altaz, ha, dec, lat, alt, az, WS=WS
  • ;+
  • ;  NAME:
  • ;     HADEC2ALTAZ
  • ;  PURPOSE:
  • ;      Converts Hour Angle and Declination to Horizon (alt-az) coordinates.
  • ;  EXPLANATION:
  • ;      Can deal with NCP/SCP singularity.    Intended mainly to be used by
  • ;      program EQ2HOR
  • ;
  • ; CALLING SEQUENCE:
  • ;      HADEC2ALTAZ, ha, dec, lat ,alt ,az [ /WS ]
  • ;
  • ; INPUTS
  • ;     ha -  the local apparent hour angle, in DEGREES, scalar or vector
  • ;     dec -  the local apparent declination, in DEGREES, scalar or vector
  • ;     lat -  the local latitude, in DEGREES, scalar or vector
  • ;
  • ; OUTPUTS
  • ;     alt - the local apparent altitude, in DEGREES.
  • ;     az  - the local apparent azimuth, in DEGREES, all results in double
  • ;           precision
  • ; OPTIONAL KEYWORD INPUT:
  • ;      /WS - Set this keyword for the output azimuth to be measured West from
  • ;            South.    The default is to measure azimuth East from North.
  • ;
  • ; EXAMPLE:
  • ;     What were the apparent altitude and azimuth of the sun when it transited
  • ;     the local meridian at Pine Bluff Observatory (Lat=+43.07833 degrees) on
  • ;     April 21, 2002?   An object transits the local meridian at 0 hour angle.
  • ;     Assume this will happen at roughly 1 PM local time (18:00 UTC).
  • ;
  • ;     IDL> jdcnv, 2002, 4, 21, 18., jd  ; get rough Julian date to determine
  • ;                                       ;Sun ra, dec.
  • ;     IDL> sunpos, jd, ra, dec
  • ;     IDL> hadec2altaz, 0., dec, 43.078333, alt, az
  • ;
  • ;       ===> Altitude alt = 58.90
  • ;            Azimuth  az = 180.0
  • ; REVISION HISTORY:
  • ;      Written  Chris O'Dell Univ. of Wisconsin-Madison May 2002
  • ;-
  • if N_params() LT 4 then begin
  •      print,'Syntax - HADEC2ALTAZ, ha, dec, lat ,alt ,az [ /WS ]'
  •      return
  • endif
  • d2r = !dpi/180.
  • sh = sin(ha*d2r) & ch = cos(ha*d2r)
  • sd = sin(dec*d2r) & cd = cos(dec*d2r)
  • sl = sin(lat*d2r) & cl = cos(lat*d2r)
  • x = - ch * cd * sl + sd * cl
  • y = - sh * cd
  • z = ch * cd * cl + sd * sl
  • r = sqrt(x^2 + y^2)
  • ; now get Alt, Az
  • az = atan(y,x) /d2r
  • alt = atan(z,r) / d2r
  • ; correct for negative AZ
  • w = where(az LT 0)
  • if w[0] ne -1 then az[w] = az[w] + 360.
  • ; convert AZ to West from South, if desired
  • if keyword_set(WS) then az = (az + 180.) mod 360.
  • END
 楼主| 马铃鼠 发表于 2015-3-4 21:11 | 显示全部楼层 来自: 河北省秦皇岛市 联通
额,貌似找到了。。。
来源也挺高大上。。。美国海军天文台什么的。。。
http://www.slac.stanford.edu/grp/eg/minos/dist/minossoft/releases/development/AstroUtil/

捕获75622.JPG 捕获2323442.JPG




回复 支持 反对

使用道具 举报

kwdx2 发表于 2015-3-17 12:16 | 显示全部楼层 来自: 北京市 北京理工大学
是verilog 硬件描述语言。在FPGA之类的运行的。看着挺简单的,就是几个数据的换算,应该都能看懂。具体变量代表的含义上面也都写着的啊
回复 支持 反对

使用道具 举报

sun0083 发表于 2015-3-22 18:22 | 显示全部楼层 来自: 浙江省杭州市 电信
可以通过方位-仰角转换到时角-赤纬,然后再依据恒星时转换到赤经赤纬两步走的办法。算法可以参考天球坐标系统 http://zh.wikipedia.org/wiki/天球坐标系统 天球坐标转换

点评

嗯,就是这么个思路,维基的相关算法是错误的,还被我修正过。。。。。。  发表于 2015-3-22 23:21
回复 支持 反对

使用道具 举报

本版积分规则

快速回复 返回顶部 返回列表