5

我写了这个程序:

#!/usr/bin/perl 

use Astro::Nova qw(get_solar_equ_coords get_lunar_equ_coords get_hrz_from_equ 
                   get_solar_rst_horizon get_timet_from_julian 
                   get_julian_from_timet get_lunar_rst get_lunar_phase); 

$observer = Astro::Nova::LnLatPosn->new("lng"=>0,"lat"=>89.5); 

for $i (2456623..2456624) { 
  print "DAY: $i\n"; 
  ($status,$rst) = get_lunar_rst($i, $observer); 
  print "STATUS: $status\n"; 

  $rst->get_transit(); 

  $rise = $rst->get_rise(); 
  print "RISE: $rise\n"; 
  $set = $rst->get_set(); 
  print "SET: $set\n\n"; 
} 

并得到了这些结果:

DAY: 2456623 
STATUS: 1 
RISE: 5.5664193588601e-309 
SET: 1.55254159695923e-267 

DAY: 2456624 
STATUS: -1 
RISE: 1.9634470382202e-153 
SET: 2.26294632209635e+137 

换句话说,月亮从极地(总是向上)到地平线以下,而实际上并没有升起或落下。

我意识到 89.5 度是一种极端情况,但为什么这段代码不能工作呢?

作为注释http://aa.usno.navy.mil/data/docs/RS_OneYear.php显示在此间隔内有一个月落(JD 2456623 = 2013-11-26 12:00:00):

在此处输入图像描述

另一个奇怪的地方:如果我注释掉“$rst->get_transit();” 行,我得到以下结果:

DAY: 2456623 
STATUS: 1 
RISE: 5.5664193588601e-309 
SET: 1.14372958360957e-268 

DAY: 2456624 
STATUS: -1 
RISE: 6.80740365931403e+199 
SET: 4.81766816905579e+151 

上升/设置仍然很奇怪(这很好,因为状态是-1),但它们是不同的。我一直认为 get_lunar_rst() 返回一个固定的结构,但显然不是?检查运输时间的行为改变了结构?

编辑:好的,我运行了两次程序,根本没有改变它并得到:

DAY: 2456623
STATUS: 1
RISE: 5.5664193588601e-309
SET: 2.99352717623831e-264

DAY: 2456624
STATUS: -1
RISE: 1.9634470382202e-153
SET: 2.26294632209635e+137

DAY: 2456623
STATUS: 1
RISE: 5.5664193588601e-309
SET: 3.04770606791278e-262

DAY: 2456624
STATUS: -1
RISE: 1.9634470382202e-153
SET: 2.26294632209635e+137

换句话说,2456623 集无缘无故地发生了变化。

4

1 回答 1

1

I've contacted the authors of libnova, who have confirmed this is a bug and are working to correct it.

libnova incorrectly assumes bodies are circumpolar if they are above the horizon when due north. This is untrue: https://astronomy.stackexchange.com/q/963

I've written a fix which doesn't assume this, but may still be inaccurate if a body's declination is non-unimodal: https://astronomy.stackexchange.com/questions/962/is-lunar-elevation-at-a-given-location-for-a-given-day-unimodal

于 2013-11-25T19:25:15.617 回答