Astro:...r::NDF(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::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::Item objects,
  • 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 πŸ”₯

  • NDF
  • Astro::FITS::Header
  • Astro::FITS::Header::Item
  • Astro::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 (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 πŸ’–βœ¨