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

File/wise/base/deliv/dev/lib/perl/WISE/DB/FrameIndex/Frame.pm
Statements Executed124834
Total Time0.281997999999922 seconds

Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
13869110.233582.25613WISE::DB::FrameIndex::Frame::qa_factors
00000WISE::DB::FrameIndex::Frame::BEGIN
00000WISE::DB::FrameIndex::Frame::sqlt_deploy_hook

LineStmts.Exclusive
Time
Avg.Code
1package WISE::DB::FrameIndex::Frame;
2# $Id: Frame.pm 7702 2010-03-31 22:54:58Z heidi $
3
411.0e-61.0e-6$VERSION = 1.4;
511.0e-61.0e-6$ID = '$Id: Frame.pm 7702 2010-03-31 22:54:58Z heidi $';
6
730.000690.00023use base qw/DBIx::Class/;
# spent 118µs making 1 call to base::import
8
911.4e-51.4e-5__PACKAGE__->load_components(qw/Core/);
# spent 379µs making 1 call to Class::C3::Componentised::load_components
1012.3e-52.3e-5__PACKAGE__->table('frames');
# spent 664µs making 1 call to DBIx::Class::ResultSourceProxy::Table::table
11
1216.9e-56.9e-5__PACKAGE__->add_columns(
# spent 9.52ms making 1 call to DBIx::Class::ResultSourceProxy::add_columns
13
14 # primary identifiers
15 scan => {data_type => 'text', is_nullable => 0},
16 frame => {data_type => 'integer', is_nullable => 0},
17 band => {data_type => 'integer', is_nullable => 0},
18 delivery => {data_type => 'text', is_nullable => 0},
19
20 # instrument / spacecraft parameters
21 orbit_number => {data_type => 'integer', is_nullable => 1},
22 scan_incl => {data_type => 'real', is_nullable => 1}, # scan inclination
23 scan_rate => {data_type => 'real', is_nullable => 1},
24 sciobs_status => {data_type => 'integer', is_nullable => 1}, # a science observation ?
25 saa_status => {data_type => 'integer', is_nullable => 1}, # in south atlantic anomaly ?
26 anneal_time => {data_type => 'text', is_nullable => 1}, # time of last anneal
27 anneal_dt => {data_type => 'real', is_nullable => 1}, # time since last anneal
28
29 # delivery & ingest
30 delivery_utcs => {data_type => 'integer', is_nullable => 1}, # integer seconds
31 delivery_file => {data_type => 'text', is_nullable => 1}, # full name of raw delivery
32 delivery_size => {data_type => 'integer', is_nullable => 1}, # size of delivered file in bytes
33 ingest_status => {data_type => 'integer', is_nullable => 1}, # ingest return code
34 l0_file => {data_type => 'text', is_nullable => 1}, # full name of L0 file
35
36 # frame metadata
37 utcs => {data_type => 'integer', is_nullable => 1}, # integer seconds} ,
38 ra_raw => {data_type => 'real', is_nullable => 1}, # boresite RA
39 dec_raw => {data_type => 'real', is_nullable => 1}, # boresite DEC
40 pa_raw => {data_type => 'real', is_nullable => 1}, # boresite position angle
41 hp_raw => {data_type => 'integer', is_nullable => 1}, # healpix spatial coord based on raw pointing
42 ra_ref => {data_type => 'real', is_nullable => 1}, # refined RA
43 dec_ref => {data_type => 'real', is_nullable => 1}, # refined Dec
44 pa_ref => {data_type => 'real', is_nullable => 1}, # refined position angle
45 hp_ref => {data_type => 'integer', is_nullable => 1}, # healpix spatial coord based on refined pointing
46 delay_time => {data_type => 'real', is_nullable => 1}, # time since previous readout
47 scan_start => {data_type => 'integer', is_nullable => 1}, # flag first frame in scan
48 scan_end => {data_type => 'integer', is_nullable => 1}, # flag last frame in scan
49 prev_frame => {data_type => 'integer', is_nullable => 1}, # previous frame in scan
50 next_frame => {data_type => 'integer', is_nullable => 1}, # next frame in scan
51 pixel_stat1 => {data_type => 'real', is_nullable => 1}, # pixel statistic #1
52 pixel_stat2 => {data_type => 'real', is_nullable => 1}, # pixel statistic #2
53 pixel_stat3 => {data_type => 'real', is_nullable => 1}, # pixel statistic #3
54
55 # pipeline processing
56 pipe_status => {data_type => 'integer', is_nullable => 1}, # scanframe pipeline return code
57 pipe_dir => {data_type => 'text', is_nullable => 1}, # full path to pipeline directory
58 frameset_run_time => {data_type => 'integer', is_nullable => 1},
59 coadd_status => {data_type => 'integer', is_nullable => 1}, # has this frame been included in any coadd
60 archive_status => {data_type => 'integer', is_nullable => 1}, # return status of archive pipeline
61 archive_dir => {data_type => 'text', is_nullable => 1},
62 archive_run_time => {data_type => 'integer', is_nullable => 1}, # Time of last archiving
63
64 # qa info
65 qa_score => {data_type => 'integer', is_nullable => 1 },
66 qa_factors => {data_type => 'text', is_nullable => 1, accessor => '_qa_factors' },
67 qa_status => {data_type => 'text', is_nullable => 1, default_value => 'unassigned' },
68 qa_reviewer => {data_type => 'text', is_nullable => 1 },
69 qa_notes => {data_type => 'text', is_nullable => 1 },
70
71 # foreign keys
72 housekeeping => {data_type => 'integer', is_nullable => 1}, # key to housekeeping table
73 missionops => {data_type => 'integer', is_nullable => 1}, # key to mission ops
74
75 );
76
7713.0e-53.0e-5__PACKAGE__->set_primary_key(qw/scan frame band/);
# spent 231µs making 1 call to DBIx::Class::ResultSourceProxy::set_primary_key
78
79# set relationships to other tables. the content and relationships are pretty hazy right now
8012.5e-52.5e-5__PACKAGE__->has_one( 'scanrec' => 'WISE::DB::FrameIndex::Scan', { 'foreign.scan' => 'self.scan'});
# spent 386µs making 1 call to DBIx::Class::Relationship::HasOne::has_one
8111.6e-51.6e-5__PACKAGE__->many_to_many( housekeeping => 'WISE::DB::FrameIndex::HouseKeeping', 'delivery');
8217.0e-67.0e-6__PACKAGE__->many_to_many( plan => 'WISE::DB::FrameIndex::MissionPlan', 'orbit_number');
83
84sub sqlt_deploy_hook {
85 my ($self, $sqlt_table) = @_;
86
87 $sqlt_table->add_index(name => 'idx1', fields => ['scan']);
88 $sqlt_table->add_index(name => 'idx9', fields => ['frame']);
89 $sqlt_table->add_index(name => 'idx10', fields => ['scan', 'frame']);
90 $sqlt_table->add_index(name => 'idx2', fields => ['ra_raw']);
91 $sqlt_table->add_index(name => 'idx3', fields => ['dec_raw']);
92 $sqlt_table->add_index(name => 'idx4', fields => ['hp_raw']);
93 $sqlt_table->add_index(name => 'idx5', fields => ['ra_ref']);
94 $sqlt_table->add_index(name => 'idx6', fields => ['dec_ref']);
95 $sqlt_table->add_index(name => 'idx7', fields => ['hp_ref']);
96
97 $sqlt_table->add_index(name => 'idx8', fields => ['utcs']);
98}
99
100# accessor for the qa_factors field, which is a text string packed with key=val, entries
101
# spent 2.26s (234ms+2.02) within WISE::DB::FrameIndex::Frame::qa_factors which was called 13869 times, avg 163µs/call: # 13869 times (234ms+2.02s) at line 829 of /wise/base/deliv/dev/bin/getfix, avg 163µs/call
sub qa_factors {
1021248210.281072.3e-6 my ($self, $value, $attr) = @_;
103
104 my $overwrite = exists $attr->{overwrite} ? $attr->{overwrite} : 0;
105 my $append = exists $attr->{append} ? $attr->{append} : ! $overwrite;
106 die __PACKAGE__."->qa_factors() can't overwrite and append" if($overwrite && $append);
107
108 my %current = ();
109 my $factors_string = $self->_qa_factors || "";
110 %current = split(/[=,]/, $factors_string) unless $overwrite;
111
112 if(defined $value) {
113 if(ref($value) eq 'HASH' ) {
114 my $flat = "";
115 my %merged = (%current, %$value);
116 while ( my ($k, $v) = each %merged ) {
117 $flat .= "$k=$v,";
118 }
119 $flat =~ s/,$//;
120 $self->_qa_factors($flat);
121 } else {
122 die __PACKAGE__."->qa_factors() expects hash ref as input";
123 }
124 }
125
126 return split( /[=,]/, ( $self->_qa_factors || ""));
127}
128
129
130# need to trigger the healpix tile computation
131# it should be done whenever the frame is created/inserted,
132# or the ra/dec is updated .....
133# (unless the healpix tile has been precomputed & passed in)
134
13515.2e-55.2e-51;
136