← Index
Performance Profile   « block view • line view • sub view »
For /wise/base/deliv/dev/bin/wdate
  Run on Fri Jun 4 15:13:22 2010
Reported on Fri Jun 4 15:14:17 2010

File/wise/base/deliv/dev/lib/perl/WISE/BandUtils.pm
Statements Executed20
Total Time0.000462 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
333.2e-51.1e-5use strict;
# spent 10µs making 1 call to strict::import
433.1e-51.0e-5use warnings;
# spent 38µs making 1 call to warnings::import
5
634.5e-51.5e-5use WISE::Env (cfglib=>'/wise/base/deliv/dev/lib/perl');
# spent 528µ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
1232.8e-59.3e-6use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION);
# spent 61µs making 1 call to vars::import
13
1430.000310.00010use Exporter::Lite;
# spent 33µs making 1 call to Exporter::Lite::import
1511.0e-61.0e-6$VERSION = 1.00;
1612.0e-62.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
5617.0e-67.0e-61;