Astro:...FITSIO(3pm)
π 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::HeaderAstro::FITS::Header::ItemAstro::FITS::Header::NDFAstro::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 πΈ
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. β¨ππ¦
π¦ where this page comes from
- debian bookworm: libastro-fits-header-perl 3.09-1 Β· GPL-3.0-or-later
- debian trixie: libastro-fits-header-perl 3.09-1 Β· GPL-3.0-or-later
- ubuntu noble: libastro-fits-header-perl 3.09-1 Β· GPL-3.0-or-later
- ubuntu resolute: libastro-fits-header-perl 3.09-1 Β· GPL-3.0-or-later
- ubuntu stonking: libastro-fits-header-perl 3.09-1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms