← 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:31 2010

File/wise/base/deliv/dev/lib/perl/x86_64-linux-thread-multi/WISE/CHealPix.pm
Statements Executed184741289
Total Time547.369136690801 seconds

Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1387022262.52285613.22701WISE::CHealPix::pix_withinr_ring
599328311130.60194198.16257WISE::CHealPix::neighbors_ring
59932841267.5606367.56063WISE::CHealPix::neighbors_ring_dups (xsub)
59948372148.1575172.76986WISE::CHealPix::pix2ang_ring
59948381224.6123524.61235WISE::CHealPix::pix2ang_ring_stub (xsub)
13871320.175570.26029WISE::CHealPix::ang2pix_ring
13872120.084720.08472WISE::CHealPix::ang2pix_ring_stub (xsub)
13872230.058660.05866WISE::CHealPix::c2cdist_deg (xsub)
2120.000110.00011WISE::CHealPix::bootstrap (xsub)
2122.3e-52.3e-5WISE::CHealPix::nsides2side_deg (xsub)
2121.2e-51.2e-5WISE::CHealPix::side2nsides_deg (xsub)
00000WISE::CHealPix::BEGIN
00000WISE::CHealPix::ang2pix_nest
00000WISE::CHealPix::nside2npix
00000WISE::CHealPix::pix2ang_nest

