Astro:...FITSIO(3pm)

πŸ“¦
version 3.09 Β· 2 versions
  • 3.09 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 3.08 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Astro::FITS::Header::CFITSIO πŸ’–

okay bestie, gather round, because this is Astro::FITS::Header::CFITSIO β€” the Perl module that manipulates FITS headers from a FITS file. it's part of the User Contributed Perl Documentation situation, and it's genuinely iconic. no cap. πŸ¦‹


✨ SYNOPSIS ✨

like, here's the whole vibe in one look:

use Astro::FITS::Header::CFITSIO;

$header = new Astro::FITS::Header::CFITSIO( Cards => \@array );
$header = new Astro::FITS::Header::CFITSIO( File => $file );
$header = new Astro::FITS::Header::CFITSIO( fitsID => $ifits );

$header->writehdr( File => $file );
$header->writehdr( fitsID => $ifits );

🌸 DESCRIPTION 🌸

so this module uses the CFITSIO module to read and write directly to a FITS HDU. direct. no middleman. main character energy fr fr. πŸ’…

it keeps all the info about a FITS header block inside an object. you hand it a hash as an argument, and that hash can hold either an array reference pointing at an array of FITS header cards, or a filename, or (alternatively) an FITS identifier. pick your fighter bestie, they all work. ✨


πŸŽ€ REVISION πŸŽ€

$Id$

πŸ’… METHODS πŸ’…

configure

reads a FITS header from a FITS HDU. yes, that's literally what it does, and it does it beautifully.

$header->configure( Cards => \@cards );
$header->configure( fitsID => $ifits );
$header->configure( File => $file );
$header->configure( File => $file, ReadOnly => $bool );

it accepts an FITS identifier or a filename. and listen β€” if both the fitsID and File keys exist, then fitsID wins. it takes priority, periodt. πŸ‘‘

if you specify File, the file is normally opened in ReadWrite mode. but the ReadOnly argument takes a boolean value, and that boolean decides whether the file gets opened ReadOnly instead. your call, bestie. 🫢

writehdr

writes a FITS header to a FITS file. the moment of truth honestly.

$header->writehdr( File => $file );
$header->writehdr( fitsID => $ifits );

it accepts a FITS identifier or a filename. and again β€” if both the fitsID and File keys exist, fitsID takes priority. same rule, same queen behavior. πŸ’…

⚠️ heads up bestie: this one throws an exception (croaks) on error. so wrap it or be ready for the drama. 😭

πŸ¦‹ NOTES πŸ¦‹

this module requires Pete Ratzlaff's Astro::FITS::CFITSIO module, and William Pence's cfitsio subroutine library (v2.1 or greater). so like, you gotta have the prerequisites or it's not gonna go. 🌈


⭐ SEE ALSO ⭐

  • Astro::FITS::Header
  • Astro::FITS::Header::Item
  • Astro::FITS::Header::NDF
  • Astro::FITS::CFITSIO

go read those too, iykyk. πŸ’œ


πŸ‘‘ AUTHORS πŸ‘‘

  • Alasdair Allan <aa@astro.ex.ac.uk>
  • Jim Lewis <jrl@ast.cam.ac.uk>
  • Diab Jerius

absolute legends, all three of them. 🫢


Copyright (C) 2007-2009 Science & Technology Facilities Council. Copyright (C) 2001-2006 Particle Physics and Astronomy Research Council. All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place,Suite 330, Boston, MA 02111-1307, USA

no warranty bestie β€” i'm just the messenger, the license said it first. πŸ’€

and that's the whole page, babes. this one shipped as perl v5.36.0, dated 2023-04-21, under the same Astro::FITS::Header::CFITSIO(3pm) banner we started with. slay, go write some headers. βœ¨πŸ’–πŸ¦‹