cafuego/phits

一个类库,允许您在PHP中访问FITS文件头。

0.0.4 2014-06-08 03:53 UTC

This package is not auto-updated.

Last update: 2024-09-28 15:57:08 UTC


README

Build Status

欢迎

phits - PHP的FITS读取器

FITS是NASA和国际天文学联合会(IAU)共同认可的标准化天文数据格式。

此类可以读取和解析FITS文件的头数据。目前我并没有计划添加读取和处理附加数据的 capability。

FitsThumbnail类使用Imagick PECL库将FITS图像数据转换为指定大小和格式的缩略图。如果没有安装Imagick,它将完全失败。

用法

<?php
  use Phits\Fits\FitsParser;

  $fits = new FitsParser('/tmp/foobar.fits');

  $headers = $fits->getHeaders();
  $naxis   = $fits->getNaxis(0);

  // Do stuff.
?>

<?php
  use Phits\Fits\FitsThumbnail;

  $thumb = new FitsThumbnail('/tmp/foobar.fits');

  // Delete the generated thumbnail when PHP exits.
  $thumb->persist(FALSE);

  // Create a 200x200 thumbnail.
  $thumb->createThumbnail(200, 200);

  // Get the generated thumbail file.
  $thumbnail = $thumb->getThumbnail();

  // Do stuff.
?>

致谢

该项目基于现有的开源FITS库,我使用了它们来帮助我编写这个解析器。

Phits从这些其他项目中继承了MIT许可。

与Go解析器不同,Phits还可以处理较长的字符串注释的CONTINUE头。

FITS?

有关更多信息,请参阅 http://heasarc.nasa.gov/docs/heasarc/fits.html