Astro-WaveBand

 view release on metacpan or  search on metacpan

lib/Astro/WaveBand.pm  view on Meta::CPAN

        "K98" => 2.20,
        "Kshort" => 2.159,
        "Klong" => 2.227,
        "2.122S(1)" => 2.121,
        "2.122MK" => 2.127,
        "2.248S(1)" => 2.248,
        "2.248MK" => 2.263,
        "BrG" => 2.166,
        "2.27" => 2.274,
        "2.32CO" => 2.324,  # old
        "2.42CO" => 2.425,
        "3.05ice" => 3.048,
        "Dust" => 3.278,
        "3.30PAH" => 3.286,
        "3.4nbL" => 3.415,
        "3.5mbL" => 3.489,
        "3.6nbLp" => 3.593,
        "3.99" => 3.990,
        "BrA" => 4.053,
        "Lp98" => 3.77,
        "Mp98" => 4.69,
    },
    MICHELLE => {
        "F105B53" => 10.5,
        "F79B10" => 7.9,
        "F88B10" => 8.8,
        "F97B10" => 9.7,
        "F103B10" => 10.3,
        "F116B9" => 11.6,
        "F125B9" => 12.5,
        "F107B4" => 10.7,
        "F122B3" => 12.2,
        "F128B2" => 12.8,
        "F209B42" => 20.9,
        "F185B9" => 18.5,
        "NBlock" => 10.6,
        "QBlock" => 20.9,
        "F22B15" => 2.2,
        "F34B9" => 3.4,
        "F47B5" => 4.7,
    },
    SCUBA => {
        "850W" => 863,
        "450W" => 443,
        "450N" => 442,
        "850N" => 862,
        "750N" => 741,
        "350N" => 344,
        "P2000" => 2000,
        "P1350" => 1350,
        "P1100" => 1100,
        # This is a kluge until the class can
        # be extended to support multiple wavelength
        # instruments.
        "850S:PHOT" => 1100,
        "450W:850W" => 443,
        "450N:850N" => 442,
        "350N:750N" => 344,
    },
    'SCUBA-2' => {
        850 => 863,    # guesses
        450 => 445,
    },
);

# Instruments that have natural units
my %NATURAL = (
    WFCAM => 'filter',
    CGS4 => 'wavelength',
    SCUBA => 'filter',
    'SCUBA-2' => 'filter',
    UFTI => 'filter',
    IRCAM => 'filter',
    MICHELLE => 'filter',
    ACSIS => 'frequency',
    DAS => 'frequency',
    RXA3 => 'frequency',
    RXA3M => 'frequency',
    RXB3 => 'frequency',
    RXW => 'frequency',
    RXWB => 'frequency',
    RXWC => 'frequency',
    RXWD => 'frequency',
    RXWD2 => 'frequency',
    RXH3 => 'frequency',
    HARP => 'frequency',
    ALAIHI => 'frequency',
    UU => 'frequency',
    AWEOWEO => 'frequency',
    KUNTUR => 'frequency',
    UIST => 'filter',
);

# Unit prefixes, in descending size order.
my @PREFIXES = (
    [Q => 30],
    [R => 27],
    [Y => 24],
    [Z => 21],
    [E => 18],
    [P => 15],
    [T => 12],
    [G => 9],
    [M => 6],
    [k => 3],
    ['' => 0],
    [m => -3],
    [mu => -6],
    [n => -9],
    [p => -12],
    [f => -15],
    [a => -18],
    [z => -21],
    [y => -24],
    [r => -27],
    [q => -30],
);

=head1 METHODS

=head2 Constructor

lib/Astro/WaveBand.pm  view on Meta::CPAN

    }
    else {
        # Read value from the cache
        my $value = $self->_read_value_with_convert("wavenumber");
        return $self->_format_fixed_unit($value, '/cm', $opt{'ndp'} // 3) if $opt{'format'};
        return $value;
    }

    return;
}

=item B<filter>

Set or retrieve filter name.

Returns C<undef> if the filter can not be determined. If the filter
name can not be translated to a wavelength it will not be possible
to do any conversions to other forms.

=cut

sub filter {
    my $self = shift;
    my %opt = %{@_ && 'HASH' eq ref $_[0] ? shift : {}};

    if (@_) {
        my $value = shift;

        # store value and wavelength in cache
        $self->_cache_value_and_wav('filter', $value);
    }
    else {
        # Read value from the cache
        return $self->_read_value_with_convert("filter");
    }

    return;
}

=item B<instrument>

Name of associated instrument.

    $inst = $w->instrument;
    $w->instrument('SCUBA');

Used to aid in the choice of natural unit.

=cut

sub instrument {
    my $self = shift;
    if (@_) {$self->{Instrument} = uc(shift);}
    return $self->{Instrument};
}

=item B<natural_unit>

Override the natural unit to be used for stringification. If this
value is not set the class will determine the unit of choice by
looking at the instrument name and then by taking an informed guess.

    $w->natural_unit('filter');

=cut

sub natural_unit {
    my $self = shift;
    if (@_) {$self->{NaturalUnit} = shift;}
    return $self->{NaturalUnit};
}

=item B<species>

Name of species involved in an emission line.

=cut

sub species {
    my $self = shift;
    if (@_) {$self->{'Species'} = shift;}
    return $self->{'Species'};
}

=item B<transition>

Transition giving rise to line emission.

=cut

sub transition {
    my $self = shift;
    if (@_) {$self->{'Transition'} = shift;}
    return $self->{'Transition'};
}

=back

=head2 General Methods

=over 4

=item B<waveband>

Return the name of the waveband associated with the object.

Returns C<undef> if none can be determined.

    $band = $w->waveband;

=cut

sub waveband {
    my $self = shift;

    my $lambda = $self->wavelength;
    return undef unless defined $lambda;

    my $band;
    if ($lambda >= 10000) {    # > 1cm
        $band = 'radio';



( run in 4.921 seconds using v1.01-cache-2.11-cpan-75ffa21a3d4 )