Astro::Misc(3pm)

πŸ“¦
version 0.78 Β· 2 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’« NAME πŸ’«

okay so bestie, pull up a chair β€” this is Astro::Misc (that's the Astro::Misc(3pm) page, from the User Contributed Perl Documentation crew ✨), and it's literally just Miscellaneous astronomical routines. A grab-bag. A little bag of astronomy snacks. No cap. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

Here's the vibe in code form:

use Astro::Misc;

$U = calc_U($flux, $dist, $freq);
($dist1, $dist2)= kindist($ra, $dec, $vel, $epoch, $model);

🌸 DESCRIPTION 🌸

Astro::Misc contains an assorted set Perl routines for doing various astronomical calculations. that's it, that's the whole description, she's lowkey humble 🫢


πŸ‘‘ AUTHOR πŸ‘‘

Chris Phillips β€” Chris.Phillips@csiro.au πŸ’Œ


πŸ¦‹ FUNCTIONS πŸ¦‹

read_possm

okay so read_possm interprets the output file from the AIPS POSSM task. the way that it can be called repeatably if there's more than one POSSM output in the file?? iconic. but listen β€” the file must be open before you call read_possm, using the FileHandle module. don't skip that step bestie, she will not open it for you πŸ’€

The data from the possm plot comes back in a hash. Some of the header values come back as scalar values while the actual plot values come back as references to arrays</> (yes, mixed types, we contain multitudes ✨).

The scalar values returned are:

  • SOURCE
  • DATE
  • TIME
  • BANDWIDTH
  • TYPE (that's ='A&P'||'R&I')

The array references are:

  • CHANNEL
  • VELOCITY
  • FREQUENCY
  • AMPLITUDE
  • PHASE
  • ANTENNA

The global variable $Astro::Misc:oldpossm (default=0) controls whether old or new style possm plots are read. For oldpossm=1, one of VELOCITY or FREQUENCY will be a reference to an empty list β€” but the hash value IS defined, okay?? don't come for her 🌈

Usage:

use FileHandle
my $fh = FileHandle->new();
my %ahash = ();
open($fh, 'possmfile');
read_possm($fh, %ahash);

Returns:

  • 0 on success (but not hit eof)
  • 1 on success (and hit eof)
  • 2 on premature eof

Examples of hash usage:

$hash{SOURCE}         # Source name
@{$hash{VELOCITY}}    # Array of velocity values
${$hash{PHASE}}[4]    # The fifth phase value

read_lovas

read_lovas reads the Lovas "Recommended Rest Frequencies for Observed Interstellar Molecular Microwave Transitions - 1991 Revision" (J. Phys. Chem. Ref. Data, 21, 181-272, 1992).

🚨 Alpha quality!! β€” she said it herself, this one's still cooking. proceed accordingly bestie πŸ™ˆ
my @lovas = read_lovas($fname);
my @lovas = read_lovas($fname, $minfreq, $maxfreq);

calc_U

$U = calc_U($flux, $dist, $freq);

Calculate U (Excitation Parameter) for an UCHII region. Based on Eqn 8 in Schraml and Mezger, 1969. periodt.

  • $flux β€” Integrated Source Flux Density (Jy)
  • $dist β€” Distance to source (kpc)
  • $freq β€” Frequency of observation (GHz)

Note:

Uses the global variable $Astro::Misc::Temp for electron temperature. Default is 10000K. 🌑️


calc_Nl

$Nl = calc_Nl($U);

Calculate the Lyman continuum photon flux given U, the Excitation Parameter for an UCHII region.

  • $U is the Excitation Parameter (from calc_U)

Ref: Kurtz 1994 ApJS 91 p659 Eq (1) (Original Origin unknown). iykyk 🧚


lum2spectral

$spectral_type = lum2spectral($luminosity);

Calculate the spectral type of a ZAMS star from its luminosity. Based on Thompson 1984 ApJ 283 165 Table 1.

  • $luminosity β€” Star luminosity (normalised to Lsun)

she's giving main character energy ⭐


Nl2spectral

$spectral = Nl2spectral($Nl);

Calculate the spectral type of a ZAMS star from its flux of Lyman Continuum Photons (Nl). Based on Panagia, 1973, ApJ, 78, 929.

  • $Nl β€” Flux of Lyman Continuum Photons

kindist

($dist1, $dist2)= kindist($ra, $dec, $vel, $epoch, $model);

Calculate the kinematic distance to an object. obsessed πŸ’œ

  • $dist1, $dist2 β€” Near/Far distance (kpc)
  • $ra β€” RA of object (turns)
  • $dec β€” Dec of object (turns)
  • $vel β€” LSR Velocity (km/s)
  • $epoch β€” Epoch of coords (J2000/J/B1950/B)
  • $model β€” Model to use (1 or 2)

Note:

  • Model 1 is based on Brand and Blitz, 1993, A&A, 275, 67-90.
  • Model 2 has unknown origin.
πŸ‘€ model 2 is a mystery girl. nobody knows where she came from. use at your own risk bestie πŸ’€

and that's the whole page, no notes πŸ’… this was perl v5.38.2, dated 2024-05-15 β€” thanks for coming to my TED talk, go calc something gorgeous πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from