Astro::Fluxes - Class for handling a collection of astronomical flux quantities.
use Astro::Fluxes; $fluxes = new Astro::Fluxes( $flux1, $flux2, $color1 ); my $flux = $fluxes->flux( waveband => $waveband );
Class for handling a collection of astronomical flux quantities.
Create a new instance of an Astro::Fluxes object.
Astro::Fluxes
$fluxes = new Astro::Fluxes( $flux1, $flux2, $color1 );
Any number of Astro::Flux or Astro::FluxColor objects can be passed as arguments.
Astro::Flux
Astro::FluxColor
Returns the flux for a requested waveband.
my $flux = $fluxes->flux( waveband => 'J' );
Arguments are passed as key-value pairs. The sole mandatory named argument is 'waveband'; its value can either be an Astro::WaveBand object or a string that can be used to create a new Astro::WaveBand via its Filter parameter.
Astro::WaveBand
Optional arguments are:
derived - Whether or not to return fluxes that have been derived from colors. Defaults to false, so that derived fluxes will not be returned. datetime - whether we should return a flux from a specified object, should be passed as a C<DateTime> object. type - which type of flux to return. If this is not given this method will default to 'mag'. If you supply a type that is not 'mag' or 'magnitudes' and are attempting to return a derived flux, this method will return undef.
This method returns an Astro::Flux object.
Returns the color for two requested wavebands.
my $color = $fluxes->color( upper => new Astro::WaveBand( Filter => 'H' ), lower => new Astro::WaveBand( Filter => 'J' ) );
my $color = $fluxes->color( upper => new Astro::WaveBand( Filter => 'H' ), lower => new Astro::WaveBand( Filter => 'J' ), datetime => new DateTime );
Arguments are passed as key-value pairs. The two mandatory named arguments are 'upper' and 'lower', denoting the upper (longer wavelength) and lower (shorter wavelength) wavebands for the color. The value for either can be either an Astro::WaveBand object or a string that can be used to create a new Astro::WaveBand object via its Filter parameter.
The above example will return the first H-K color in the Fluxes object. The optional datetime arguement allows you to return a colour at a specific datetime stamp.
Push Astro::Flux and Astro::FluxColor object into the Astro::Fluxes object,
$fluxes->pushfluxes( $flux1, $flux2, $color1 );
Returns an array of all the Astro::Flux objects contained in the Astro::Fluxes object,
@fluxes_not_dervied = $fluxes->allfluxes(); @fluxes_including_dervied = $fluxes->allfluxes( 'derived' );
by default this will not return the derived fluxes, however the method takes an optional arguement of 'derived', in which case it will do.
Returns an hash of all the Astro::Flux objects contained in the Astro::Fluxes object,
@fluxes = $fluxes->fluxesbywaveband( waveband => 'J' );
Returns an array of the original (not derived) colors contained in the object
@colors = $fluxes->original_colors( );
Returns an array of the original (not derived) filters contained in the object
@wavebands = $fluxes->original_wavebands( ); @filters = $fluxes->original_wavebands( 'filters' );
optional arguement 'filters' returns an actual filter list rather than a list of Astro::WaveBand objects.
Merges another Astro::Fluxes object with this object
$fluxes1->merge( $fluxes2 );
Applies a datestamp to all Astro::Flux object with this object
$fluxes->datestamp( new DateTime );
$Id: Fluxes.pm,v 1.19 2005/11/15 23:50:32 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.