Astro::Flux - Class for handling astronomical flux quantities.
use Astro::Flux; $flux = new Astro::Flux( $quantity, $units, $waveband ); $quantity = $flux->quantity('mag');
Class for handling astronomical flux quantities. This class does not currently support conversions from one flux type to another (say, from magnitudes to Janskies) but may in the future.
Create a new instance of an Astro::Flux object.
Astro::Flux
$flux = new Astro::Flux( $quantity, $type, $waveband );
The first three parameters must be defined. They are:
quantity - numerical value for the flux, my be a primitive, or a C<Number::Uncertainty> object. type - type of flux. Can be any string. waveband - waveband for the given flux. Must be an C<Astro::WaveBand> object.
If any of the parameters are undefined, the constructor will throw an error. If the waveband parameter is not an Astro::WaveBand object, the constructor will throw an error.
Astro::WaveBand
The type is case-insensitive for lookups using the quantity method.
quantity
A fourth optional argument may be passed; this is a hash containing the following optional keys:
quality - an C<Misc::Quality> object denoting quality flags for the C<Astro::Flux> object. reference_waveband - an C<Astro::WaveBand> object denoting a reference waveband for the C<Astro::Flux> object. This is used for determining magnitudes when deriving them from C<Astro::FluxColor> objects. See C<Astro::Fluxes>. datetime - an C<DateTime> object which is the datetime of observation for the measurement in the C<Astro::Flux> object. obsid - An array reference to a list of observation identifiers. Can be used to identify the observation(s) from which this measurement was taken (e.g. from a filename).
Returns the quantity for a requested flux type.
my $mag = $flux->quantity('mag');
No conversions are done between types. What you put in via the constructor is all you can get out, so if you specify the type to be 'magnitude' and you ask for a 'mag', this method will throw an error.
The type is case-insensitive.
Returns the error in the quantity for a requested flux type.
my $mag = $flux->error('mag');
Errors are only returned if one was created with the object.
Returns the waveband for the given flux object.
my $waveband = $flux->waveband;
Returns an Astro::WaveBand object.
Returns the quality for the given flux object.
my $quality = $flux->quality;
Returns an Misc::Quality object if defined. If not, returns undef.
Misc::Quality
Returns the reference waveband for the given flux object.
my $ref_waveband = $flux->reference_waveband;
Returns an Astro::WaveBand object if defined. If not, returns undef.
Sets or returns the datetime stamp for the given flux object.
my $datetime = $flux->datetime; $flux->datetime( new DateTime );
Returns an Date::datetime object if defined. If not, returns undef.
Date::datetime
Sets or returns the observation ID for the given flux object.
my $obsid = $flux->obsid; $flux->obsid( $obsid );
Returns an array reference if defined. If not, returns undef.
Returns the type of flux measurement stored.
my $type = $flux->type;
Cannot be used to set the type.
$Id: Flux.pm,v 1.14 2005/06/24 21:02:11 bradc Exp $
Brad Cavanagh <b.cavanagh@jach.hawaii.edu>, Alasdair Allan <aa@astro.ex.ac.uk>
Copyright (C) 2004 - 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 same terms as Perl itself.
To install Astro::Flux, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Astro::Flux
CPAN shell
perl -MCPAN -e shell install Astro::Flux
For more information on module installation, please visit the detailed CPAN module installation guide.