← Index
Performance Profile   « block view • line view • sub view »
For /wise/base/deliv/dev/bin/framedepth
  Run on Fri May 28 15:23:26 2010
Reported on Fri May 28 15:26:27 2010

File/wise/base/deliv/dev/lib/perl/WISE/BandUtils.pm
Statements Executed20
Total Time0.000498 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
334.1e-51.4e-5use strict;
# spent 11µs making 1 call to strict::import
432.9e-59.7e-6use warnings;
# spent 18µs making 1 call to warnings::import
5
634.2e-51.4e-5use WISE::Env (cfglib=>'/wise/base/deliv/dev/lib/perl');
# spent 522µ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.9e-59.7e-6use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION);
# spent 63µs making 1 call to vars::import
13
1430.000330.00011use Exporter::Lite;
# spent 36µs making 1 call to Exporter::Lite::import
1511.0e-61.0e-6$VERSION = 1.00;
1611.2e-51.2e-5@ISA = ();
17
1811.0e-61.0e-6@EXPORT = ();
1911.0e-61.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
5611.6e-51.6e-51;