leonboot/ra-dec-to-alt-az

本软件包最新版本(v0.1.1)没有可用的许可信息。

PHP 天球坐标转换为当前地球位置和时间的高度角和方位角

v0.1.1 2016-08-02 06:40 UTC

This package is not auto-updated.

Last update: 2024-09-14 19:47:47 UTC


README

此仓库是 Tom Gillespy 的 RA/Dec to Alt/Az 仓库的分支,其唯一目的是使类 composer 可安装。进行了一些代码重构,最重要的是将类放入其自己的命名空间。

此类将天球坐标、时间、纬度和经度转换为望远镜支架或相机的仰角和方位角。

##安装

composer install leonboot/ra-dec-to-alt-az

##使用

require 'vendor/autoload.php';

use Radec\Calculator as radec;

$radec = new radec(radec::decimaldegrees(latitude), radec::decimaldegrees(longditude));

$radec->setradec(radec::decimaldegrees(right_ascention), radec::decimaldegrees(declination));

$time = strtotime('now');

$azimuth = $radec->getAZ($time);
$altitude = $radec->getALT($time);

##其他功能

####Radec\Calculator::daysbeforeJ2000($timestamp)

这给出了 $timestamp 与 J2000 历元之间的天数。 维基百科文章

####Radec\Calculator::getdecimalUT($timestamp)

这给出了十进制形式的宇宙时间。所有计算都使用度、分、秒和时间的等效值(小时、分钟和秒)的十进制值进行。

####Radec\Calculator::fractionalday($timestamp)

这仅仅是把 UT 除以 24 来得到一天的小数部分。

####Radec\Calculator::getLST($timestamp)

这计算构造函数中设置的纬度和经度的本地恒星时。对于 J2000 前后 100 年的日期,时间的近似误差在 0.3 秒以内。

####Radec\Calculator::getHA($timestamp)

获取当前时角 - 观测者位置相对于天球的角度。

####Radec\Calculator::getALT($timestamp)

返回在指定位置和时间的特定目标的仰角。

####Radec\Calculator::getAZ($timestamp)

返回在指定位置和时间的特定目标的方位角。