LineStmts.Exclusive
Time
Avg.Code
1#! /usr/bin/env perl
2
335.6e-51.9e-5use strict;
# spent 31µs making 1 call to strict::import
434.4e-51.5e-5use warnings;
# spent 32µs making 1 call to warnings::import
5
6use WISE::Env (cfglib => '<:LIB:>' ,
# spent 655µs making 1 call to WISE::Env::import
734.6e-51.5e-5 import => [qw/$opslib $staticlib/]);
8
9package WISE::CHealPix;
10
1130.000590.00020use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $VERSION);
# spent 75µs making 1 call to vars::import
12
1311.0e-61.0e-6my $version = '$Id: CHealPix.pm 5619 2009-08-21 20:30:50Z tim $ ';
14
1511.0e-61.0e-6require Exporter;
1611.0e-61.0e-6require DynaLoader;
17
1811.4e-51.4e-5@ISA = qw(Exporter DynaLoader);
19
2011.0e-61.0e-6@EXPORT = qw();
2112.0e-62.0e-6@EXPORT_OK = qw(ang2pix_ring pix2ang_ring neighbors_ring
22 nside2npix
23 c2cdist_deg nsides2side_deg side2nsides_deg
24 pix_withinr_ring
25 );
2611.0e-61.0e-6%EXPORT_TAGS = ();
27
2811.0e-61.0e-6my $PI = atan2(1.0,1.0) * 4.0;
2911.0e-61.0e-6my $R2D = 180.0 / $PI;
3011.0e-61.0e-6my $S2 = sqrt(2.0);
31
32100$VERSION = '1.00';
33
3412.7e-52.7e-5bootstrap WISE::CHealPix $VERSION;
# spent 2.97ms making 1 call to DynaLoader::bootstrap
35
36sub ang2pix_nest {
37 my ($nside,$lon,$lat) = @_;
38 return ang2pix_nest_stub($nside,(90-$lat)/$R2D,$lon/$R2D);
39}
40
41sub pix2ang_nest {
42 my ($nside,$pix) = @_;
43 my ($lat,$lon) = pix2ang_nest_stub($nside,$pix);
44 return ($lon*$R2D, 90 - $lat*$R2D);
45}
46
47
# spent 260ms (176+84.7) within WISE::CHealPix::ang2pix_ring which was called 13871 times, avg 19µs/call: # 13869 times (176ms+84.7ms) by WISE::CoUtils::posmatch at line 718 of /wise/base/deliv/dev/lib/perl/WISE/CoUtils.pm, avg 19µs/call # once (14µs+26µs) by WISE::DB::FrameIndex::_neighbor_hp at line 514 of /wise/base/deliv/dev/lib/perl/WISE/DB/FrameIndex.pm # once (15µs+6µs) by WISE::CoUtils::posmatch at line 754 of /wise/base/deliv/dev/lib/perl/WISE/CoUtils.pm
sub ang2pix_ring {
48277420.196597.1e-6 my ($nside,$lon,$lat) = @_;
49 return ang2pix_ring_stub($nside,(90-$lat)/$R2D,$lon/$R2D);
# spent 84.7ms making 13871 calls to WISE::CHealPix::ang2pix_ring_stub, avg 6µs/call
50}
51
52
# spent 72.8s (48.2+24.6) within WISE::CHealPix::pix2ang_ring which was called 5994837 times, avg 12µs/call: # 5980967 times (48.0s+24.5s) by WISE::CHealPix::pix_withinr_ring at line 88, avg 12µs/call # 13870 times (113ms+66.0ms) by WISE::CHealPix::pix_withinr_ring at line 77, avg 13µs/call
sub pix2ang_ring {
531798451156.522003.1e-6 my ($nside,$pix) = @_;
54 my ($lat,$lon) = pix2ang_ring_stub($nside,$pix);
# spent 24.6s making 5994837 calls to WISE::CHealPix::pix2ang_ring_stub, avg 4µs/call
55 return ($lon*$R2D, 90 - $lat*$R2D);
56}
57
58sub nside2npix {
59 my $nside = shift;
60 return nside2npix_stub($nside);
61}
62
63
# spent 198s (131+67.6) within WISE::CHealPix::neighbors_ring which was called 5993283 times, avg 33µs/call: # 5993283 times (131s+67.6s) by WISE::CHealPix::pix_withinr_ring at line 85, avg 33µs/call
sub neighbors_ring {
6417979849183.100181.0e-5 my ($nside, $pix) = @_;
65 my %there = ($pix=>1);
66 return (grep { ! $there{$_}++ }
# spent 67.6s making 5993283 calls to WISE::CHealPix::neighbors_ring_dups, avg 11µs/call
67 neighbors_ring_dups($nside,$pix)
68 );
69}
70
71
# spent 613s (263+351) within WISE::CHealPix::pix_withinr_ring which was called 13870 times, avg 44.2ms/call: # 13869 times (262s+351s) by WISE::CoUtils::posmatch at line 723 of /wise/base/deliv/dev/lib/perl/WISE/CoUtils.pm, avg 44.2ms/call # once (95.3ms+151ms) by WISE::DB::FrameIndex::_neighbor_hp at line 518 of /wise/base/deliv/dev/lib/perl/WISE/DB/FrameIndex.pm
sub pix_withinr_ring {
721664406.755554.1e-5 my $nside= shift;
73 my $pix0 = shift;
74 my $r = shift;
75 my $side = c2cdist_deg($nside);
# spent 58.6ms making 13870 calls to WISE::CHealPix::c2cdist_deg, avg 4µs/call
76 my $niter= int($r/$side + 1);
77 my ($lon0,$lat0) = pix2ang_ring($nside,$pix0);
# spent 179ms making 13870 calls to WISE::CHealPix::pix2ang_ring, avg 13µs/call
78 my %got;
79 my @outer = ($pix0);
80 require WISE::CoUtils;
81 $got{$pix0}++;
82 for my $iter (1..$niter) {
835905682.885954.9e-6 my @new;
84 for my $pix (@outer) {
8511986566119.397771.0e-5 my @neighbors = neighbors_ring($nside,$pix);
# spent 198s making 5993283 calls to WISE::CHealPix::neighbors_ring, avg 33µs/call
86 for my $pix_neighbor (@neighbors) {
87136005589178.510311.3e-6 next if $got{$pix_neighbor};
88 my ($lon,$lat) = pix2ang_ring($nside,$pix_neighbor);
# spent 72.6s making 5980967 calls to WISE::CHealPix::pix2ang_ring, avg 12µs/call
89 my $d = WISE::CoUtils::angdist($lon0,$lat0,$lon,$lat);
# spent 79.7s making 5980967 calls to WISE::CoUtils::angdist, avg 13µs/call
90 next if $d > $r;
91 $got{$pix_neighbor}++;
92 push @new, $pix_neighbor;
93 }
94 }
95 @outer = @new;
96 last if ! @new;
97 }
98 return (sort {$a<=>$b} keys %got);
99}
# spent 84.7ms within WISE::CHealPix::ang2pix_ring_stub which was called 13871 times, avg 6µs/call: # 13871 times (84.7ms+0) by WISE::CHealPix::ang2pix_ring at line 49 of /wise/base/deliv/dev/lib/perl/x86_64-linux-thread-multi/WISE/CHealPix.pm, avg 6µs/call
sub WISE::CHealPix::ang2pix_ring_stub; # xsub
# spent 110µs within WISE::CHealPix::bootstrap which was called # once (110µs+0) by DynaLoader::bootstrap at line 226 of /opt/wise/lib/perl5/5.10.0/x86_64-linux-thread-multi/DynaLoader.pm
sub WISE::CHealPix::bootstrap; # xsub
# spent 58.7ms within WISE::CHealPix::c2cdist_deg which was called 13871 times, avg 4µs/call: # 13870 times (58.6ms+0) by WISE::CHealPix::pix_withinr_ring at line 75 of /wise/base/deliv/dev/lib/perl/x86_64-linux-thread-multi/WISE/CHealPix.pm, avg 4µs/call # once (26µs+0) by WISE::DB::FrameIndex::_neighbor_hp at line 503 of /wise/base/deliv/dev/lib/perl/WISE/DB/FrameIndex.pm
sub WISE::CHealPix::c2cdist_deg; # xsub
# spent 67.6s within WISE::CHealPix::neighbors_ring_dups which was called 5993283 times, avg 11µs/call: # 5993283 times (67.6s+0) by WISE::CHealPix::neighbors_ring at line 66 of /wise/base/deliv/dev/lib/perl/x86_64-linux-thread-multi/WISE/CHealPix.pm, avg 11µs/call
sub WISE::CHealPix::neighbors_ring_dups; # xsub
# spent 23µs within WISE::CHealPix::nsides2side_deg which was called # once (23µs+0) by WISE::CoUtils::posmatch at line 710 of /wise/base/deliv/dev/lib/perl/WISE/CoUtils.pm
sub WISE::CHealPix::nsides2side_deg; # xsub
# spent 24.6s within WISE::CHealPix::pix2ang_ring_stub which was called 5994837 times, avg 4µs/call: # 5994837 times (24.6s+0) by WISE::CHealPix::pix2ang_ring at line 54 of /wise/base/deliv/dev/lib/perl/x86_64-linux-thread-multi/WISE/CHealPix.pm, avg 4µs/call
sub WISE::CHealPix::pix2ang_ring_stub; # xsub
# spent 12µs within WISE::CHealPix::side2nsides_deg which was called # once (12µs+0) by WISE::CoUtils::posmatch at line 666 of /wise/base/deliv/dev/lib/perl/WISE/CoUtils.pm
sub WISE::CHealPix::side2nsides_deg; # xsub