Changeset 29866
- Timestamp:
- Nov 26, 2010, 3:26:16 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/tools/czartool/Gpc1Db.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/czartool/Gpc1Db.pm
r29763 r29866 246 246 ########################################################################### 247 247 # 248 # Returns average magic mask fraction across all chips for a particular exposure 249 # 250 ########################################################################### 251 sub getAverageMagicMaskFraction { 252 my ($self, $exp_id) = @_; 248 # Returns average magic mask fraction, sum of mask fractions and chip count 249 # for a particular exposure 250 # 251 ########################################################################### 252 sub getMagicMaskStats { 253 my ($self, $exp_id, $mean, $sum, $chipCount) = @_; 253 254 254 255 my $query = $self->{_db}->prepare(<<SQL); 255 SELECT AVG(streak_frac) 256 SELECT AVG(streak_frac), SUM(streak_frac), COUNT(*) 256 257 FROM magicDSFile 257 258 JOIN magicDSRun USING(magic_ds_id) … … 262 263 AND component LIKE "XY%"; 263 264 SQL 264 $query->execute; 265 return scalar $query->fetchrow_array(); 265 if (!$query->execute) {return 0;} # TODO do this everywhere 266 267 (${$mean}, ${$sum}, ${$chipCount}) = $query->fetchrow_array(); 268 269 return 1; 266 270 } 267 271 1;
Note:
See TracChangeset
for help on using the changeset viewer.
