Astro:...r::NDF(3pm)
π Astro::FITS::Header::NDF β¨
okay bestie, so this is a Perl manual page (section 3pm, user-contributed perl docs, iykyk) and it's literally all about manipulating FITS headers from NDF files. Yes it's a mouthful, we're doing it, stay with me π«Ά
π¦ NAME π¦
Astro::FITS::Header::NDF β Manipulate FITS headers from NDF files
β¨ SYNOPSIS β¨
use Astro::FITS::Header::NDF;
$hdr = new Astro::FITS::Header::NDF( Cards => \@cards );
$hdr = new Astro::FITS::Header::NDF( Items => \@items );
$hdr = new Astro::FITS::Header::NDF( ndfID => $indf );
$hdr = new Astro::FITS::Header::NDF( File => $file );
$hdr->writehdr( $indf );
$hdr->writehdr( File => $file );
like, that's the whole vibe in six lines π
πΈ DESCRIPTION πΈ
So this module uses the Starlink NDF module to read from and write to an NDF FITS extension, or to a .HEADER block inside an HDS container file. Ngl that's the whole gig.
Here's the tea tho: if the file turns out to be an HDS container with multiple NDFs sitting at the top level, then either the .HEADER NDF or the first NDF that actually contains a FITS header gets crowned the primary header π. Every other header? Subsidiary headers, indexed by the name of the NDF inside that container. Periodt.
It stores all the info about a FITS header block inside an object. You hand it a hash as an argument, and that hash can carry either:
- an array reference pointing at an array of FITS header cards,
- an array of
Astro::FITS::Header::Itemobjects, - a filename,
- or (plot twist) an NDF identifier.
π¨ Heads up bestie: currently, subheader support is readonly. Don't come for me, it's just how it is.
π METHODS π
configure
Reads a FITS header from an NDF. Simple as.
$hdr->configure( Cards => \@cards );
$hdr->configure( ndfID => $indf );
$hdr->configure( File => $filename );
It accepts an NDF identifier or a filename. And listen β if both the ndfID and File keys exist, ndfID wins. It takes priority, no discussion, main character energy fr fr.
If the file is actually an HDS container, it'll make an attempt to read a .HEADER NDF inside that container (which is, lowkey, the standard layout of UKIRT β and some JCMT β data files π).
If an extension is specified explicitly (and that extension is not .sdf), then that path gets treated as an explicit path to an NDF. And once an explicit path is specified? No attempt is made to go hunting for other NDFs in the HDS container. It said what it said π
.
Oh and also: if the NDF opens just fine but there's no .MORE.FITS extension, you get an empty header back rather than an error being thrown. Not a crash, just vibes.
writehdr
Write a FITS header to an NDF. The pen-to-paper moment βοΈ
$hdr->writehdr( ndfID => $indf );
$hdr->writehdr( File => $file );
Accepts an NDF identifier or a filename. And again β if both ndfID and File keys exist, ndfID key takes priority. Same rule, same energy.
π It throws an exception (croaks) on error. So wrap it or perish, bestie.
π NOTES π
This module requires the Starlink NDF module. That's the prerequisite, that's the requirement, that's it.
π₯ SEE ALSO π₯
NDFAstro::FITS::HeaderAstro::FITS::Header::ItemAstro::FITS::Header::CFITSIO
go read those next, the lore runs deep π
π AUTHORS π
- Tim Jenness
<t.jenness@jach.hawaii.edu> - Alasdair Allan
<aa@astro.ex.ac.uk> - Brad Cavanagh
<b.cavanagh@jach.hawaii.edu>
icons, all three of them π
π COPYRIGHT π
Copyright (C) 2008-2009 Science & Technology Facilities Council. Copyright (C) 2001-2005 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
π§ okay that's the whole page, mwah! this lil doc came to you courtesy of perl v5.36.0, dated 2023-04-21, filed under Astro:...r::NDF(3pm). 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