File | /wise/base/deliv/dev/lib/perl/WISE/BandUtils.pm | Statements Executed | 20 | Total Time | 0.000563 seconds |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine | |
---|---|---|---|---|---|---|
0 | 0 | 0 | 0 | 0 | WISE::BandUtils:: | BEGIN |
0 | 0 | 0 | 0 | 0 | WISE::BandUtils:: | bandfwhm |
0 | 0 | 0 | 0 | 0 | WISE::BandUtils:: | bandnum |
0 | 0 | 0 | 0 | 0 | WISE::BandUtils:: | bandpixsz |
0 | 0 | 0 | 0 | 0 | WISE::BandUtils:: | bandstr |
Line | Stmts. | Exclusive Time | Avg. | Code |
---|---|---|---|---|
1 | #! /usr/bin/env perl | |||
2 | ||||
3 | 3 | 8.4e-5 | 2.8e-5 | use strict; # spent 24µs making 1 call to strict::import |
4 | 3 | 4.0e-5 | 1.3e-5 | use warnings; # spent 24µs making 1 call to warnings::import |
5 | ||||
6 | 3 | 4.2e-5 | 1.4e-5 | use 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 | ||||
10 | package WISE::BandUtils; | |||
11 | ||||
12 | 3 | 3.0e-5 | 1.0e-5 | use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION); # spent 68µs making 1 call to vars::import |
13 | ||||
14 | 3 | 0.00034 | 0.00011 | use Exporter::Lite; # spent 72µs making 1 call to Exporter::Lite::import |
15 | 1 | 1.0e-5 | 1.0e-5 | $VERSION = 1.00; |
16 | 1 | 3.0e-6 | 3.0e-6 | @ISA = (); |
17 | ||||
18 | 1 | 1.0e-6 | 1.0e-6 | @EXPORT = (); |
19 | 1 | 2.0e-6 | 2.0e-6 | @EXPORT_OK = qw(bandfwhm bandpixsz bandnum bandstr); |
20 | ||||
21 | sub bandfwhm { | |||
22 | my $band = bandnum(shift) or return; | |||
23 | return [6.0, 6.0, 6.46, 12.0]->[$band-1]; | |||
24 | } | |||
25 | ||||
26 | sub 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 | ||||
34 | sub 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 | ||||
51 | sub bandstr { | |||
52 | my $band = bandnum(shift) or return; | |||
53 | return [qw/w1 w2 w3 w4/]->[$band-1]; | |||
54 | } | |||
55 | ||||
56 | 1 | 8.0e-6 | 8.0e-6 | 1; |