← Index
Performance Profile   « block view • line view • sub view »
For /wise/base/deliv/dev/bin/getfix
  Run on Thu May 20 15:30:03 2010
Reported on Thu May 20 16:25:46 2010

File/wise/base/deliv/dev/lib/perl/WISE/BandUtils.pm
Statements Executed20
Total Time0.000563 seconds

Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
00000WISE::BandUtils::BEGIN
00000WISE::BandUtils::bandfwhm
00000WISE::BandUtils::bandnum
00000WISE::BandUtils::bandpixsz
00000WISE::BandUtils::bandstr

LineStmts.Exclusive
Time
Avg.Code
1#! /usr/bin/env perl
2
338.4e-52.8e-5use strict;
# spent 24µs making 1 call to strict::import
434.0e-51.3e-5use warnings;
# spent 24µs making 1 call to warnings::import
5
634.2e-51.4e-5use WISE::Env (cfglib=>'/wise/base/deliv/dev/lib/perl');
# spent 535µs making 1 call to WISE::Env::import, max recursion depth 1
7
8# $Id: BandUtils.pm 5619 2009-08-21 20:30:50Z tim $
9
10package WISE::BandUtils;
11
1233.0e-51.0e-5use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION);
# spent 68µs making 1 call to vars::import
13
1430.000340.00011use Exporter::Lite;
# spent 72µs making 1 call to Exporter::Lite::import
1511.0e-51.0e-5$VERSION = 1.00;
1613.0e-63.0e-6@ISA = ();
17
1811.0e-61.0e-6@EXPORT = ();
1912.0e-62.0e-6@EXPORT_OK = qw(bandfwhm bandpixsz bandnum bandstr);
20
21sub bandfwhm {
22 my $band = bandnum(shift) or return;
23 return [6.0, 6.0, 6.46, 12.0]->[$band-1];
24}
25
26sub bandpixsz {
27 my $band = bandnum(shift) or return;
28 my $mapsz = shift || 46.9333333/60;
29 my $npix = shift || [ (1024) x 3, 512 ]->[$band-1];
30 my $pixsz = $mapsz/$npix*3600; # 2.75"
31 return wantarray ? ($pixsz,$npix) : $pixsz;
32}
33
34sub bandnum {
35 my $band = shift or return;
36 $band =~ s/^w//i;
37 $band =~ s/um|microns?$//i;
38 $band += 0 if $band =~ /^\s*[-+]\d+\s*$/;
39 $band = {qw/1 1
40 2 2
41 3 3
42 4 4
43 3.5 1
44 4.6 2
45 12 3
46 23 4
47 /}->{$band};
48 return $band;
49}
50
51sub bandstr {
52 my $band = bandnum(shift) or return;
53 return [qw/w1 w2 w3 w4/]->[$band-1];
54}
55
5618.0e-68.0e-61;