Astro::Misc(3pm)
π« 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:
SOURCEDATETIMEBANDWIDTHTYPE(that's='A&P'||'R&I')
The array references are:
CHANNELVELOCITYFREQUENCYAMPLITUDEPHASEANTENNA
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:
0on success (but not hit eof)1on success (and hit eof)2on 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.
$Uis the Excitation Parameter (fromcalc_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
- debian trixie: libastro-perl 0.78-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libastro-perl 0.78-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libastro-perl 0.78-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms