Changeset 35096
- Timestamp:
- Feb 6, 2013, 2:34:49 PM (13 years ago)
- Location:
- branches/eam_branches/ipp-20121219
- Files:
-
- 85 edited
- 9 copied
-
. (modified) (1 prop)
-
Nebulous (modified) (1 prop)
-
Nebulous-Server (modified) (1 prop)
-
Nebulous-Server/bin/nebdiskd (modified) (12 diffs)
-
Nebulous/bin/neb-df (modified) (5 diffs)
-
Ohana (modified) (1 prop)
-
Ohana/src/getstar/src/select_by_region.c (modified) (3 diffs)
-
Ohana/src/libohana/src (modified) (1 prop)
-
Ohana/src/opihi (modified) (1 prop)
-
Ohana/src/opihi/cmd.astro (modified) (1 prop)
-
Ohana/src/opihi/cmd.data (modified) (1 prop)
-
dbconfig/changes.txt (modified) (1 diff)
-
dbconfig/ipp.m4 (modified) (1 diff)
-
dbconfig/release.md (copied) (copied from trunk/dbconfig/release.md )
-
ippMonitor (modified) (1 prop)
-
ippMonitor/Makefile.in (modified) (1 diff)
-
ippMonitor/czartool/czarDbSchema.sql (modified) (1 diff)
-
ippMonitor/czartool/czartool/CzarDb.pm (modified) (51 diffs)
-
ippMonitor/czartool/czartool/Nebulous.pm (modified) (11 diffs)
-
ippMonitor/czartool/czartool/Plotter.pm (modified) (1 diff)
-
ippScripts/scripts/camera_exp.pl (modified) (8 diffs)
-
ippScripts/scripts/destreak_restore_camera.pl (modified) (1 prop)
-
ippScripts/scripts/ipp_apply_burntool_single.pl (modified) (1 prop)
-
ippScripts/scripts/ipp_cleanup.pl (modified) (2 diffs)
-
ippScripts/scripts/magic_destreak.pl (modified) (1 prop)
-
ippTasks (modified) (1 prop)
-
ippTasks/survey.pro (modified) (1 diff)
-
ippToPsps (modified) (1 prop)
-
ippTools/share/Makefile.am (modified) (1 diff)
-
ippTools/share/bgtool_definechip.sql (modified) (1 diff)
-
ippTools/share/camtool_find_pendingimfile.sql (modified) (1 prop)
-
ippTools/share/chiptool_setimfiletoupdate.sql (modified) (1 prop)
-
ippTools/share/pxadmin_create_tables.sql (modified) (1 diff, 1 prop)
-
ippTools/share/pxadmin_drop_tables.sql (modified) (1 diff)
-
ippTools/share/releasetool_definerelexp.sql (copied) (copied from trunk/ippTools/share/releasetool_definerelexp.sql )
-
ippTools/share/releasetool_listrelease.sql (copied) (copied from trunk/ippTools/share/releasetool_listrelease.sql )
-
ippTools/share/releasetool_listrelexp.sql (copied) (copied from trunk/ippTools/share/releasetool_listrelexp.sql )
-
ippTools/share/releasetool_listsurvey.sql (copied) (copied from trunk/ippTools/share/releasetool_listsurvey.sql )
-
ippTools/share/stacktool_tobkg.sql (modified) (1 diff)
-
ippTools/share/staticskytool_defineskycalrun.sql (modified) (2 diffs)
-
ippTools/share/staticskytool_revert.sql (modified) (1 diff)
-
ippTools/share/staticskytool_revertskycal.sql (modified) (1 diff)
-
ippTools/share/staticskytool_skycalresult.sql (modified) (1 diff)
-
ippTools/share/warptool_towarped.sql (modified) (1 prop)
-
ippTools/src (modified) (2 props)
-
ippTools/src/Makefile.am (modified) (3 diffs)
-
ippTools/src/bgtool.c (modified) (1 diff)
-
ippTools/src/bgtoolConfig.c (modified) (1 diff)
-
ippTools/src/magictool.c (modified) (1 prop)
-
ippTools/src/pxspace.c (modified) (2 diffs)
-
ippTools/src/releasetool.c (copied) (copied from trunk/ippTools/src/releasetool.c )
-
ippTools/src/releasetool.h (copied) (copied from trunk/ippTools/src/releasetool.h )
-
ippTools/src/releasetoolConfig.c (copied) (copied from trunk/ippTools/src/releasetoolConfig.c )
-
ippTools/src/staticskytool.c (modified) (5 diffs)
-
ippTools/src/staticskytoolConfig.c (modified) (6 diffs)
-
ippconfig (modified) (1 prop)
-
ippconfig/gpc1/psastro.config (modified) (2 diffs)
-
ippconfig/gpc1/psphot.config (modified) (2 diffs)
-
ippconfig/recipes/filerules-mef.mdc (modified) (1 diff)
-
ippconfig/recipes/filerules-simple.mdc (modified) (1 diff)
-
ippconfig/recipes/filerules-split.mdc (modified) (1 diff)
-
ippconfig/recipes/ppImage.config (modified) (2 diffs)
-
ippconfig/recipes/ppSub.config (modified) (1 prop)
-
ippconfig/recipes/psastro.config (modified) (3 diffs)
-
ippconfig/recipes/psphot.config (modified) (1 diff, 1 prop)
-
ippconfig/recipes/pswarp.config (modified) (1 diff)
-
ippconfig/recipes/reductionClasses.mdc (modified) (1 diff, 1 prop)
-
ppImage/src (modified) (1 prop)
-
ppImage/src/Makefile.am (modified) (1 diff)
-
ppImage/src/ppImage.h (modified) (3 diffs)
-
ppImage/src/ppImageLoop.c (modified) (3 diffs)
-
ppImage/src/ppImageMosaicBackground.c (copied) (copied from trunk/ppImage/src/ppImageMosaicBackground.c )
-
ppImage/src/ppImageOptions.c (modified) (2 diffs)
-
ppImage/src/ppImageParseCamera.c (modified) (3 diffs)
-
ppStack/src/ppStackCamera.c (modified) (2 diffs)
-
ppStack/src/ppStackCombineAlternate.c (modified) (1 diff)
-
psLib/src/imageops/psImageInterpolate.c (modified) (1 diff)
-
psModules (modified) (1 prop)
-
psModules/src/camera/pmFPAMaskWeight.c (modified) (2 diffs)
-
psModules/src/detrend/pmPattern.c (modified) (1 diff)
-
psModules/src/detrend/pmPattern.h (modified) (2 diffs)
-
psModules/src/imcombine/pmStack.c (modified) (4 diffs)
-
psModules/src/objects/pmSourceIO_CMF.c.in (modified) (1 diff)
-
psastro/src/psastroChooseRefstars.c (modified) (1 diff)
-
psastro/src/psastroLoadRefstars.c (modified) (2 diffs)
-
psconfig (modified) (1 prop)
-
psconfig/psbuild (modified) (1 diff)
-
psphot (modified) (1 prop)
-
psphot/src (modified) (1 prop)
-
psphot/src/psphotSourceSize.c (modified) (6 diffs)
-
psphot/src/psphotStackImageLoop.c (modified) (1 prop)
-
pstamp/scripts (modified) (1 prop)
-
psvideophot (modified) (1 prop)
-
tools/queuessky.lap (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20121219
-
branches/eam_branches/ipp-20121219/Nebulous
- Property svn:mergeinfo set to
-
branches/eam_branches/ipp-20121219/Nebulous-Server
- Property svn:mergeinfo set to
-
branches/eam_branches/ipp-20121219/Nebulous-Server/bin/nebdiskd
r28525 r35096 11 11 use Config::YAML; 12 12 use DBI; 13 use File::Mountpoint qw( is_mountpoint );14 13 use File::Spec; 15 use Filesys::Df;16 14 use Log::Log4perl; 17 15 use Nebulous::Server::SQL; … … 22 20 23 21 my ( 24 $debug, 25 $db, 26 $dbhost, 27 $dbuser, 28 $dbpass, 29 $pidfile, 30 $stop, 31 $restart, 22 $debug, 23 $db, 24 $dbhost, 25 $dbuser, 26 $dbpass, 27 $pidfile, 28 $stop, 29 $restart, 32 30 $verbose, 33 31 $user, … … 111 109 log4perl.appender.SERVERLOGFILE.layout = Log::Log4perl::Layout::PatternLayout 112 110 log4perl.appender.SERVERLOGFILE.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} | %H | %p | %M - %m%n 111 log4perl.appender.SERVERLOGFILE.size = 10485760 113 112 114 113 log4perl.filter.MatchWarn = Log::Log4perl::Filter::LevelMatch … … 143 142 $SIG{TERM} = sub { unlink_pid_file($pidfile); exit(); }; 144 143 $SIG{INT} = $SIG{TERM}; 145 $SIG{HUP} = sub { $c = read_rcfile($rcfile) }; 144 $SIG{HUP} = sub { $c = read_rcfile($rcfile) }; 146 145 147 146 my $date = localtime(); … … 192 191 eval { 193 192 my $r_query = $dbh->prepare_cached("REPLACE INTO mountedvol SELECT vol_id,name,host,path,allocate,available,xattr,mountpoint, ?, ?,note FROM volume WHERE mountpoint = ?"); 194 # my $d_query = $dbh->prepare_cached("UPDATE mountedvol SET allocate = ?, available = ? WHERE mountpoint = ?");195 193 my $d_query = $dbh->prepare_cached("DELETE FROM mountedvol WHERE mountpoint = ?"); 196 194 … … 199 197 { 200 198 # there may be multiple vol_ids per mountpoint but we only need to 201 # check each mo intpont once202 my $query = $dbh->prepare_cached("SELECT DISTINCT mountpoint FROM volume");199 # check each mountpoint once 200 my $query = $dbh->prepare_cached("SELECT DISTINCT host, mountpoint FROM volume"); 203 201 $query->execute; 204 202 while (my $row = $query->fetchrow_hashref) { … … 207 205 $query->finish; 208 206 } 209 207 210 208 # determine valid mountpoints 211 209 foreach my $mnt (@$mounts) { 212 210 my $mountpoint = $mnt->{'mountpoint'}; 213 $log->debug("checking $mountpoint"); 214 # this /SHOULD/ fail if the mount point is handled by the 215 # automounter and it fails to mount 216 my $tries = 0; 217 my $valid_mountpoint = 1; 218 unless (exists($host_failure_counts{$mountpoint})) { 219 $host_failure_counts{$mountpoint} = 0; 220 } 221 TEST: eval { 222 $tries++; 223 unless (is_mountpoint($mountpoint)) { 224 unless(defined($host_removed{$mountpoint})) { 225 $log->warn("$mountpoint is not a valid mountpoint ($tries $host_failure_counts{$mountpoint})"); 226 } 227 $valid_mountpoint = 0; 228 } 229 }; 230 231 # fetch stats on the mounted device. this has to be done AFTER 232 # we determine if it's a valid mountpoint incase 233 # is_mountpoint() invokes the automounter 234 my $dev_info = df($mountpoint, 1024); 211 my $alt_mountpoint = $mountpoint; 212 $alt_mountpoint =~ s/data/export/; 213 my $hostname = $mnt->{'host'}; 214 my $valid_mountpoint = 1; 215 216 # fetch stats on the device using ssh and df 217 my $dev_info = df_through_ssh($hostname, $alt_mountpoint, 1024); 235 218 unless (defined $dev_info) { 236 $valid_mountpoint = 0; 237 } 238 239 if (!$valid_mountpoint) { 240 # try is_mountpoint() again if $retry > 1 241 if ($tries < $retry) { 242 $log->warn("retrying test of $mountpoint"); 243 goto TEST; 244 } 245 $host_failure_counts{$mountpoint}++; 246 247 if (!(defined($host_removed{$mountpoint})) || !($host_removed{$mountpoint})) { 248 if (($host_failure_counts{$mountpoint} > $failure_limit)) { 249 $host_removed{$mountpoint} = 1; 250 $log->warn("Removing $mountpoint from the mountedvol table ($host_failure_counts{$mountpoint} > $failure_limit) No further warnings unless state changes."); 251 $d_query->execute($mountpoint); 252 } 253 else { 254 $log->warn("Mountpoint $mountpoint has had $host_failure_counts{$mountpoint} failures. Will remove after $failure_limit"); 255 } 256 } 257 next; 258 259 } 260 if ($host_failure_counts{$mountpoint} != 0) { 261 $host_removed{$mountpoint} = 0; 262 $log->warn("Mountpoint $mountpoint failures cleared ($host_failure_counts{$mountpoint})"); 263 $host_failure_counts{$mountpoint} = 0; 264 } 265 266 # fetch stats on the mounted device. this has to be done AFTER 267 # we determine if it's a valid mountpoint incase 268 # is_mountpoint() invokes the automounter 269 $dev_info = df($mountpoint, 1024); 270 unless (defined $dev_info) { 271 $log->error("can't find device info for $mountpoint"); 219 $valid_mountpoint = 0; 220 $log->error("can't find device info for $mountpoint / $alt_mountpoint"); 221 $d_query->execute($mountpoint); 272 222 next; 273 223 } … … 278 228 279 229 } 280 281 # $dbh->do("call getmountedvol()");282 283 # $dbh->commit;284 # $log->debug("commited to database");285 230 }; 286 231 if ($@) { 287 # $dbh->rollback;288 # $log->debug("rolledback transaction");289 232 $log->logdie($@); 290 233 } … … 336 279 # $dbh->commit; 337 280 }; 338 if ($@) { 281 if ($@) { 339 282 # $dbh->rollback; 340 283 $log->logdie($@); … … 391 334 # this follows BSD syntax ps (BSD's and linux) 392 335 # this will fail on Unix98 syntax ps (Solaris, etc) 393 }elsif( `ps h o pid p $$` =~ /^\s*$$\s*$/ ){ # can I play ps on myself ? 394 $exists = `ps h o pid p $current_pid`; 395 336 } elsif( `ps h o pid p $$` =~ /^\s*$$\s*$/ ){ # can I play ps on myself ? 337 $exists = `ps h o pid p $current_pid`; 396 338 } 397 339 … … 412 354 } 413 355 356 sub df_through_ssh { 357 my $hostname = shift; 358 my $mountpoint = shift; 359 my $units = shift; 360 $log->debug("Getting info from mountpoint = [$mountpoint] / unit = [$units] / hostname = [$hostname]"); 361 my $df_data = qx/ssh $hostname 'df $mountpoint' | grep -v Filesystem/; 362 $df_data =~ s/\s+/:/g; 363 $log->debug("Received from ssh = [$df_data]"); 364 my %df_info = (); 365 $df_info{"blocks"} = 0; 366 $df_info{"used"} = 0; 367 unless ($df_data) { 368 # We cannot connect to the host for some reason However, the 369 # partition can be mounted on some other hosts (in the case of 370 # an original host failure or upgrade for instance) Let's look 371 # for an entry in /etc/autofs/auto.data starting with 372 # <hostname>.[012] If it's in there, return (blocks => 1, used 373 # => 1). The partition is mounted but not available for 374 # replication (since blocks-used = 0 and used/blocks=1=100%). 375 my $partition_name = $mountpoint; 376 $partition_name =~ s/\/export\///; 377 $log->debug("Looking for $partition_name in /etc/autofs/auto.data"); 378 open(AUTODATA, "</etc/autofs/auto.data") or die("Can't open /etc/autofs/auto.data"); 379 foreach my $line (<AUTODATA>) { 380 if ($line =~ /^$partition_name/) { 381 $log->debug("$partition_name found in /etc/autofs/auto.data"); 382 close(AUTODATA); 383 $df_info{"blocks"} = 1; 384 $df_info{"used"} = 1; 385 return \%df_info; 386 } 387 } 388 $log->debug("$partition_name NOT found in /etc/autofs/auto.data"); 389 close(AUTODATA); 390 return undef; 391 } 392 my @data = split(/:/, $df_data); 393 $df_info{"blocks"} = $data[1]; 394 $df_info{"used"} = $data[2]; 395 $log->debug("blocks = " . $df_info{"blocks"} . " / used = " . $df_info{"used"}); 396 return \%df_info; 397 } 414 398 415 399 __END__ … … 525 509 =item * C<NEB_PASS> 526 510 527 Equivalent to --dbpass|-p 511 Equivalent to --dbpass|-p 528 512 529 513 =back -
branches/eam_branches/ipp-20121219/Nebulous/bin/neb-df
r31413 r35096 53 53 my $path = $vol{host}; 54 54 if ($names) { 55 $path = $vol{name};55 $path = $vol{name}; 56 56 } 57 57 … … 61 61 $total_used += $used; 62 62 my $available = $total - $used; 63 my $usedper = ($used / $total) * 100;63 my $usedper = ($used / ($total+1)) * 100; 64 64 my $mountpoint = $vol{mountpoint}; 65 65 66 66 if ($vol{allocate} == 1) { 67 $allocated_total += $total;68 $allocated_used += $used;67 $allocated_total += $total; 68 $allocated_used += $used; 69 69 } 70 70 # indicated the part of the nebulous volume name that matches up with a 71 # local volume (mountpoint) 71 # local volume (mountpoint) 72 72 #$path =~ s/$mountpoint/[$mountpoint]/; 73 73 … … 95 95 96 96 my $total_available = $total_total - $total_used; 97 my $total_usedper = ($total_used / $total_total) * 100; 97 my $total_usedper = ($total_used / $total_total) * 100; 98 98 99 99 # summary … … 112 112 113 113 my $allocated_available = $allocated_total - $allocated_used; 114 my $allocated_usedper = ($allocated_used / $allocated_total) * 100; 114 my $allocated_usedper = ($allocated_used / $allocated_total) * 100; 115 115 116 116 # summary … … 188 188 =item * C<NEB_PASS> 189 189 190 Equivalent to --pass|-p 190 Equivalent to --pass|-p 191 191 192 192 =back -
branches/eam_branches/ipp-20121219/Ohana
- Property svn:mergeinfo changed
/trunk/Ohana merged: 35066
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20121219/Ohana/src/getstar/src/select_by_region.c
r34459 r35096 53 53 gfits_scan (&catalog[0].header, "DEC1", "%lf", 1, &Dmax); 54 54 55 if (VERBOSE) fprintf (stderr, "extracting from catalog covering region %f,%f to %f,%f\n", Rmin, Dmin, Rmax, Dmax);56 57 55 AREA = fabs(Dmax - Dmin) * fabs(Rmax - Rmin) * cos (0.5*RAD_DEG*(Dmax + Dmin)); 56 if (VERBOSE) fprintf (stderr, "extracting from catalog covering region %f,%f to %f,%f for area %f\n", Rmin, Dmin, Rmax, Dmax, AREA); 58 57 assert (AREA > 0); 59 58 … … 83 82 if (isnan(mag)) continue; 84 83 if (mag < MinMagValue) continue; 85 if (mag > MagLimitValue) continue;86 84 87 85 bin = (mag - MagMin) / dMag; … … 101 99 } 102 100 MagLimitValue = i*dMag + MagMin; 103 if (VERBOSE) fprintf (stderr, "using %d stars in mag range %f - %f\n", Nsum, MinMagValue, MagLimitValue);101 if (VERBOSE) fprintf (stderr, "using %d (Nmax %d) stars in mag range %f - %f\n", Nsum, Nmax, MinMagValue, MagLimitValue); 104 102 } 105 103 -
branches/eam_branches/ipp-20121219/Ohana/src/libohana/src
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20121219/Ohana/src/opihi
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20121219/Ohana/src/opihi/cmd.astro
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20121219/Ohana/src/opihi/cmd.data
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20121219/dbconfig/changes.txt
r34789 r35096 2265 2265 ALTER TABLE skycalResult ADD column n_forced INT after n_extended; 2266 2266 UPDATE dbversion set schema_version = '1.1.73', updated= CURRENT_TIMESTAMP(); 2267 2268 2269 -- new tables for managing the "release" of ipp data 2270 2271 CREATE TABLE survey ( 2272 surveyID INT(8), 2273 surveyName VARCHAR(16) NOT NULL, 2274 description VARCHAR(255), 2275 PRIMARY KEY(surveyID), 2276 UNIQUE KEY(surveyName) 2277 ) ENGINE=InnoDB CHARSET=latin1; 2278 2279 2280 CREATE TABLE ippRelease ( 2281 rel_id INT(8) AUTO_INCREMENT, 2282 surveyID INT(8), 2283 releaseName VARCHAR(64), 2284 release_state VARCHAR(16), -- active, pending archive drop 2285 dataRelease INT(8), -- PSPS dataRelease 2286 PRIMARY KEY(rel_id), 2287 KEY(releaseName), 2288 KEY(state), 2289 FOREIGN KEY(surveyID) REFERENCES survey(surveyID) 2290 ) ENGINE=Innodb DEFAULT CHARSET=latin1; 2291 2292 CREATE TABLE relExp ( 2293 relexp_id BIGINT AUTO_INCREMENT, 2294 rel_id INT(8), 2295 exp_id BIGINT, 2296 chip_id BIGINT, -- links to the runs that supplied the data 2297 cam_id BIGINT, -- for this release 2298 state VARCHAR(16), -- released, pending, archive, drop 2299 flags INT UNSIGNED, -- flags for relphot, relastro, ?? 2300 zpt_obs FLOAT, -- calibrated zero point for this release of 2301 zpt_stdev FLOAT, -- this exposure 2302 path_base VARCHAR(255), -- path_base of any supporting files for this 2303 -- release of this exposure. 2304 registered DATETIME, -- insertion time for this row 2305 time_stamp DATETIME, -- time of last update for this row 2306 PRIMARY KEY (relexp_id), 2307 FOREIGN KEY(rel_id) REFERENCES ippRelease(rel_id), 2308 KEY (state), 2309 FOREIGN KEY(exp_id) REFERENCES rawExp(exp_id), 2310 FOREIGN KEY(chip_id) REFERENCES chipRun(chip_id), 2311 FOREIGN KEY(cam_id) REFERENCES camRun(cam_id) 2312 ) ENGINE=innodb DEFAULT CHARSET=latin1; 2313 2314 CREATE TABLE relStack ( 2315 relstack_id BIGINT AUTO_INCREMENT, 2316 rel_id INT(8), 2317 skycal_id BIGINT, -- id of the sky calibration run that supplied the calibration 2318 -- for this release. We get back to stack from here 2319 skycell_id varchar(64), 2320 tess_id varchar(64), 2321 state VARCHAR(16), -- released, pending, archive, drop 2322 flags INT UNSIGNED, 2323 stack_type VARCHAR(16), -- nightly, deep, reference 2324 zpt_obs FLOAT, -- calibrated zero point for this release of this skycell 2325 zpt_stdev FLOAT, 2326 fwhm_major FLOAT, -- seeing as measured by staticsky 2327 path_base VARCHAR(255), -- path_base of any supporting files, 2328 registered DATETIME, 2329 time_stamp DATETIME, 2330 PRIMARY KEY (relstack_id), 2331 KEY (tess_id, skycell_id), 2332 KEY (rel_id, tess_id, skycell_id), 2333 FOREIGN KEY(rel_id) REFERENCES ippRelease(rel_id), 2334 FOREIGN KEY(skycal_id) REFERENCES skycalRun(skycal_id) 2335 ) ENGINE=innodb DEFAULT CHARSET=latin1; 2336 2337 UPDATE dbversion set schema_version = '1.1.74', updated= CURRENT_TIMESTAMP(); -
branches/eam_branches/ipp-20121219/dbconfig/ipp.m4
r33720 r35096 39 39 include(vp.md) 40 40 include(skycell.md) 41 include(release.md) -
branches/eam_branches/ipp-20121219/ippMonitor
- Property svn:mergeinfo changed
/trunk/ippMonitor merged: 34904,34930-34931
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20121219/ippMonitor/Makefile.in
r34903 r35096 215 215 $(DESTWWW)/simplePlotStackImage.php \ 216 216 $(DESTWWW)/simplePlotStaticskyImage.php \ 217 $(DESTWWW)/newsimplePlotStaticskyImage.php \218 217 $(DESTWWW)/simplePlotSkycalImage.php \ 219 218 $(DESTWWW)/histogramBackgroundImage.php \ -
branches/eam_branches/ipp-20121219/ippMonitor/czartool/czarDbSchema.sql
r33434 r35096 78 78 `total` float default NULL, 79 79 `available` float default NULL, 80 `usable` float default NULL, 80 81 `used` float default NULL, 81 82 `hostsOver98` smallint(6) default NULL, -
branches/eam_branches/ipp-20121219/ippMonitor/czartool/czartool/CzarDb.pm
r34096 r35096 9 9 10 10 my @stages = ( 11 "chip", 12 "cam", 13 "fake", 14 "warp", 15 "stack", 16 "diff", 17 "dist", 11 "chip", 12 "cam", 13 "fake", 14 "warp", 15 "stack", 16 "diff", 17 "dist", 18 18 "pub", 19 19 "chipbackground"); # TODO put elsewhere … … 64 64 SELECT DISTINCT label 65 65 FROM processed 66 WHERE timestamp >= '$begin' 67 AND timestamp <= '$end' 66 WHERE timestamp >= '$begin' 67 AND timestamp <= '$end' 68 68 SQL 69 69 … … 109 109 110 110 SELECT DISTINCT label 111 FROM chip 112 WHERE timestamp >= '$begin' 113 AND timestamp <= '$end' 111 FROM chip 112 WHERE timestamp >= '$begin' 113 AND timestamp <= '$end' 114 114 AND label NOT LIKE '%_ud%' 115 115 AND label NOT LIKE 'update%' … … 153 153 154 154 my $query = $self->{_db}->prepare(<<SQL); 155 SELECT reverting 155 SELECT reverting 156 156 FROM reverts 157 WHERE stage LIKE '$stage'; 157 WHERE stage LIKE '$stage'; 158 158 SQL 159 159 … … 171 171 172 172 my $query = $self->{_db}->prepare(<<SQL); 173 UPDATE reverts 174 SET reverting = $reverting 173 UPDATE reverts 174 SET reverting = $reverting 175 175 WHERE stage LIKE '$stage'; 176 176 SQL … … 188 188 189 189 my $query = $self->{_db}->prepare(<<SQL); 190 UPDATE current_labels 191 SET priority = $priority 192 WHERE label LIKE '$label' 190 UPDATE current_labels 191 SET priority = $priority 192 WHERE label LIKE '$label' 193 193 AND server LIKE 'stdscience'; 194 194 SQL … … 323 323 ########################################################################### 324 324 sub insertNewClusterSpace { 325 my ($self, $total, $available, $us ed, $hostsOver98) = @_;325 my ($self, $total, $available, $usable, $used, $hostsOver98) = @_; 326 326 327 327 my $query = $self->{_db}->prepare(<<SQL); 328 328 INSERT INTO cluster_space 329 (total, available, us ed, hostsOver98)329 (total, available, usable, used, hostsOver98) 330 330 VALUES 331 ( $total, $available, $us ed, $hostsOver98);331 ( $total, $available, $usable, $used, $hostsOver98); 332 332 SQL 333 333 … … 362 362 363 363 my $query = $self->{_db}->prepare(<<SQL); 364 SELECT 365 DATE_FORMAT(MAX(timestamp),'$self->{_dateFormat}'), 364 SELECT 365 DATE_FORMAT(MAX(timestamp),'$self->{_dateFormat}'), 366 366 DATE_FORMAT(MIN(timestamp),'$self->{_dateFormat}'), 367 367 TIME_TO_SEC(TIMEDIFF(max(timestamp ), min(timestamp))) 368 FROM $stage 368 FROM $stage 369 369 WHERE label LIKE '$label' 370 AND timestamp >= '$fromTime' AND timestamp <= '$toTime'; 370 AND timestamp >= '$fromTime' AND timestamp <= '$toTime'; 371 371 SQL 372 372 … … 413 413 ########################################################################### 414 414 # 415 # Analysis this stage between these times 415 # Analysis this stage between these times 416 416 # 417 417 ########################################################################### … … 429 429 430 430 my $query = $self->{_db}->prepare(<<SQL); 431 SELECT 432 timestamp, pending, faults, processed 433 FROM $stage 434 WHERE label LIKE '$label' 435 AND timestamp >= '$fromTime' AND timestamp <= '$toTime' 431 SELECT 432 timestamp, pending, faults, processed 433 FROM $stage 434 WHERE label LIKE '$label' 435 AND timestamp >= '$fromTime' AND timestamp <= '$toTime' 436 436 ORDER BY timestamp; 437 437 SQL … … 452 452 # get linear values 453 453 if($lastProcessed != -1 && $thisProcessed > $lastProcessed) { 454 454 455 455 $totalProcessed = $totalProcessed + ($thisProcessed - $lastProcessed); 456 456 } … … 480 480 my $started = undef; 481 481 my $finished = undef; 482 482 483 483 my ($have25, $have50, $have75, $have90, $have95, $have100) = 0; 484 484 … … 492 492 # get linear values 493 493 if($lastProcessed != -1 && $thisProcessed > $lastProcessed) { 494 494 495 495 $linearProcessed = $linearProcessed + ($thisProcessed - $lastProcessed); 496 496 } … … 508 508 509 509 my $timeDiff = $self->diffTimesInSecs($thisTimestamp, $lastTimestamp) + 0.001; 510 510 511 511 if ($thisProcessed >= $lastProcessed){ 512 $derivProcessed = abs($thisProcessed - $lastProcessed)/$timeDiff; 512 $derivProcessed = abs($thisProcessed - $lastProcessed)/$timeDiff; 513 513 } 514 514 else {$derivProcessed = 0;} 515 $derivPending = abs($thisPending - $lastPending)/$timeDiff; 516 $derivFaults = abs($thisFaults - $lastFaults)/$timeDiff; 515 $derivPending = abs($thisPending - $lastPending)/$timeDiff; 516 $derivFaults = abs($thisFaults - $lastFaults)/$timeDiff; 517 517 } 518 518 else { 519 519 520 520 $derivProcessed = 0; 521 521 $derivPending = 0; … … 539 539 else { 540 540 if (defined $notProcessing) { 541 542 $notProcessing = undef; 543 $stuck = undef; 541 542 $notProcessing = undef; 543 $stuck = undef; 544 544 } 545 545 if (!defined $started) { 546 546 547 547 $started = $lastTimestamp; 548 $finished = undef; 548 $finished = undef; 549 549 } 550 550 } … … 564 564 # how long not processing? 565 565 if (defined $notProcessing) { 566 566 567 567 $howLongNotProcessing = $self->diffTimes($lastTimestamp, $notProcessing); 568 568 $notProcessingLongerThanInterval = $self->isBefore($interval, $howLongNotProcessing); 569 569 } 570 570 else { 571 571 572 572 $howLongNotProcessing = 0; 573 573 $notProcessingLongerThanInterval = 0; … … 611 611 612 612 if (!defined $started){ 613 613 614 614 $stageMetrics->setStarted(undef); 615 615 } 616 616 else { 617 617 618 618 my $rate = ($stageMetrics->getProcessed()/$self->getTimeInSecs($stageMetrics->getTotalTime) ) * 3600.0; 619 619 $stageMetrics->setRate($rate); … … 625 625 } 626 626 else { 627 627 628 628 $stageMetrics->setStuck(undef); 629 629 } … … 642 642 my $query = $self->{_db}->prepare(<<SQL); 643 643 SELECT COUNT(*) 644 FROM $stage 644 FROM $stage 645 645 WHERE label LIKE '$label' 646 AND timestamp >= '$fromTime' AND timestamp <= '$toTime'; 646 AND timestamp >= '$fromTime' AND timestamp <= '$toTime'; 647 647 SQL 648 648 … … 657 657 # grab all the data for the provided time range 658 658 $query = $self->{_db}->prepare(<<SQL); 659 SELECT 660 timestamp, pending, faults, processed 661 FROM $stage 662 WHERE label LIKE '$label' 663 AND timestamp >= '$fromTime' AND timestamp <= '$toTime' 659 SELECT 660 timestamp, pending, faults, processed 661 FROM $stage 662 WHERE label LIKE '$label' 663 AND timestamp >= '$fromTime' AND timestamp <= '$toTime' 664 664 ORDER BY timestamp; 665 665 SQL … … 724 724 $diffFaults = $thisFaults - $lastFaults; 725 725 726 # First, look for large positive jumps in processed, most likely a label 726 # First, look for large positive jumps in processed, most likely a label 727 727 # added, and store value to subtract from linear value below. If > 1000 728 728 # processed per hour, then it must be wrong … … 741 741 } 742 742 else { 743 743 744 744 $diffProcessed = 0; 745 745 $linearProcessed = $linearProcessed; … … 747 747 748 748 # calculate first derivative in units of images per hour 749 $derivPending = $diffPending/($timeSep/3600); 750 $derivFaults = $diffFaults/($timeSep/3600); 751 $derivProcessed = $diffProcessed/($timeSep/3600); 749 $derivPending = $diffPending/($timeSep/3600); 750 $derivFaults = $diffFaults/($timeSep/3600); 751 $derivProcessed = $diffProcessed/($timeSep/3600); 752 752 753 753 } 754 754 # first time in 755 755 else { 756 756 757 757 $derivPending = 0; 758 758 $derivFaults = 0; … … 777 777 my $totalPending = 0; 778 778 my $totalFaults = 0; 779 for (my $i=$size-1; $i>=($size - $range); $i--) { 780 779 for (my $i=$size-1; $i>=($size - $range); $i--) { 780 781 781 $totalPending = $totalPending + $ratePending[$i]; 782 782 $totalFaults = $totalFaults + $rateFaults[$i]; … … 833 833 # get earliest time for this label 834 834 my $query = $self->{_db}->prepare(<<SQL); 835 SELECT GREATEST(MIN(timestamp), now() - INTERVAL $interval) 835 SELECT GREATEST(MIN(timestamp), now() - INTERVAL $interval) 836 836 FROM $stage 837 WHERE label LIKE '$label'; 838 SQL 839 $query->execute; 840 841 my $timestamp = $query->fetchrow_array(); 837 WHERE label LIKE '$label'; 838 SQL 839 $query->execute; 840 841 my $timestamp = $query->fetchrow_array(); 842 842 843 843 $query = $self->{_db}->prepare(<<SQL); 844 SELECT faults 844 SELECT faults 845 845 FROM $stage 846 WHERE label LIKE '$label' 846 WHERE label LIKE '$label' 847 847 AND timestamp <= '$timestamp' LIMIT 1; 848 848 SQL … … 861 861 862 862 my $query = $self->{_db}->prepare(<<SQL); 863 SELECT pending - faults 864 FROM $stage 865 WHERE label LIKE '$label' 863 SELECT pending - faults 864 FROM $stage 865 WHERE label LIKE '$label' 866 866 ORDER BY timestamp DESC LIMIT 1; 867 867 SQL … … 880 880 881 881 my $query = $self->{_db}->prepare(<<SQL); 882 SELECT 883 pending, faults 882 SELECT 883 pending, faults 884 884 FROM $stage 885 885 WHERE label LIKE '$label' … … 890 890 if (!$query->execute) {return 0;} 891 891 892 (${$pending}, ${$faults}) = $query->fetchrow_array(); 892 (${$pending}, ${$faults}) = $query->fetchrow_array(); 893 893 894 894 ${$processed} = $self->countProcessed($label, $stage, $fromTime, $toTime); … … 912 912 913 913 my $query = $self->{_db}->prepare(<<SQL); 914 SELECT 915 host, used, available, writable, readable 914 SELECT 915 host, used, available, writable, readable 916 916 FROM hosts 917 917 ORDER BY host; … … 926 926 927 927 my ($host, $used, $available, $writable, $readable) = @row; 928 929 if (($used+$available) == 0) {930 $underLimit = 1;931 } elsif (($used/($used+$available))*100 > $limit) {932 $underLimit = 0;933 } else {934 $underLimit = 1;935 }928 929 if (($used+$available) == 0) { 930 $underLimit = 1; 931 } elsif (($used/($used+$available))*100 > $limit) { 932 $underLimit = 0; 933 } else { 934 $underLimit = 1; 935 } 936 936 937 937 # Col 1: host 938 938 print GNUDAT "$host"; 939 939 940 940 # Col 2: available, readable used space under limit 941 941 if ($readable && $underLimit) {print GNUDAT " $used";} … … 973 973 974 974 my $query = $self->{_db}->prepare(<<SQL); 975 SELECT used/total*100 976 FROM cluster_space 975 SELECT used/total*100 976 FROM cluster_space 977 977 ORDER BY timestamp DESC LIMIT 1; 978 978 SQL … … 983 983 ########################################################################### 984 984 # 985 # Gets time series data for cluster storage and saves it to file 985 # Gets time series data for cluster storage and saves it to file 986 986 # 987 987 ########################################################################### 988 988 sub createStorageTimeSeriesData { 989 989 my ($self, $tmpFile, $fromTime, $toTime, $minX, $maxX, $minY, $maxY, $timeDiff) = @_; 990 my $maxAvailable; 991 my $maxUsable; 992 my $minAvailable; 993 my $minUsable; 990 994 991 995 open (GNUDAT, ">".$tmpFile->filename); 992 996 993 997 my $query = $self->{_db}->prepare(<<SQL); 994 SELECT 995 MAX(available), MIN(available), 996 DATE_FORMAT(MAX(timestamp),'$self->{_dateFormat}'), 998 SELECT 999 MAX(available), MIN(available), MAX(usable), MIN(usable), 1000 DATE_FORMAT(MAX(timestamp),'$self->{_dateFormat}'), 997 1001 DATE_FORMAT(MIN(timestamp),'$self->{_dateFormat}'), 998 1002 TIME_TO_SEC(TIMEDIFF(max(timestamp ), min(timestamp))) 999 FROM cluster_space 1000 WHERE timestamp >= '$fromTime' AND timestamp <= '$toTime'; 1003 FROM cluster_space 1004 WHERE timestamp >= '$fromTime' AND timestamp <= '$toTime'; 1001 1005 SQL 1002 1006 1003 1007 if (!$query->execute) {return undef;} 1004 1008 1005 (${$maxY}, ${$minY}, ${$maxX}, ${$minX}, ${$timeDiff}) = $query->fetchrow_array(); 1006 1009 ($maxAvailable, $minAvailable, $maxUsable, $minUsable, ${$maxX}, ${$minX}, ${$timeDiff}) = $query->fetchrow_array(); 1010 ${$maxY} = ($maxAvailable > $maxUsable ? $maxAvailable : $maxUsable); 1011 ${$minY} = ($minAvailable > $minUsable ? $minAvailable : $minUsable); 1007 1012 1008 1013 if (!${$maxY} || !${$minY} || !${$maxX} || !${$minX} || !${$timeDiff}) {return 0;} 1009 1014 1010 1015 $query = $self->{_db}->prepare(<<SQL); 1011 SELECT 1012 DATE_FORMAT(timestamp, '$self->{_dateFormat}'), available 1013 FROM cluster_space 1014 WHERE timestamp >= '$fromTime' AND timestamp <= '$toTime' 1016 SELECT 1017 DATE_FORMAT(timestamp, '$self->{_dateFormat}'), available, usable 1018 FROM cluster_space 1019 WHERE timestamp >= '$fromTime' AND timestamp <= '$toTime' 1015 1020 ORDER BY timestamp; 1016 1021 SQL … … 1021 1026 while (my @row = $query->fetchrow_array()) { 1022 1027 1023 my ($timestamp, $available ) = @row;1024 print GNUDAT "$timestamp $available \n";1028 my ($timestamp, $available, $usable) = @row; 1029 print GNUDAT "$timestamp $available $usable\n"; 1025 1030 } 1026 1031 … … 1074 1079 ########################################################################### 1075 1080 # 1076 # Gets count of processed stuff in a given time period 1081 # Gets count of processed stuff in a given time period 1077 1082 # 1078 1083 ########################################################################### … … 1081 1086 1082 1087 my $query = $self->{_db}->prepare(<<SQL); 1083 SELECT 1084 processed 1088 SELECT 1089 processed 1085 1090 FROM $stage 1086 WHERE label LIKE '$label' 1087 AND timestamp >= '$begin' 1088 AND timestamp < '$end' 1091 WHERE label LIKE '$label' 1092 AND timestamp >= '$begin' 1093 AND timestamp < '$end' 1089 1094 SQL 1090 1095 $query->execute; … … 1168 1173 1169 1174 $query = $self->{_db}->prepare(<<SQL); 1170 SELECT COUNT(*) 1171 FROM $stage 1175 SELECT COUNT(*) 1176 FROM $stage 1172 1177 WHERE timestamp > '$fromTime' 1173 1178 AND timestamp <= '$toTime' 1174 AND label = '$label' 1179 AND label = '$label' 1175 1180 SQL 1176 1181 … … 1181 1186 1182 1187 $query = $self->{_db}->prepare(<<SQL); 1183 DELETE FROM $stage 1184 WHERE timestamp > '$fromTime' 1185 AND timestamp <= '$toTime' 1188 DELETE FROM $stage 1189 WHERE timestamp > '$fromTime' 1190 AND timestamp <= '$toTime' 1186 1191 AND label = '$label' ORDER BY timestamp DESC LIMIT $toDelete 1187 1192 SQL … … 1203 1208 1204 1209 $query = $self->{_db}->prepare(<<SQL); 1205 SELECT COUNT(*) 1206 FROM servers 1210 SELECT COUNT(*) 1211 FROM servers 1207 1212 WHERE timestamp > '$fromTime' 1208 1213 AND timestamp <= '$toTime' 1209 AND server = '$server' 1214 AND server = '$server' 1210 1215 SQL 1211 1216 $query->execute; … … 1215 1220 1216 1221 $query = $self->{_db}->prepare(<<SQL); 1217 DELETE FROM servers 1218 WHERE timestamp > '$fromTime' 1219 AND timestamp <= '$toTime' 1222 DELETE FROM servers 1223 WHERE timestamp > '$fromTime' 1224 AND timestamp <= '$toTime' 1220 1225 AND server = '$server' ORDER BY timestamp DESC LIMIT $toDelete 1221 1226 SQL … … 1229 1234 # now deal with cluster_space table 1230 1235 $query = $self->{_db}->prepare(<<SQL); 1231 SELECT COUNT(*) 1232 FROM cluster_space 1236 SELECT COUNT(*) 1237 FROM cluster_space 1233 1238 WHERE timestamp > '$fromTime' 1234 1239 AND timestamp <= '$toTime' … … 1240 1245 1241 1246 $query = $self->{_db}->prepare(<<SQL); 1242 DELETE FROM cluster_space 1243 WHERE timestamp > '$fromTime' 1244 AND timestamp <= '$toTime' 1247 DELETE FROM cluster_space 1248 WHERE timestamp > '$fromTime' 1249 AND timestamp <= '$toTime' 1245 1250 ORDER BY timestamp DESC LIMIT $toDelete 1246 1251 SQL … … 1257 1262 ########################################################################### 1258 1263 # 1259 # Optimizes all tables that need to be optimized 1264 # Optimizes all tables that need to be optimized 1260 1265 # 1261 1266 ########################################################################### … … 1275 1280 ########################################################################### 1276 1281 # 1277 # Returns if a particular server has been stopped for a certain interval 1282 # Returns if a particular server has been stopped for a certain interval 1278 1283 # 1279 1284 ########################################################################### … … 1286 1291 ########################################################################### 1287 1292 # 1288 # Returns if a particular server has been down for a certain interval 1293 # Returns if a particular server has been down for a certain interval 1289 1294 # 1290 1295 ########################################################################### … … 1297 1302 ########################################################################### 1298 1303 # 1299 # Returns if a particular server has been down for a certain interval 1304 # Returns if a particular server has been down for a certain interval 1300 1305 # 1301 1306 ########################################################################### … … 1304 1309 1305 1310 my $query = $self->{_db}->prepare(<<SQL); 1306 SELECT COUNT(*) 1311 SELECT COUNT(*) 1307 1312 FROM servers 1308 WHERE server = '$server' 1313 WHERE server = '$server' 1309 1314 AND timestamp > now() - INTERVAL $interval 1310 1315 SQL … … 1316 1321 1317 1322 $query = $self->{_db}->prepare(<<SQL); 1318 SELECT COUNT(*) 1323 SELECT COUNT(*) 1319 1324 FROM servers 1320 WHERE server = '$server' 1325 WHERE server = '$server' 1321 1326 AND timestamp > now() - INTERVAL $interval 1322 1327 AND !$mode … … 1329 1334 1330 1335 $query = $self->{_db}->prepare(<<SQL); 1331 SELECT 1336 SELECT 1332 1337 timestamp 1333 1338 FROM servers 1334 1339 WHERE server = '$server' 1335 AND $mode 1336 ORDER BY timestamp DESC 1340 AND $mode 1341 ORDER BY timestamp DESC 1337 1342 LIMIT 1 1338 1343 … … 1346 1351 ########################################################################### 1347 1352 # 1348 # Returns an array of servers 1353 # Returns an array of servers 1349 1354 # 1350 1355 ########################################################################### … … 1369 1374 ########################################################################### 1370 1375 # 1371 # Returns an array of labels present during the provided time frame 1376 # Returns an array of labels present during the provided time frame 1372 1377 # 1373 1378 ########################################################################### … … 1376 1381 1377 1382 my $query = $self->{_db}->prepare(<<SQL); 1378 SELECT DISTINCT label 1379 FROM $stage 1380 WHERE timestamp > '$fromTime' 1383 SELECT DISTINCT label 1384 FROM $stage 1385 WHERE timestamp > '$fromTime' 1381 1386 AND timestamp <= '$toTime'; 1382 1387 SQL -
branches/eam_branches/ipp-20121219/ippMonitor/czartool/czartool/Nebulous.pm
r34096 r35096 28 28 ########################################################################### 29 29 # 30 # Converts Kb to Tb 31 # 30 # Converts Kb to Tb 31 # 32 32 ########################################################################### 33 33 sub convertKbToTb { … … 50 50 ########################################################################### 51 51 # 52 # Returns total cluster usage in T 52 # Returns total cluster usage in T 53 53 # 54 54 ########################################################################### … … 61 61 ########################################################################### 62 62 # 63 # Returns total cluster space in T 63 # Returns total cluster space in T 64 64 # 65 65 ########################################################################### … … 72 72 ########################################################################### 73 73 # 74 # Returns total cluster available in T 74 # Returns total cluster available in T 75 75 # 76 76 ########################################################################### … … 83 83 ########################################################################### 84 84 # 85 # Runs neb-df and puts output in gnuplot ready format 85 # Runs neb-df and puts output in gnuplot ready format 86 86 # 87 87 ########################################################################### … … 93 93 $self->{_totalHosts} = 0; 94 94 $self->{_hostsOverNinetyEightPC} = 0; 95 $self->{_totalUsable} = 0; 95 96 my $readable; 96 97 my $writable; … … 100 101 if ($line =~ m/.*Filesystem.*/i) {next;} 101 102 elsif ($line =~ m/.*summmary.*/i) {next;} 102 elsif ($line =~ m/.*total.*/i) {next;} 103 elsif ($line =~ m/\s+[0-9]+\s+([0-9]+)\s+([0-9]+)\s+.*allocated.*/i) { 103 elsif ($line =~ m/\s+[0-9]+\s+([0-9]+)\s+([0-9]+)\s+.*total.*/i) { 104 $self->{_totalUsable} += $self->convertKbToTb($2); 105 } elsif ($line =~ m/\s+[0-9]+\s+([0-9]+)\s+([0-9]+)\s+.*allocated.*/i) { 104 106 105 107 $self->{_totalUsed} = $self->convertKbToTb($1); … … 109 111 110 112 next; 111 } 112 elsif (($line =~ m/(ipp[0-9]+\.[0-9]{1})\s.+[0-9]+\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)%.*/i)|| 113 ($line =~ m/(ippb[0-9]+\.[0-9]{1})\s.+[0-9]+\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)%.*/i) || 114 ($line =~ m/(stsci0[0-9]+\.[0-9]{1})\s.+[0-9]+\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)%.*/i)) { 115 113 } elsif (($line =~ m/(ipp[0-9]+\.[0-9]{1})\s.+[0-9]+\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)%.*/i)|| 114 ($line =~ m/(ippb[0-9]+\.[0-9]{1})\s.+[0-9]+\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)%.*/i) || 115 ($line =~ m/(stsci0[0-9]+\.[0-9]{1})\s.+[0-9]+\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)%.*/i)) { 116 116 117 $self->{_totalHosts}++; 117 118 if ($4 >= 98) {$self->{_hostsOverNinetyEightPC}++;} … … 119 120 $self->getReadableWritableStatus($1, \$readable, \$writable); 120 121 121 $self->{_czarDb}->updateHost($1, 122 $self->convertKbToTb($2+$3), 123 $self->convertKbToTb($3), 124 $self->convertKbToTb($2), 122 $self->{_czarDb}->updateHost($1, 123 $self->convertKbToTb($2+$3), 124 $self->convertKbToTb($3), 125 $self->convertKbToTb($2), 125 126 $readable, $writable); 126 127 } … … 128 129 129 130 $self->{_czarDb}->insertNewClusterSpace( 130 $self->{_totalCluster}, 131 $self->{_totalAvail}, 132 $self->{_totalUsed}, 131 $self->{_totalCluster}, 132 $self->{_totalAvail}, 133 $self->{_totalUsable}, 134 $self->{_totalUsed}, 133 135 $self->{_hostsOverNinetyEightPC}); 134 136 } … … 136 138 ########################################################################### 137 139 # 138 # Runs neb-host and readable/writable status for this host 140 # Runs neb-host and readable/writable status for this host 139 141 # 140 142 ########################################################################### -
branches/eam_branches/ipp-20121219/ippMonitor/czartool/czartool/Plotter.pm
r34249 r35096 630 630 set xlabel "Time" 631 631 set ylabel "Available (TB)" 632 plot "$datFile" using 1:2 title "Available" with lines lt 2 lw 2 632 plot "$datFile" using 1:2 title "Available" with lines lt 2 lw 2, "$datFile" using 1:3 title "Theoretical" with lines lt 3 lw 2 633 633 PLOT 634 634 -
branches/eam_branches/ipp-20121219/ippScripts/scripts/camera_exp.pl
r33576 r35096 41 41 42 42 my ( $exp_tag, $cam_id, $camera, $outroot, $dbname, $reduction, $dvodb, $verbose, $no_update, 43 $no_op, $redirect, $save_temps, $run_state, $skip_binned, $skip_masks );43 $no_op, $redirect, $save_temps, $run_state, $skip_binned, $skip_masks, $bkg_only); 44 44 GetOptions( 45 45 'exp_tag=s' => \$exp_tag, # Exposure identifier … … 53 53 'skip-binned' => \$skip_binned, # override recipe - don't create binned images 54 54 'skip-refmask' => \$skip_masks, # override recipe - don't create refmask 55 'bkg-only' => \$bkg_only, # override recipe - only do background continuity 55 56 'verbose' => \$verbose, # Print to stdout 56 57 'no-update' => \$no_update, # Update the database? … … 111 112 &my_die("Unrecognised PSASTRO recipe", $cam_id, $PS_EXIT_CONFIG_ERROR) unless defined $recipe_psastro; 112 113 114 my $bkg_recipe = 'PPIMAGE_BKGCONT'; # Add to reduction? 113 115 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 114 116 … … 215 217 my ($list4File, $list4Name) = tempfile( "/tmp/$exp_tag.cm.$cam_id.b4.list.XXXX", UNLINK => !$save_temps ); # For astrometry 216 218 219 ### Create temp file for background models 220 my ($list5File, $list5Name) = tempfile( "/tmp/$exp_tag.cm.$cam_id.b5.list.XXXX", UNLINK => !$save_temps ); # For background models 221 217 222 # XXX we perform astrometry iff photometry output exists 218 223 my @outMasks; # Names of output masks 224 my @bkg_models; # Names of output background models 219 225 foreach my $file (@$files) { 220 226 next if $file->{quality} != 0; … … 226 232 my $chipObjects = $ipprc->filename("PSPHOT.OUTPUT", $file->{path_base}, $class_id); 227 233 my $chipMask = $ipprc->filename("PPIMAGE.CHIP.MASK", $file->{path_base}, $class_id); 228 234 229 235 print $list1File ($ipprc->filename("PPIMAGE.BIN1", $file->{path_base}, $class_id) . "\n"); 230 236 print $list2File ($ipprc->filename("PPIMAGE.BIN2", $file->{path_base}, $class_id) . "\n"); 231 237 print $list3File ($chipObjects . "\n"); 232 238 print $list4File ($chipMask . "\n"); 239 print $list5File ($ipprc->filename("PSPHOT.BACKMDL", $file->{path_base}, $class_id) . "\n"); 233 240 234 241 push @outMasks, prepare_output("PSASTRO.OUTPUT.MASK", $outroot, $class_id, 1) if $produceMasks; 242 push @bkg_models, prepare_output("PPIMAGE.BACKMDL", $outroot, $class_id, 1); 235 243 } 236 244 close $list1File; … … 238 246 close $list3File; 239 247 close $list4File; 240 248 close $list5File; 241 249 # Output products 242 250 $ipprc->outroot_prepare($outroot); … … 291 299 } 292 300 293 {301 if (!$bkg_only) { 294 302 # run psastro on the chipObjects, producing fpaObjects 295 303 my $command; … … 353 361 } 354 362 } 363 } 364 # Construct FPA continuity corrected background images 365 { 366 my $command; 367 $command = "$ppImage"; 368 $command .= " -list $list5Name $outroot"; 369 $command .= " -recipe PPIMAGE $bkg_recipe"; 370 $command .= " -dbname $dbname" if defined $dbname; 371 372 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 373 run(command => $command, verbose => $verbose); 374 unless ($success) { 375 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 376 &my_die("Unable to perform ppImage to fix background: $error_code", $cam_id, $error_code); 377 } 378 foreach my $bkgModel (@bkg_models) { 379 check_output($bkgModel, $replicateOutputs); 380 } 355 381 } 356 382 } -
branches/eam_branches/ipp-20121219/ippScripts/scripts/destreak_restore_camera.pl
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20121219/ippScripts/scripts/ipp_apply_burntool_single.pl
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20121219/ippScripts/scripts/ipp_cleanup.pl
r34903 r35096 65 65 &my_die("Unable to redirect ouput", $stage, $stage_id, $PS_EXIT_UNKNOWN_ERROR) if $logfile; 66 66 67 68 my $hostname = `hostname`; 69 chomp $hostname; 70 print STDERR "starting cleanup for $stage $stage_id on $hostname\n" ; 71 72 my $nebulous_server; 67 73 68 74 my $bzip2 = can_run('bzip2') or die 'cannot find bzip2\n'; … … 2280 2286 if (my $resolved = $ipprc->file_resolve($filename)) { 2281 2287 my $bzip2_filename = $filename . '.bz2'; 2282 if ($ipprc->file_exists($bzip2_filename)) { 2283 $ipprc->kill_file($bzip2_filename); 2284 } 2288 if (file_scheme($bzip2_filename) eq 'neb') { 2289 # XXX: GRRRR $ipprc->file_exists() returns false if storage object exists but instance has 2290 # size of zero 2291 $nebulous_server = $ipprc->nebulous() if !$nebulous_server; 2292 if ($nebulous_server->storage_object_exists($bzip2_filename)) { 2293 print STDERR "$bzip2_filename exists, killing\n"; 2294 $ipprc->kill_file($bzip2_filename); 2295 } else { 2296 print STDERR "$bzip2_filename does not exist\n" if $very_verbose; 2297 } 2298 } else { 2299 if ($ipprc->file_exists($bzip2_filename)) { 2300 print STDERR "$bzip2_filename exists, killing\n"; 2301 $ipprc->kill_file($bzip2_filename); 2302 } else { 2303 print STDERR "$bzip2_filename does not exist\n" if $very_verbose; 2304 } 2305 } 2285 2306 my $bzip2_file = $ipprc->file_create($bzip2_filename); 2286 my_die("Unable to create $bzip2_filename", $stage_id, $ PS_EXIT_SYS_ERROR) unless $bzip2_file;2307 my_die("Unable to create $bzip2_filename", $stage_id, $stage_id, $PS_EXIT_SYS_ERROR) unless $bzip2_file; 2287 2308 2288 2309 my $command = "$bzip2 < $resolved > $bzip2_file"; -
branches/eam_branches/ipp-20121219/ippScripts/scripts/magic_destreak.pl
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20121219/ippTasks
- Property svn:mergeinfo changed
/trunk/ippTasks merged: 34976
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20121219/ippTasks/survey.pro
r34828 r35096 1529 1529 # note: currently skycal uses the staticskyRun workdir 1530 1530 1531 $run = staticskytool -defineskycalrun -se lect_label $label -set_dist_group $dist_group1531 $run = staticskytool -defineskycalrun -set_label $label -select_label $label -set_dist_group $dist_group 1532 1532 1533 1533 if ($DB:n == 0) -
branches/eam_branches/ipp-20121219/ippToPsps
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20121219/ippTools/share/Makefile.am
r34800 r35096 461 461 vptool_processedcell.sql \ 462 462 vptool_revertrun.sql \ 463 sctool_list.sql 463 sctool_list.sql \ 464 releasetool_listsurvey.sql \ 465 releasetool_listrelease.sql \ 466 releasetool_listrelexp.sql \ 467 releasetool_definerelexp.sql 464 468 -
branches/eam_branches/ipp-20121219/ippTools/share/bgtool_definechip.sql
r32680 r35096 3 3 FROM chipRun 4 4 JOIN rawExp USING(exp_id) 5 JOIN camRun USING(chip_id) 6 JOIN camProcessedExp USING(cam_id) 5 7 LEFT JOIN chipBackgroundRun USING(chip_id) 6 8 WHERE chipRun.state = 'full' 9 AND camRun.state = 'full' 10 AND camProcessedExp.quality = 0 -
branches/eam_branches/ipp-20121219/ippTools/share/camtool_find_pendingimfile.sql
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20121219/ippTools/share/chiptool_setimfiletoupdate.sql
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20121219/ippTools/share/pxadmin_create_tables.sql
- Property svn:mergeinfo changed
/trunk/ippTools/share/pxadmin_create_tables.sql merged: 34912,35048
r34903 r35096 2148 2148 ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 2149 2149 2150 2151 -- This comment line is here to avoid empty query error. 2150 CREATE TABLE survey ( 2151 surveyID INT(8), 2152 surveyName VARCHAR(16) NOT NULL, 2153 description VARCHAR(255), 2154 PRIMARY KEY(surveyID), 2155 UNIQUE KEY(name) 2156 ) ENGINE=InnoDB CHARSET=latin1; 2157 2158 2159 CREATE TABLE ippRelease ( 2160 rel_id INT(8) AUTO_INCREMENT, 2161 surveyID INT(8), 2162 releaseName VARCHAR(64), 2163 relase_state VARCHAR(16), -- active, pending, archive, drop 2164 dataRelease INT(8), -- PSPS dataRelease 2165 priority INT(8), 2166 PRIMARY KEY(rel_id), 2167 KEY(releaseName), 2168 KEY(state), 2169 KEY(priority), 2170 FOREIGN KEY(surveyID) REFERENCES survey(surveyID) 2171 ) ENGINE=Innodb DEFAULT CHARSET=latin1; 2172 2173 CREATE TABLE relExp ( 2174 relexp_id BIGINT AUTO_INCREMENT, 2175 rel_id INT(8), 2176 exp_id BIGINT, 2177 chip_id BIGINT, -- links to the runs that supplied the data 2178 cam_id BIGINT, -- for this release 2179 state VARCHAR(16), -- released, pending, archive, drop 2180 flags INT UNSIGNED, -- flags for relphot, relastro, ?? 2181 zpt_obs FLOAT, -- calibrated zero point for this release of 2182 zpt_stdev FLOAT, -- this exposure 2183 path_base VARCHAR(255), -- path_base of any supporting files for this 2184 -- release of this exposure. 2185 registered DATETIME, -- insertion time for this row 2186 time_stamp DATETIME, -- time of last update for this row 2187 PRIMARY KEY (relexp_id), 2188 FOREIGN KEY(rel_id) REFERENCES ippRelease(rel_id), 2189 KEY (state), 2190 FOREIGN KEY(exp_id) REFERENCES rawExp(exp_id), 2191 FOREIGN KEY(chip_id) REFERENCES chipRun(chip_id), 2192 FOREIGN KEY(cam_id) REFERENCES camRun(cam_id) 2193 ) ENGINE=innodb DEFAULT CHARSET=latin1; 2194 2195 CREATE TABLE relStack ( 2196 relstack_id BIGINT AUTO_INCREMENT, 2197 rel_id INT(8), 2198 skycal_id BIGINT, -- id of the sky calibration run that supplied the calibration 2199 -- for this release. We get back to stack from here 2200 skycell_id varchar(64), 2201 tess_id varchar(64), 2202 state VARCHAR(16), -- released, pending, archive, drop 2203 flags INT UNSIGNED, 2204 stack_type VARCHAR(16), -- nightly, deep, reference 2205 zpt_obs FLOAT, -- calibrated zero point for this release of this skycell 2206 zpt_stdev FLOAT, 2207 fwhm_major FLOAT, -- seeing as measured by staticsky 2208 path_base VARCHAR(255), -- path_base of any supporting files, 2209 registered DATETIME, 2210 time_stamp DATETIME, 2211 PRIMARY KEY (relstack_id), 2212 KEY (tess_id, skycell_id), 2213 KEY (rel_id, tess_id, skycell_id), 2214 FOREIGN KEY(rel_id) REFERENCES ippRelease(rel_id), 2215 FOREIGN KEY(skycal_id) REFERENCES skycalRun(skycal_id) 2216 ) ENGINE=innodb DEFAULT CHARSET=latin1; 2217 2218 2219 2220 -- These comment lines are here to avoid an empty query error. 2152 2221 -- Another way to avoid that problem is to omit the semicolon above but I think that is untidy. - Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20121219/ippTools/share/pxadmin_drop_tables.sql
r33720 r35096 109 109 DROP TABLE IF EXISTS skycalResult; 110 110 DROP TABLE IF EXISTS skycell; 111 DROP TABLE IF EXISTS relExp; 112 DROP TABLE IF EXISTS ippRelease; 113 DROP TABLE IF EXISTS survey; 111 114 112 115 SET FOREIGN_KEY_CHECKS=1 -
branches/eam_branches/ipp-20121219/ippTools/share/stacktool_tobkg.sql
r34800 r35096 25 25 -- WHERE hook %s 26 26 GROUP BY stack_id 27 HAVING (SUM(IF(warpRun.state = 'full', 1, 0)) = COUNT(stackInputSkyfile.warp_id) AND 27 HAVING ((SUM(IF(warpRun.state = 'cleaned', 1, 0)) = COUNT(stackInputSkyfile.warp_id) OR 28 SUM(IF(warpRun.state = 'full', 1, 0)) = COUNT(stackInputSkyfile.warp_id)) AND 28 29 SUM(IF(warpSkyfile.background_model = 1, 1, 0)) = COUNT(stackInputSkyfile.warp_id)) 29 30 -
branches/eam_branches/ipp-20121219/ippTools/share/staticskytool_defineskycalrun.sql
r34761 r35096 1 1 SELECT 2 s ky_id,3 stack _id,2 staticskyRun.sky_id, 3 stackRun.stack_id, 4 4 skycell_id, 5 5 filter, … … 14 14 JOIN stackSumSkyfile USING(stack_id) 15 15 JOIN skycell USING(tess_id, skycell_id) 16 LEFT JOIN skycalRun USING(sky_id, stack_id)16 LEFT JOIN skycalRun ON staticskyRun.sky_id = skycalRun.sky_id AND stackRun.stack_id = skycalRun.stack_id -- join hook %s 17 17 WHERE staticskyRun.state = 'full' 18 18 AND staticskyResult.quality = 0 -
branches/eam_branches/ipp-20121219/ippTools/share/staticskytool_revert.sql
r28154 r35096 1 1 DELETE FROM staticskyResult 2 USING staticskyResult, staticskyRun 2 USING staticskyResult, staticskyRun, staticskyInput, stackRun, skycell 3 3 WHERE staticskyRun.sky_id = staticskyResult.sky_id 4 AND staticskyRun.sky_id = staticskyInput.sky_id 5 AND staticskyInput.stack_id = stackRun.stack_id 6 AND stackRun.tess_id = skycell.tess_id 7 AND stackRun.skycell_id = skycell.skycell_id 4 8 AND staticskyRun.state = 'new' 5 9 AND staticskyResult.fault != 0 -
branches/eam_branches/ipp-20121219/ippTools/share/staticskytool_revertskycal.sql
r32962 r35096 1 1 DELETE FROM skycalResult 2 USING skycalResult, skycalRun, stackRun 2 USING skycalResult, skycalRun, stackRun, skycell 3 3 WHERE skycalRun.skycal_id = skycalResult.skycal_id 4 4 AND stackRun.stack_id = skycalRun.stack_id 5 5 AND skycalRun.state = 'new' 6 6 AND skycalResult.fault != 0 7 AND stackRun.tess_id = skycell.tess_id 8 AND stackRun.skycell_id = skycell.skycell_id -
branches/eam_branches/ipp-20121219/ippTools/share/staticskytool_skycalresult.sql
r32962 r35096 2 2 skycalResult.*, 3 3 skycalRun.stack_id, 4 stackRun.tess_id,5 stackRun.skycell_id,6 4 stackRun.filter, 7 5 skycalRun.state, 8 6 skycalRun.label, 9 7 skycalRun.data_group, 10 skycalRun.sky_id 8 skycalRun.sky_id, 9 skycell.* 11 10 FROM skycalRun 12 11 JOIN skycalResult USING(skycal_id) 13 JOIN stackRun USING(stack_id) 14 12 JOIN stackRun USING(stack_id) 13 JOIN skycell USING(tess_id, skycell_id) -
branches/eam_branches/ipp-20121219/ippTools/share/warptool_towarped.sql
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20121219/ippTools/src
- Property svn:ignore
-
old new 46 46 vptool 47 47 sctool 48 releasetool
-
- Property svn:mergeinfo changed
/trunk/ippTools/src merged: 34908,34910,34913,34932-34933,34973-34974,35039-35041,35048
- Property svn:ignore
-
branches/eam_branches/ipp-20121219/ippTools/src/Makefile.am
r33720 r35096 32 32 laptool \ 33 33 vptool \ 34 sctool 34 sctool \ 35 releasetool 35 36 36 37 pkginclude_HEADERS = \ … … 85 86 laptool.h \ 86 87 vptool.h \ 87 sctool.h 88 sctool.h \ 89 releasetool.h 88 90 89 91 lib_LTLIBRARIES = libpxtools.la … … 324 326 sctoolConfig.c 325 327 328 releasetool_CFLAGS = $(PSLIB_CFLAGS) $(PSMODULES_CFLAGS) $(IPPDB_CFLAGS) 329 releasetool_LDADD = $(PSLIB_LIBS) $(PSMODULES_LIBS) $(IPPDB_LIBS) libpxtools.la 330 releasetool_SOURCES = \ 331 releasetool.c \ 332 releasetoolConfig.c 333 326 334 clean-local: 327 335 -rm -f TAGS -
branches/eam_branches/ipp-20121219/ippTools/src/bgtool.c
r34081 r35096 693 693 psMetadata *where = psMetadataAlloc(); 694 694 PXOPT_COPY_S64(config->args, where, "-chip_bg_id", "chipBackgroundRun.chip_bg_id", "=="); 695 PXOPT_COPY_S64(config->args, where, "-chip_id", "chipBackgroundRun.chip_id", "=="); 695 696 PXOPT_COPY_STR(config->args, where, "-class_id", "chipBackgroundImfile.class_id", "=="); 696 697 pxAddLabelSearchArgs(config, where, "-label", "chipBackgroundRun.label", "LIKE"); -
branches/eam_branches/ipp-20121219/ippTools/src/bgtoolConfig.c
r32199 r35096 162 162 psMetadata *chipArgs = psMetadataAlloc(); 163 163 psMetadataAddS64(chipArgs, PS_LIST_TAIL, "-chip_bg_id", 0, "search by chip_bg_id", 0); 164 psMetadataAddS64(chipArgs, PS_LIST_TAIL, "-chip_id", 0, "search by chip_id", 0); 164 165 psMetadataAddStr(chipArgs, PS_LIST_TAIL, "-class_id", 0, "search by class_id", NULL); 165 166 psMetadataAddS16(chipArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); -
branches/eam_branches/ipp-20121219/ippTools/src/magictool.c
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20121219/ippTools/src/pxspace.c
r33921 r35096 67 67 psMetadataAddF32(md, PS_LIST_TAIL, "-glong_max", 0, "search by galactic longitude (degrees)", NAN); 68 68 psMetadataAddF32(md, PS_LIST_TAIL, "-glat_max", 0, "search by galactic latitude (degrees)", NAN); 69 psMetadataAddF32(md, PS_LIST_TAIL, "-abs_glat_min", 0, "search by absolute value(galactic latitude) (degrees)", NAN); 70 psMetadataAddF32(md, PS_LIST_TAIL, "-abs_glat_max", 0, "search by absolute value(galactic latitude) (degrees)", NAN); 69 71 } 70 72 … … 79 81 PXOPT_COPY_F32(config->args, where, "-glong_max", "skycell.glong", "<"); 80 82 PXOPT_COPY_F32(config->args, where, "-glat_max", "skycell.glat", "<"); 83 PXOPT_COPY_F32(config->args, where, "-abs_glat_min", "abs(skycell.glat)", ">="); 84 PXOPT_COPY_F32(config->args, where, "-abs_glat_max", "abs(skycell.glat)", "<"); 81 85 return true; 82 86 } -
branches/eam_branches/ipp-20121219/ippTools/src/staticskytool.c
r34815 r35096 503 503 PXOPT_COPY_S64(config->args, whereMD, "-sky_id", "sky_id", "=="); 504 504 pxAddLabelSearchArgs (config, whereMD, "-label", "staticskyRun.label", "=="); 505 pxskycellAddWhere(config, whereMD); 505 506 506 507 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); … … 736 737 PXOPT_COPY_S16(config->args, where, "-fault", "staticskyResult.fault", "=="); 737 738 739 if (!pxskycellAddWhere(config, where)) { 740 psError(PXTOOLS_ERR_CONFIG, false, "failed to add skycell search arguments"); 741 return false; 742 } 743 738 744 if (!psListLength(where->list) && !psMetadataLookupBool(NULL, config->args, "-all")) { 739 745 psFree(where); … … 1066 1072 psFree(whereMD); 1067 1073 1074 psString labelHook = psStringCopy(""); 1068 1075 if (!rerun) { 1069 1076 if (label) { 1070 psStringAppend(& query, "\nAND (skycalRun.label IS NULL OR skycalRun.label = '%s')", label);1077 psStringAppend(&labelHook, "\nAND skycalRun.label = '%s'", label); 1071 1078 } 1072 1079 psStringAppend(&query, "\nAND skycal_id IS NULL"); 1073 1080 } 1074 1081 1075 if (!p_psDBRunQuery(config->dbh, query)) { 1082 1083 if (!p_psDBRunQueryF(config->dbh, query, labelHook)) { 1076 1084 psError(PS_ERR_UNKNOWN, false, "database error"); 1085 psFree(labelHook); 1077 1086 psFree(query); 1078 1087 return false; 1079 1088 } 1089 psFree(labelHook); 1080 1090 psFree(query); 1081 1091 … … 1392 1402 PXOPT_COPY_STR(config->args, where, "-label", "skycalRun.label", "=="); 1393 1403 PXOPT_COPY_STR(config->args, where, "-data_group", "skycalRun.data_group", "LIKE"); 1404 PXOPT_COPY_S16(config->args, where, "-quality", "skycalResult.quality", "=="); 1394 1405 PXOPT_COPY_S16(config->args, where, "-fault", "skycalResult.fault", "=="); 1406 1407 if (!pxskycellAddWhere(config, where)) { 1408 psError(PXTOOLS_ERR_CONFIG, false, "failed to add skycell search arguments"); 1409 return false; 1410 } 1395 1411 1396 1412 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); … … 1468 1484 pxAddLabelSearchArgs(config, where, "-filter", "stackRun.filter", "=="); 1469 1485 PXOPT_COPY_S16(config->args, where, "-fault", "skycalResult.fault", "=="); 1486 if (!pxskycellAddWhere(config, where)) { 1487 psError(PXTOOLS_ERR_CONFIG, false, "failed to add skycell search arguments"); 1488 return false; 1489 } 1470 1490 1471 1491 if (!psListLength(where->list) && !psMetadataLookupBool(NULL, config->args, "-all")) { -
branches/eam_branches/ipp-20121219/ippTools/src/staticskytoolConfig.c
r34789 r35096 51 51 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-select_skycell_id", 0, "search for skycell_id", NULL); 52 52 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-select_tess_id", 0, "search for tess_id", NULL); 53 psMetadataAddF32(definebyqueryArgs, PS_LIST_TAIL, "-select_good_frac_min", 0, "define min good_frac", 0.0);53 psMetadataAddF32(definebyqueryArgs, PS_LIST_TAIL, "-select_good_frac_min", 0, "define min good_frac", NAN); 54 54 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-select_label", PS_META_DUPLICATE_OK, "search by stackRun label (LIKE comparison, multiple OK)", NULL); 55 55 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-select_data_group", PS_META_DUPLICATE_OK, "search by stackRun data_group (LIKE comparison, multiple OK)", NULL); … … 103 103 psMetadataAddS64(todoArgs, PS_LIST_TAIL, "-sky_id", 0, "search by staticsky ID", 0); 104 104 psMetadataAddStr(todoArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by label", NULL); 105 pxskycellAddArguments(todoArgs); 105 106 psMetadataAddU64(todoArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0); 106 107 psMetadataAddBool(todoArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); … … 138 139 psMetadataAddStr(revertArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by label", 0); 139 140 psMetadataAddS16(revertArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 141 pxskycellAddArguments(revertArgs); 140 142 psMetadataAddBool(revertArgs, PS_LIST_TAIL, "-all", 0, "allow no search terms", false); 141 143 … … 162 164 psMetadataAddStr(defineskycalrunArgs, PS_LIST_TAIL, "-select_skycell_id", 0, "search for skycell_id", NULL); 163 165 psMetadataAddStr(defineskycalrunArgs, PS_LIST_TAIL, "-select_tess_id", 0, "search for tess_id", NULL); 164 psMetadataAddF32(defineskycalrunArgs, PS_LIST_TAIL, "-select_good_frac_min", 0, "define min good_frac", 0.0);166 psMetadataAddF32(defineskycalrunArgs, PS_LIST_TAIL, "-select_good_frac_min", 0, "define min good_frac", NAN); 165 167 psMetadataAddStr(defineskycalrunArgs, PS_LIST_TAIL, "-select_label", PS_META_DUPLICATE_OK, "search by stackRun label (LIKE comparison, multiple OK)", NULL); 166 168 psMetadataAddStr(defineskycalrunArgs, PS_LIST_TAIL, "-select_data_group", PS_META_DUPLICATE_OK, "search by stackRun data_group (LIKE comparison, multiple OK)", NULL); … … 238 240 psMetadataAddStr(revertskycalArgs, PS_LIST_TAIL, "-data_group", PS_META_DUPLICATE_OK, "search by data_group", 0); 239 241 psMetadataAddStr(revertskycalArgs, PS_LIST_TAIL, "-filter", PS_META_DUPLICATE_OK, "search by filter", 0); 242 pxskycellAddArguments(revertskycalArgs); 240 243 psMetadataAddS16(revertskycalArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 241 244 psMetadataAddBool(revertskycalArgs, PS_LIST_TAIL, "-all", 0, "allow no search terms", false); … … 257 260 psMetadataAddStr(skycalresultArgs, PS_LIST_TAIL, "-label", 0, "search by label (LIKE comparison)", NULL); 258 261 psMetadataAddStr(skycalresultArgs, PS_LIST_TAIL, "-data_group", 0, "search by data_group (LIKE comparison)", NULL); 262 psMetadataAddS16(skycalresultArgs, PS_LIST_TAIL, "-quality", 0, "search by quality", 0); 259 263 psMetadataAddS16(skycalresultArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 264 pxskycellAddArguments(skycalresultArgs); 260 265 psMetadataAddU64(skycalresultArgs, PS_LIST_TAIL, "-limit", 0, "limit skycalresult set to N items", 0); 261 266 psMetadataAddBool(skycalresultArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); -
branches/eam_branches/ipp-20121219/ippconfig
- Property svn:mergeinfo changed
/trunk/ippconfig merged: 34944,34955,34957,34966,34983,34985,35023-35024,35038,35065,35081,35086
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20121219/ippconfig/gpc1/psastro.config
r34512 r35096 382 382 PSASTRO.USE.MODEL BOOL FALSE 383 383 PSASTRO.MOSAIC.MODE BOOL FALSE 384 DVO.GETSTAR.FIXED.ZEROPT F32 25.0 384 385 385 386 PSASTRO.CATDIR STR PS1.REF.20120524 … … 394 395 END 395 396 396 # initial setup for MD@100 inputs, should work for 50-500 input 397 STATICSKY_CAL METADATA 398 REFSTAR_MASK BOOL FALSE 399 PSASTRO.SAVE.REFMATCH BOOL FALSE 400 PSASTRO.FIX.CHIPS BOOL FALSE 401 PSASTRO.USE.MODEL BOOL FALSE 402 PSASTRO.MOSAIC.MODE BOOL FALSE 403 DVO.GETSTAR.FIXED.ZEROPT F32 25.0 404 405 PSASTRO.CATDIR STR PS1.REF.20120524 406 ZERO.POINT.USE.MEAN BOOL TRUE 407 408 ## for skycell, radius shouldn't need to be as large as 90 pixel default. deeper stacks, crowded fields can be problems 409 PSASTRO.MATCH.RADIUS.N0 F32 15 410 PSASTRO.MATCH.RADIUS.N1 F32 10 411 PSASTRO.MATCH.RADIUS.N2 F32 5 412 PSASTRO.MATCH.RADIUS.N3 F32 1 413 PSASTRO.MATCH.RADIUS.N4 F32 0.5 414 PSASTRO.MATCH.FIT.NITER S32 5 415 416 PSASTRO.MAX.ERROR F32 0.2 # in arcsec units, if larger than 0.2" on skycell then a problem.. 417 418 END 419 420 421 # revised setup for MD nightly stack inputs, should work for case of N~2-30 422 # - similar to DEEPCAL except for MIN.NSTAR 5 to attemp more edge skycells if poorer 423 STATICSKY_NIGHTCAL METADATA 424 PSASTRO.CATDIR STR PS1.REF.20120524 # reset here to ensure same catalog is used when reprocessing set uniformly 425 REFSTAR_MASK BOOL FALSE 426 PSASTRO.SAVE.REFMATCH BOOL FALSE 427 PSASTRO.FIX.CHIPS BOOL FALSE 428 PSASTRO.USE.MODEL BOOL FALSE 429 PSASTRO.MOSAIC.MODE BOOL FALSE 430 ZERO.POINT.USE.MEAN BOOL TRUE 431 PSASTRO.FIELD.PADDING F32 0.01 # skycells are well defined, don't need large padding. 1% of 6400 is 64 pixels 432 PSASTRO.MAX.NRAW S32 1000 # include more than MAX.NREF to account for extras like false-positives 433 PSASTRO.MAX.NREF S32 500 # if edge skycell ~5% then want >50 to match (hit ~40% in normal field matches) 434 PSASTRO.MIN.INST.MAG.RAW F32 -25.0 # 435 PSASTRO.MAX.INST.MAG.RAW F32 -5.0 436 PSASTRO.GRID.SEARCH BOOL FALSE # skycell/stack and astrom well known, when used could cause problems and not help 437 #PSASTRO.GRID.NRAW.MAX S32 2000 438 #PSASTRO.GRID.NREF.MAX S32 2000 439 #PSASTRO.GRID.MIN.INST.MAG.RAW F32 -21.0 440 #PSASTRO.GRID.MAX.INST.MAG.RAW F32 -14.0 441 DVO.GETSTAR.MAX.RHO F32 6000.0 # slightly larger than MAX.NREF 442 DVO.GETSTAR.MIN.MAG.INST F32 -25.0 # set absurd range to cover large range of exptime, then clamp... 443 DVO.GETSTAR.MIN.MAG F32 15.0 # only used if keyword problem 444 REFSTAR_CLAMP_MAG_MIN F32 15.0 # saturation in MD ~14 even in y-band, so toss out brighter in the list 445 DVO.GETSTAR.FIXED.ZEROPT F32 0.0 # not really needed, exptime overly dominates 446 447 ## for skycell/stack astrom well known, radius shouldn't need to be as large as 90 pixel default. in deeper stacks can be problems 448 PSASTRO.MATCH.RADIUS.N0 F32 5 449 PSASTRO.MATCH.RADIUS.N1 F32 3 450 PSASTRO.MATCH.RADIUS.N2 F32 1 451 PSASTRO.MATCH.RADIUS.N3 F32 0.5 452 PSASTRO.MATCH.FIT.NITER S32 4 453 PSASTRO.MAX.ERROR F32 0.2 # in arcsec units, still liberal limit for well known astrometry for skycells 454 PSASTRO.MIN.NSTAR S32 5 # edges may not have many and require special treatment 455 END 456 457 458 # revised setup for DEEP/MDS stacks with range of inputs, should work for N~2(edges)--500 inputs with large MIN/MAX.INST.MAG.RAW 397 459 STATICSKY_DEEPCAL METADATA 398 REFSTAR_MASK BOOL FALSE 399 PSASTRO.SAVE.REFMATCH BOOL FALSE 400 PSASTRO.FIX.CHIPS BOOL FALSE 401 PSASTRO.USE.MODEL BOOL FALSE 402 PSASTRO.MOSAIC.MODE BOOL FALSE 403 404 PSASTRO.CATDIR STR PS1.REF.20120524 405 ZERO.POINT.USE.MEAN BOOL TRUE 406 PSASTRO.MAX.NRAW S32 0 407 PSASTRO.MAX.NREF S32 10000 408 PSASTRO.GRID.NRAW.MAX S32 2000 409 PSASTRO.GRID.NREF.MAX S32 2000 410 PSASTRO.MIN.INST.MAG.RAW F32 -19.0 411 PSASTRO.MAX.INST.MAG.RAW F32 -14.0 412 PSASTRO.GRID.MIN.INST.MAG.RAW F32 -19.0 413 PSASTRO.GRID.MAX.INST.MAG.RAW F32 -15.0 414 DVO.GETSTAR.MIN.MAG.INST F32 -19.0 415 DVO.GETSTAR.MIN.MAG F32 16.0 416 417 END 418 460 PSASTRO.CATDIR STR PS1.REF.20120524 # reset here to ensure same catalog is used when reprocessing set uniformly 461 REFSTAR_MASK BOOL FALSE 462 PSASTRO.SAVE.REFMATCH BOOL FALSE 463 PSASTRO.FIX.CHIPS BOOL FALSE 464 PSASTRO.USE.MODEL BOOL FALSE 465 PSASTRO.MOSAIC.MODE BOOL FALSE 466 ZERO.POINT.USE.MEAN BOOL TRUE 467 PSASTRO.FIELD.PADDING F32 0.01 # skycells are well defined, don't need large padding. 1% of 6400 is 64 pixels 468 PSASTRO.MAX.NRAW S32 1000 # include more than MAX.NREF to account for extras like false-positives 469 PSASTRO.MAX.NREF S32 500 # if edge skycell ~10% then try ~50 to match 470 PSASTRO.MIN.INST.MAG.RAW F32 -25.0 # 471 PSASTRO.MAX.INST.MAG.RAW F32 -5.0 472 PSASTRO.GRID.SEARCH BOOL FALSE # skycell/stack and astrom well known, when used could cause problems and not help 473 #PSASTRO.GRID.NRAW.MAX S32 2000 474 #PSASTRO.GRID.NREF.MAX S32 2000 475 #PSASTRO.GRID.MIN.INST.MAG.RAW F32 -21.0 476 #PSASTRO.GRID.MAX.INST.MAG.RAW F32 -14.0 477 DVO.GETSTAR.MAX.RHO F32 6000.0 # N/sqdeg, slightly larger than MAX.NREF 478 DVO.GETSTAR.MIN.MAG.INST F32 -25.0 # set absurd range to cover large range of exptime, then clamp... 479 DVO.GETSTAR.MIN.MAG F32 15.0 # only used if keyword problem so also using CLAMP_MAG_MIN 480 REFSTAR_CLAMP_MAG_MIN F32 15.0 # saturation in MD ~14 even in y-band, so toss out brighter in the list 481 DVO.GETSTAR.FIXED.ZEROPT F32 0.0 # not really needed, exptime overly dominates 482 483 ## for skycell/stack astrom well known, radius shouldn't need to be as large as 90 pixel default. in deeper stacks can be problems 484 PSASTRO.MATCH.RADIUS.N0 F32 5 485 PSASTRO.MATCH.RADIUS.N1 F32 3 486 PSASTRO.MATCH.RADIUS.N2 F32 1 487 PSASTRO.MATCH.RADIUS.N3 F32 0.5 488 PSASTRO.MATCH.FIT.NITER S32 4 489 PSASTRO.MAX.ERROR F32 0.2 # in arcsec units, still liberal limit for well known astrometry for skycells 490 PSASTRO.MIN.NSTAR S32 10 # edges may not have many and require special treatment 491 END 492 -
branches/eam_branches/ipp-20121219/ippconfig/gpc1/psphot.config
r34769 r35096 53 53 PSPHOT.EXT.DIFF.ALTERNATE BOOL TRUE 54 54 PSPHOT.EXT.DIFF.ALTERNATE.THRESH F32 1.25 55 56 PSPHOT.EXT.FIT.ALL.SOURCES BOOL TRUE 57 PSPHOT.EXT.FIT.ALL.THRESH F32 1000 55 58 END 56 59 … … 59 62 PSPHOT.EXT.DIFF.ALTERNATE BOOL TRUE 60 63 PSPHOT.EXT.DIFF.ALTERNATE.THRESH F32 1.25 64 65 PSPHOT.EXT.FIT.ALL.SOURCES BOOL TRUE 66 PSPHOT.EXT.FIT.ALL.THRESH F32 1000 61 67 END 62 68 -
branches/eam_branches/ipp-20121219/ippconfig/recipes/filerules-mef.mdc
r34800 r35096 214 214 PPIMAGE.PATTERN OUTPUT {OUTPUT}.ptn PATTERN NONE CHIP TRUE MEF 215 215 PPIMAGE.STATS OUTPUT {OUTPUT}.stats STATS NONE FPA TRUE MEF 216 216 PPIMAGE.BACKMDL OUTPUT {OUTPUT}.{CHIP.NAME}.mdl.fits IMAGE NONE CHIP TRUE NONE 217 217 218 218 ## note: these use the same output naming convention since they are used for different ppMerge runs -
branches/eam_branches/ipp-20121219/ippconfig/recipes/filerules-simple.mdc
r34800 r35096 178 178 PPIMAGE.PATTERN OUTPUT {OUTPUT}.ptn PATTERN NONE FPA TRUE NONE 179 179 PPIMAGE.STATS OUTPUT {OUTPUT}.stats STATS NONE FPA TRUE NONE 180 180 PPIMAGE.BACKMDL OUTPUT {OUTPUT}.{CHIP.NAME}.mdl.fits IMAGE NONE CHIP TRUE NONE 181 181 182 182 ## note: these use the same output naming convention since they are used for different ppMerge runs -
branches/eam_branches/ipp-20121219/ippconfig/recipes/filerules-split.mdc
r34800 r35096 198 198 PPIMAGE.PATTERN OUTPUT {OUTPUT}.{CHIP.NAME}.ptn PATTERN NONE CHIP TRUE NONE 199 199 PPIMAGE.STATS OUTPUT {OUTPUT}.{CHIP.NAME}.stats STATS NONE CHIP TRUE NONE 200 PPIMAGE.BACKMDL OUTPUT {OUTPUT}.{CHIP.NAME}.mdl.fits IMAGE NONE CHIP TRUE NONE 200 201 201 202 ## note: these use the same output naming convention since they are used for different ppMerge runs -
branches/eam_branches/ipp-20121219/ippconfig/recipes/ppImage.config
r34063 r35096 42 42 MASK.STATS BOOL FALSE # calculate mask statistics. 43 43 GAIN.OVERRIDE BOOL TRUE # Override a non-finite gain? 44 44 BACKGROUND.CONTINUITY BOOL FALSE # Apply continuity correction to background models for an FPA. 45 45 TILTYSTREAK.BY.CLASS METADATA # apply the 'tiltystreak' tool 46 46 END … … 1147 1147 MASK.SATURATED BOOL FALSE # DO NOT Mask the saturated pixels 1148 1148 MASK.LOW BOOL FALSE # DO NOT Mask the saturated pixels 1149 END 1150 1151 # Calculate new background models with continuity correction applied 1152 PPIMAGE_BKGCONT METADATA 1153 OVERSCAN BOOL FALSE # Overscan subtraction 1154 NONLIN BOOL FALSE # Non-linearity correction; not implemented 1155 BIAS BOOL FALSE # Bias subtraction 1156 DARK BOOL FALSE # Dark subtraction 1157 SHUTTER BOOL FALSE # Shutter correction 1158 FLAT BOOL FALSE # Flat-field normalisation 1159 MASK BOOL FALSE # Mask bad pixels 1160 MASK.BUILD BOOL FALSE # Build internal mask? 1161 FRINGE BOOL FALSE # Fringe subtraction 1162 PHOTOM BOOL FALSE # Source identification and photometry 1163 ASTROM.CHIP BOOL FALSE # Astrometry per chip? 1164 ASTROM.MOSAIC BOOL FALSE # Astrometry for mosaic? 1165 BASE.FITS BOOL FALSE # Save base image? 1166 BASE.MASK.FITS BOOL FALSE # Save base detrended image? 1167 BASE.VARIANCE.FITS BOOL FALSE # Save base detrended image? 1168 CHIP.FITS BOOL FALSE # Save chip-mosaic-ed image? 1169 CHIP.MASK.FITS BOOL FALSE # Save chip-mosaic-ed image? 1170 CHIP.VARIANCE.FITS BOOL FALSE # Save chip-mosaic-ed image? 1171 BIN1.FITS BOOL FALSE # Save 1st binned chip image? 1172 BIN2.FITS BOOL FALSE # Save 2nd binned chip image? 1173 BIN1.JPEG BOOL FALSE # Save 1st binned jpeg? 1174 BIN2.JPEG BOOL FALSE # Save 2nd binned jpeg? 1175 BIN1.XBIN S32 1 # Image is already binned 1176 BIN1.YBIN S32 1 # Image is already binned 1177 BIN2.XBIN S32 1 # Image is already binned 1178 BIN2.YBIN S32 1 # Image is already binned 1179 MASK.SATURATED BOOL FALSE # DO NOT Mask the saturated pixels 1180 MASK.LOW BOOL FALSE # DO NOT Mask the saturated pixels 1181 BACKGROUND.CONTINUITY BOOL TRUE 1182 PATTERN.CONTINUITY.WIDTH S32 2 1149 1183 END 1150 1184 -
branches/eam_branches/ipp-20121219/ippconfig/recipes/ppSub.config
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20121219/ippconfig/recipes/psastro.config
r34301 r35096 190 190 DVO.GETSTAR.MIN.MAG.INST F32 -15.0 191 191 192 # if non-zero use as the zero point for computing magnitude limits for getstar 193 # by default use the ZEROPT in the PHOTCODE.DATA 194 DVO.GETSTAR.FIXED.ZEROPT F32 0.0 195 192 196 ZERO.POINT.BY.EXPOSURE BOOL TRUE 193 197 ZERO.POINT.USE.MEAN BOOL TRUE … … 268 272 269 273 STATICSKY_CAL METADATA 270 REFSTAR_MASK BOOL FALSE271 PSASTRO.SAVE.REFMATCH BOOL FALSE272 PSASTRO.FIX.CHIPS BOOL FALSE273 PSASTRO.USE.MODEL BOOL FALSE274 PSASTRO.MOSAIC.MODE BOOL FALSE275 274 END 276 275 … … 278 277 END 279 278 279 STATICSKY_NIGHTCAL METADATA 280 END 281 280 282 STATICSKY_DEEPCAL METADATA 281 283 END -
branches/eam_branches/ipp-20121219/ippconfig/recipes/psphot.config
- Property svn:mergeinfo changed
/trunk/ippconfig/recipes/psphot.config merged: 35038
r34903 r35096 347 347 PSPHOT.EXT.DIFF.ALTERNATE BOOL FALSE # use alternate extended source calculation; designed for diff trails 348 348 PSPHOT.EXT.DIFF.ALTERNATE.THRESH F32 1.5 # threshold for alternate extended source calculations 349 PSPHOT.EXT.FIT.ALL.SOURCES BOOL FALSE # Apply extended object fits to all sources 350 PSPHOT.EXT.FIT.ALL.THRESH F32 1000 # Set density threshold above which to not fit all sources 349 351 PSPHOT.CR.GROW S32 1 # Number of pixels to grow CR mask 350 352 PSPHOT.CR.NSIGMA.SOFTEN F32 0.0025 # Softening parameter for weights - Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20121219/ippconfig/recipes/pswarp.config
r34800 r35096 34 34 # Background restoration 35 35 BACKGROUND METADATA 36 SOURCES BOOL FALSE # Write source list for warped image? 37 PSF BOOL FALSE # Measure PSF for warped image? 36 SOURCES BOOL FALSE # Write source list for warped image? 37 PSF BOOL FALSE # Measure PSF for warped image? 38 BACKGROUND.MODEL BOOL FALSE # do not model background 38 39 END -
branches/eam_branches/ipp-20121219/ippconfig/recipes/reductionClasses.mdc
- Property svn:mergeinfo changed
/trunk/ippconfig/recipes/reductionClasses.mdc merged: 34983,34985
r34903 r35096 518 518 STACK_PPSUB STR STACK 519 519 STACK_PSPHOT STR STACK 520 STACKPHOT_PSPHOT STR STACKPHOT 521 STATICSKY_CALIBRATION STR STATICSKY_NIGHTCAL 520 522 END 521 523 - Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20121219/ppImage/src
- Property svn:mergeinfo changed
/trunk/ppImage/src merged: 35081
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20121219/ppImage/src/Makefile.am
r33590 r35096 44 44 ppImageRebinReadout.c \ 45 45 ppImageMosaic.c \ 46 ppImageMosaicBackground.c \ 46 47 ppImageMaskStats.c \ 47 48 ppImagePhotom.c \ -
branches/eam_branches/ipp-20121219/ppImage/src/ppImage.h
r33848 r35096 41 41 bool doPatternCell; // Cell pattern correction 42 42 bool doPatternContinuity; // Cell continuity correction 43 bool doBackgroundContinuity; // Do mosaic continuity correction 43 44 bool doFringe; // Fringe subtraction 44 45 bool doPhotom; // Source identification and photometry … … 50 51 bool checkNoise; // measure cell-level variance 51 52 bool applyParity; // Apply Cell parities 52 53 bool doMaskStats; // Calculate mask statistics 53 bool doMaskStats; // Calculate mask statistics 54 54 55 55 bool doCrosstalkMeasure; // measure crosstalk signal … … 183 183 bool ppImageDetrendPatternApply(pmConfig *config, pmChip *chip, const pmFPAview *inputView, const ppImageOptions *options); 184 184 185 // Do background continuity step 186 bool ppImageMosaicBackground(pmConfig *config, const ppImageOptions *options); 187 185 188 // Record which detrend file was used for the detrending 186 189 bool ppImageDetrendRecord( -
branches/eam_branches/ipp-20121219/ppImage/src/ppImageLoop.c
r33590 r35096 41 41 ESCAPE("load failure for FPA"); 42 42 } 43 43 44 44 pmChip *chip; // Chip from FPA 45 45 while ((chip = pmFPAviewNextChip(view, input->fpa, 1)) != NULL) { … … 233 233 ESCAPE("Unable to bin chip (level 2)."); 234 234 } 235 235 if (options->doBackgroundContinuity) { 236 pmFPAfile *out = psMetadataLookupPtr(NULL, config->files, "PPIMAGE.BACKMDL"); 237 pmFPAfileCopyView(out->fpa,out->src,view); 238 } 236 239 // Close cells (XXX shouldn't pmFPAfileClose iterate down as needed?) 237 240 view->cell = -1; … … 251 254 } 252 255 256 // Do background model continuity updates 257 if (!ppImageMosaicBackground(config, options )) { 258 ESCAPE("failure in Background Mosaic"); 259 } 260 253 261 // generate the full-scale FPA mosaic 254 262 if (!ppImageMosaicFPA(config, options, "PPIMAGE.OUTPUT.FPA1", "PPIMAGE.BIN1")) { -
branches/eam_branches/ipp-20121219/ppImage/src/ppImageOptions.c
r33848 r35096 35 35 options->doPatternCell = false; // Cell pattern correction 36 36 options->doPatternContinuity = false; // Cell continuity correction 37 options->doBackgroundContinuity = false; // Chip level background continuity correction 37 38 options->doFringe = false; // Fringe subtraction 38 39 options->doPhotom = false; // Source identification and photometry … … 429 430 } 430 431 432 // Option to enable the background continuity 433 options->doBackgroundContinuity = psMetadataLookupBool(NULL, recipe, "BACKGROUND.CONTINUITY"); 434 431 435 432 436 // Remnance options -
branches/eam_branches/ipp-20121219/ppImage/src/ppImageParseCamera.c
r33848 r35096 303 303 } 304 304 305 305 306 // chipImage -> psphotInput (pmFPAfileDefineFromFile) : fpa is constructed 306 307 // psphotInput -> psphotOutput (pmFPAfileDefineOutputFromFile) : fpa is equated … … 387 388 // the input data is the same as the outImage data : force the free levels to match 388 389 input->freeLevel = PS_MIN(outImage->freeLevel, input->freeLevel); 390 391 // define the continuity corrected background model files 392 if (options->doBackgroundContinuity) { 393 pmFPAfile *bkgMosaicModel = pmFPAfileDefineFromFPA(config,input->fpa, 1, 1, "PPIMAGE.BACKMDL"); 394 if (!bkgMosaicModel) { 395 psError(PS_ERR_IO, false, _("Unable to generate new file from PPIMAGE.BACKMDL")); 396 psFree(options); 397 return NULL; 398 } 399 if (bkgMosaicModel->type != PM_FPA_FILE_IMAGE) { 400 psError(PS_ERR_IO, true, "PPIMAGE.BACKMDL is not of type IMAGE"); 401 psFree(options); 402 return NULL; 403 404 } 405 bkgMosaicModel->save = options->doBackgroundContinuity; 406 // bkgMosaicModel->freeLevel = PS_MIN(bkgMosaicModel->freeLevel, PM_FPA_LEVEL_FPA); 407 bkgMosaicModel->freeLevel = PM_FPA_LEVEL_FPA; 408 bkgMosaicModel->dataLevel = bkgMosaicModel->dataLevel; 409 bkgMosaicModel->fileLevel = PS_MIN(bkgMosaicModel->fileLevel, bkgMosaicModel->dataLevel); 410 } 389 411 390 412 // define the binned target files (which may just be carriers for some camera configurations) … … 497 519 chipVariance->save = false; 498 520 } 499 521 500 522 if (psTraceGetLevel("ppImage.config") > 0) { 501 523 // Get a look inside all the files. -
branches/eam_branches/ipp-20121219/ppStack/src/ppStackCamera.c
r34800 r35096 47 47 } 48 48 bool convolve = psMetadataLookupBool(NULL, recipe, "CONVOLVE"); // Convolve images before stack? 49 49 bool doBackground = psMetadataLookupBool(NULL, recipe, "BACKGROUND.MODEL"); 50 50 51 psArray *runImages = pmFPAfileDefineMultipleFromRun(&status, NULL, config, 51 52 "PPSTACK.INPUT"); // Input images from previous run … … 217 218 218 219 // Grab bkgmodel information here 219 if (!bkgmodel || strlen(bkgmodel) == 0) { 220 // We have no background models. 220 if (doBackground) { 221 if (!bkgmodel || strlen(bkgmodel) == 0) { 222 // We have no background models. 223 } 224 else { 225 pmFPAfile *inputBKG = defineFile(config,NULL,"PPSTACK.INPUT.BKGMODEL",bkgmodel, 226 PM_FPA_FILE_IMAGE); 227 if (!inputBKG) { 228 // We failed to generate an pmFPAfile, so disable the background construction and continue. 229 doBackground = false; 230 psMetadataAddBool(recipe, PS_LIST_TAIL, "BACKGROUND.MODEL", PS_META_REPLACE, 231 "Do photometry on stacked image?", false); 232 233 #if (0) 234 psError(psErrorCodeLast(), false, 235 "Unable to define file from bkgmodel %d (%s)",i,bkgmodel); 236 return(false); 237 #endif 238 } 239 }// End bkgmodel 221 240 } 222 else {223 pmFPAfile *inputBKG = defineFile(config,NULL,"PPSTACK.INPUT.BKGMODEL",bkgmodel,224 PM_FPA_FILE_IMAGE);225 if (!inputBKG) {226 psError(psErrorCodeLast(), false,227 "Unable to define file from bkgmodel %d (%s)",i,bkgmodel);228 return(false);229 }230 }// End bkgmodel231 241 232 242 -
branches/eam_branches/ipp-20121219/ppStack/src/ppStackCombineAlternate.c
r34848 r35096 198 198 offset = (Sy * Sxx - Sx * Sxy) / D; 199 199 scale = (S * Sxy - Sx * Sy) / D; 200 fprintf(stderr,"Scales: %d %g %g \n",i,offset,scale);200 fprintf(stderr,"Scales: %d %g %g %g %g %g %g %g %g\n",i,offset,scale,D,Sx,Sy,Sxx,Syy,Sxy); 201 201 // Apply scaling factors 202 202 for (int y = minInputRows; y < maxInputRows; y++) { -
branches/eam_branches/ipp-20121219/psLib/src/imageops/psImageInterpolate.c
r34800 r35096 31 31 #include "psImageConvolve.h" 32 32 33 # define IS_BILIN_SEPARABLE 133 # define IS_BILIN_SEPARABLE 0 34 34 35 35 #include "psImageInterpolate.h" -
branches/eam_branches/ipp-20121219/psModules
- Property svn:mergeinfo changed
/trunk/psModules merged: 35038,35081-35082
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20121219/psModules/src/camera/pmFPAMaskWeight.c
r31451 r35096 538 538 psF32 **imageData = readout->image->data.F32;// Dereference image 539 539 psF32 **varianceData = readout->variance ? readout->variance->data.F32 : NULL; // Dereference variance map 540 540 float maskFrac = 0.0; 541 541 for (int y = 0; y < numRows; y++) { 542 542 for (int x = 0; x < numCols; x++) { 543 543 if (maskData[y][x] & maskVal) { 544 maskFrac += 1; 544 545 imageData[y][x] = NAN; 545 546 if (varianceData) { … … 549 550 } 550 551 } 551 552 maskFrac = maskFrac / (1.0 * numRows * numCols); 553 psMetadataAddF32(readout->analysis, PS_LIST_TAIL, "READOUT.MASK.FRAC", PS_META_REPLACE, 554 "fraction of pixels masked by pmReadoutMaskApply",maskFrac); 552 555 return true; 553 556 } -
branches/eam_branches/ipp-20121219/psModules/src/detrend/pmPattern.c
r33340 r35096 938 938 } 939 939 940 940 // This should reuse code more efficiently 941 bool pmPatternContinuityBackground(pmFPAfile *in, pmFPAfile *out, psStatsOptions bgStat, psStatsOptions cellStat, 942 psImageMaskType maskVal, psImageMaskType maskBad, int edgeWidth) 943 { 944 PS_ASSERT_PTR_NON_NULL(in, false); 945 PS_ASSERT_PTR_NON_NULL(out, false); 946 947 int numChips = out->fpa->chips->n; // Number of cells 948 949 psVector *meanMask = psVectorAlloc(numChips, PS_TYPE_VECTOR_MASK); // Mask for means 950 psVectorInit(meanMask, 0); 951 952 // Mask bits 953 enum { 954 PM_PATTERN_IGNORE = 0x01, // Ignore this cell 955 PM_PATTERN_TWEAK = 0x02, // Tweak this cell 956 PM_PATTERN_ERROR = 0x04, // Error in calculating background 957 PM_PATTERN_ALL = 0xFF, // All causes 958 }; 959 960 // Measure mean of each cell edge, and use that to determine the cell offsets. 961 psStatsOptions stat = cellStat; // Define which statistic to use. 962 963 psStats *bgStats = psStatsAlloc(stat); // Statistics on background 964 psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS); // Random number generator 965 966 psRegion region = {0,0,0,0}; 967 968 /* These images hold the edge data for the OTA structure. */ 969 psImage *A = psImageAlloc(8,8,PS_TYPE_F64); // Top edge 970 psImage *B = psImageAlloc(8,8,PS_TYPE_F64); // Bottom edge 971 psImage *C = psImageAlloc(8,8,PS_TYPE_F64); // Right edge 972 psImage *D = psImageAlloc(8,8,PS_TYPE_F64); // Left edge 973 psImageInit(A,0.0); 974 psImageInit(B,0.0); 975 psImageInit(C,0.0); 976 psImageInit(D,0.0); 977 978 // Corners don't exist. 979 A->data.F64[0][0] = NAN; 980 B->data.F64[0][0] = NAN; 981 C->data.F64[0][0] = NAN; 982 D->data.F64[0][0] = NAN; 983 A->data.F64[7][0] = NAN; 984 B->data.F64[7][0] = NAN; 985 C->data.F64[7][0] = NAN; 986 D->data.F64[7][0] = NAN; 987 A->data.F64[0][7] = NAN; 988 B->data.F64[0][7] = NAN; 989 C->data.F64[0][7] = NAN; 990 D->data.F64[0][7] = NAN; 991 A->data.F64[7][7] = NAN; 992 B->data.F64[7][7] = NAN; 993 C->data.F64[7][7] = NAN; 994 D->data.F64[7][7] = NAN; 995 996 for (int i = 0; i < numChips; i++) { 997 pmChip *chip = out->fpa->chips->data[i]; 998 pmCell *cell = chip->cells->data[0]; // Cell of interest 999 pmReadout *ro = cell->readouts->data[0]; // Readout of interest 1000 1001 psStatsInit(bgStats); 1002 1003 // Convert cell iterator i into an xy coordinate on the grid of cells 1004 // This is wrong for chips 1005 const char *chipName = psMetadataLookupStr(NULL,chip->concepts, "CHIP.NAME"); 1006 int xParity = psMetadataLookupS16(NULL,chip->concepts, "CHIP.XPARITY"); 1007 int yParity = psMetadataLookupS16(NULL,chip->concepts, "CHIP.YPARITY"); 1008 int x = chipName[2] - '0'; 1009 int y = chipName[3] - '0'; 1010 1011 1012 for (int j = 0; j < 4; j++) { 1013 if (j == 0) { // Region B 1014 region = psRegionSet(0,ro->image->numCols, 1015 0,edgeWidth); 1016 } 1017 else if (j == 1) { // Region A 1018 region = psRegionSet(0,ro->image->numCols, 1019 ro->image->numRows - edgeWidth,ro->image->numRows); 1020 } 1021 else if (j == 2) { // Region D 1022 region = psRegionSet(0,edgeWidth, 1023 0,ro->image->numRows); 1024 } 1025 else if (j == 3) { // Region C 1026 region = psRegionSet(ro->image->numCols - edgeWidth,ro->image->numCols, 1027 0,ro->image->numRows); 1028 } 1029 psImage *subset = psImageSubset(ro->image,region); 1030 1031 if (!psImageBackground(bgStats, NULL, subset, NULL, maskVal, rng)) { 1032 psWarning("Unable to measure background for cell %d on edge %d\n", i, j); 1033 psErrorClear(); 1034 meanMask->data.PS_TYPE_VECTOR_MASK_DATA[i] |= PM_PATTERN_ERROR; 1035 if (j == 0) { B->data.F64[y][x] = NAN; } 1036 else if (j == 1) { A->data.F64[y][x] = NAN; } 1037 else if (j == 2) { C->data.F64[y][x] = NAN; } 1038 else if (j == 3) { D->data.F64[y][x] = NAN; } 1039 psFree(subset); 1040 continue; // Move on to next edge, as only part of this cell may be a problem 1041 } 1042 1043 // If the returned value is zero, assume something is wrong. Do I still need this? 1044 if (psStatsGetValue(bgStats,stat) < 1e-6) { 1045 if (j == 0) { B->data.F64[y][x] = NAN; } 1046 else if (j == 1) { A->data.F64[y][x] = NAN; } 1047 else if (j == 2) { C->data.F64[y][x] = NAN; } 1048 else if (j == 3) { D->data.F64[y][x] = NAN; } 1049 } 1050 // If we have an error for this cell/edge, make sure we mask the value 1051 if (meanMask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PM_PATTERN_ERROR) { 1052 if (j == 0) { B->data.F64[y][x] = NAN; } 1053 else if (j == 1) { A->data.F64[y][x] = NAN; } 1054 else if (j == 2) { C->data.F64[y][x] = NAN; } 1055 else if (j == 3) { D->data.F64[y][x] = NAN; } 1056 } 1057 else { // Set the value to match what we got from the edge box. 1058 if (xParity == -1) { 1059 if (j == 2) { C->data.F64[y][x] = psStatsGetValue(bgStats,stat); } 1060 else if (j == 3) { D->data.F64[y][x] = psStatsGetValue(bgStats,stat); } 1061 } 1062 if (xParity == 1) { 1063 if (j == 3) { C->data.F64[y][x] = psStatsGetValue(bgStats,stat); } 1064 else if (j == 2) { D->data.F64[y][x] = psStatsGetValue(bgStats,stat); } 1065 } 1066 if (yParity == 1) { 1067 if (j == 0) { B->data.F64[y][x] = psStatsGetValue(bgStats,stat); } 1068 else if (j == 1) { A->data.F64[y][x] = psStatsGetValue(bgStats,stat); } 1069 } 1070 if (yParity == -1) { 1071 if (j == 1) { B->data.F64[y][x] = psStatsGetValue(bgStats,stat); } 1072 else if (j == 0) { A->data.F64[y][x] = psStatsGetValue(bgStats,stat); } 1073 } 1074 1075 } 1076 #if (0) 1077 for (int u = 0; u < subset->numCols; u++) { 1078 for (int v = 0; v < subset->numRows; v++) { 1079 psTrace("psModules.detrend.cont",10,"BOX: %d %d (%d %d) (%d %d) %f %d", 1080 i,j,x,y,u,v,subset->data.F32[v][u],0); 1081 } 1082 } 1083 #endif 1084 psFree(subset); 1085 1086 } 1087 psTrace("psModules.detrend.cont",5, "OTA: %d (%d %d) (%d %d) A: %f B: %f C: %f D: %f", 1088 i,x,y,xParity,yParity, 1089 A->data.F64[y][x],B->data.F64[y][x],C->data.F64[y][x],D->data.F64[y][x]); 1090 } 1091 psFree(bgStats); 1092 psFree(rng); 1093 1094 // We've now allocated all the edge values, so we can now minimize the offsets. 1095 // This involves solving the equation A x = b, where 1096 // A is the (64x64 for GPC1) matrix containing the edges that match for each cell 1097 // x is the solution vector 1098 // b is the combination of offsets across each cell boundary for each cell. 1099 // Below "XX" is used as the matrix A, and "solution" is used as both b and x 1100 // (due to the way psMatrixLUSolve operates). 1101 psVector *solution = psVectorAlloc(64,PS_TYPE_F64); 1102 psImage *XX = psImageAlloc(64,64,PS_TYPE_F64); 1103 psVectorInit(solution,0.0); 1104 psImageInit(XX,0.0); 1105 1106 1107 for (int i = 0; i < numChips; i++) { 1108 // Accumulate all the possible edge differences we can for this cell. 1109 // As we do so, make a note of the correlations by incrementing the element of the matrix. 1110 pmChip *chip = out->fpa->chips->data[i]; 1111 const char *chipName = psMetadataLookupStr(NULL,chip->concepts, "CHIP.NAME"); 1112 int x = chipName[2] - '0'; 1113 int y = chipName[3] - '0'; 1114 1115 int j; 1116 int k = 8 * x + y; 1117 double critical_value = 0.0; 1118 1119 if (x + 1 < 8) { // We have a neighbor adjacent in the +x direction 1120 j = 8 * (x + 1) + y; // Determine that neighbor's index 1121 1122 if (fabs(C->data.F64[y][x]) > fabs(D->data.F64[y][x+1])) { 1123 critical_value = 2.0 * fabs(D->data.F64[y][x+1]); 1124 } 1125 else { 1126 critical_value = 2.0 * fabs(C->data.F64[y][x]); 1127 } 1128 if (critical_value < 25) { critical_value = 25; } 1129 psTrace("psModules.detrend.cont",5,"CmD %d %d %d %d %g %g %g", // diagnostic 1130 i,x,y,j, 1131 C->data.F64[y][x], 1132 D->data.F64[y][x+1], 1133 critical_value 1134 ); 1135 if (// If there are no errors with the neighbor, 1136 (isfinite(C->data.F64[y][x]))&&(isfinite(D->data.F64[y][x+1]))&& // and all edges have valid values, 1137 (fabs(C->data.F64[y][x] - D->data.F64[y][x+1]) < critical_value) // and there are no large discontinuities, 1138 ) { 1139 solution->data.F64[k] += C->data.F64[y][x] - D->data.F64[y][x+1]; // Take the difference 1140 XX->data.F64[k][k] += 1; // increment our relation with ourself 1141 XX->data.F64[k][j] += -1; // decrement our relation with the neighbor 1142 } 1143 } 1144 if (x - 1 > -1) { // etc. 1145 j = 8 * (x - 1) + y; 1146 if (fabs(C->data.F64[y][x-1]) > fabs(D->data.F64[y][x])) { 1147 critical_value = 2.0 * fabs(D->data.F64[y][x]); 1148 } 1149 else { 1150 critical_value = 2.0 * fabs(C->data.F64[y][x-1]); 1151 } 1152 if (critical_value < 25) { critical_value = 25; } 1153 psTrace("psModules.detrend.cont",5,"DmC %d %d %d %d %g %g %g", 1154 i,x,y,j, 1155 D->data.F64[y][x], 1156 C->data.F64[y][x-1], 1157 critical_value 1158 ); 1159 1160 if ( 1161 (isfinite(D->data.F64[y][x]))&&(isfinite(C->data.F64[y][x-1]))&& 1162 (fabs(D->data.F64[y][x] - C->data.F64[y][x-1]) < critical_value) 1163 ) { 1164 solution->data.F64[k] += D->data.F64[y][x] - C->data.F64[y][x-1]; 1165 XX->data.F64[k][k] += 1; 1166 XX->data.F64[k][j] += -1; 1167 } 1168 } 1169 if (y + 1 < 8) { 1170 j = 8 * x + (y + 1); 1171 psTrace("psModules.detrend.cont",5,"AmB %d %d %d %d %g %g", 1172 i,x,y,j, 1173 A->data.F64[y][x], 1174 B->data.F64[y+1][x] 1175 ); 1176 if (fabs(A->data.F64[y][x]) > fabs(B->data.F64[y+1][x])) { 1177 critical_value = 2.0 * fabs(B->data.F64[y+1][x]); 1178 } 1179 else { 1180 critical_value = 2.0 * fabs(A->data.F64[y][x]); 1181 } 1182 if (critical_value < 25) { critical_value = 25; } 1183 if ( 1184 (isfinite(A->data.F64[y][x]))&&(isfinite(B->data.F64[y+1][x]))&& 1185 (fabs(A->data.F64[y][x] - B->data.F64[y+1][x]) < critical_value) 1186 ) { 1187 solution->data.F64[k] += A->data.F64[y][x] - B->data.F64[y+1][x]; 1188 XX->data.F64[k][k] += 1; 1189 XX->data.F64[k][j] += -1; 1190 } 1191 } 1192 if (y - 1 > -1) { 1193 j = 8 * x + (y - 1); 1194 psTrace("psModules.detrend.cont",5,"BmA %d %d %d %d %g %g", 1195 i,x,y,j, 1196 B->data.F64[y][x], 1197 A->data.F64[y-1][x] 1198 ); 1199 if (fabs(A->data.F64[y-1][x]) > fabs(B->data.F64[y][x])) { 1200 critical_value = 2.0 * fabs(B->data.F64[y][x]); 1201 } 1202 else { 1203 critical_value = 2.0 * fabs(A->data.F64[y-1][x]); 1204 } 1205 if (critical_value < 25) { critical_value = 25; } 1206 if ( 1207 (isfinite(B->data.F64[y][x]))&&(isfinite(A->data.F64[y-1][x]))&& 1208 (fabs(B->data.F64[y][x] - A->data.F64[y-1][x]) < critical_value) 1209 ) { 1210 solution->data.F64[k] += B->data.F64[y][x] - A->data.F64[y-1][x]; 1211 XX->data.F64[k][k] += 1; 1212 XX->data.F64[k][j] += -1; 1213 } 1214 } 1215 } 1216 double max_XX = 0; 1217 double solution_V = 0; 1218 int i_peak = -1; 1219 for (int i = 0; i < numChips + 4; i++) { // If any cells have no value of themself, set the matrix to 1.0. 1220 if (XX->data.F64[i][i] == 0.0) { 1221 XX->data.F64[i][i] = 1.0; 1222 } 1223 if (XX->data.F64[i][i] > max_XX) { 1224 max_XX = XX->data.F64[i][i]; 1225 solution_V = solution->data.F64[i]; 1226 i_peak = i; 1227 } 1228 } 1229 psTrace("psModules.detrend.cont",5,"fixed point: %d %g\n", 1230 i_peak,solution_V); 1231 1232 #if (1) 1233 for (int i = 0; i < numChips + 4; i++) { // print matrix A 1234 psTrace("psModules.detrend.cont",5,"A: %3d % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f % 2.0f", 1235 i, 1236 XX->data.F64[i][0], XX->data.F64[i][1], XX->data.F64[i][2], XX->data.F64[i][3], 1237 XX->data.F64[i][4], XX->data.F64[i][5], XX->data.F64[i][6], XX->data.F64[i][7], 1238 XX->data.F64[i][8], XX->data.F64[i][9], XX->data.F64[i][10], XX->data.F64[i][11], 1239 XX->data.F64[i][12], XX->data.F64[i][13], XX->data.F64[i][14], XX->data.F64[i][15], 1240 XX->data.F64[i][16], XX->data.F64[i][17], XX->data.F64[i][18], XX->data.F64[i][19], 1241 XX->data.F64[i][20], XX->data.F64[i][21], XX->data.F64[i][22], XX->data.F64[i][23], 1242 XX->data.F64[i][24], XX->data.F64[i][25], XX->data.F64[i][26], XX->data.F64[i][27], 1243 XX->data.F64[i][28], XX->data.F64[i][29], XX->data.F64[i][30], XX->data.F64[i][31], 1244 XX->data.F64[i][32], XX->data.F64[i][33], XX->data.F64[i][34], XX->data.F64[i][35], 1245 XX->data.F64[i][36], XX->data.F64[i][37], XX->data.F64[i][38], XX->data.F64[i][39], 1246 XX->data.F64[i][40], XX->data.F64[i][41], XX->data.F64[i][42], XX->data.F64[i][43], 1247 XX->data.F64[i][44], XX->data.F64[i][45], XX->data.F64[i][46], XX->data.F64[i][47], 1248 XX->data.F64[i][48], XX->data.F64[i][49], XX->data.F64[i][50], XX->data.F64[i][51], 1249 XX->data.F64[i][52], XX->data.F64[i][53], XX->data.F64[i][54], XX->data.F64[i][55], 1250 XX->data.F64[i][56], XX->data.F64[i][57], XX->data.F64[i][58], XX->data.F64[i][59], 1251 XX->data.F64[i][60], XX->data.F64[i][61], XX->data.F64[i][62], XX->data.F64[i][63] 1252 ); 1253 } 1254 1255 for (int i = 0; i < numChips + 4; i++) { // print vector b 1256 psTrace("psModules.detrend.cont",5,"b: %d %f", 1257 i, 1258 solution->data.F64[i] 1259 ); 1260 } 1261 #endif 1262 1263 // Solve the Ax=b equation 1264 // psMatrixLUSolve(XX,solution); 1265 psMatrixGJSolve(XX,solution); 1266 #if (1) 1267 for (int i = 0; i < numChips + 4; i++) { // print vector b 1268 psTrace("psModules.detrend.cont",5,"x: %d %f", 1269 i, 1270 solution->data.F64[i] 1271 ); 1272 } 1273 #endif 1274 1275 // Cleanup 1276 psFree(XX); 1277 psFree(A); 1278 psFree(B); 1279 psFree(C); 1280 psFree(D); 1281 1282 // Correct cells based on the offsets calculated, and store the result in the analysis metadata. 1283 for (int i = 0; i < numChips; i++) { 1284 pmChip *chip = out->fpa->chips->data[i]; 1285 pmCell *cell = chip->cells->data[0]; // Cell of interest 1286 pmReadout *ro = cell->readouts->data[0]; // Readout of interest 1287 const char *chipName = psMetadataLookupStr(NULL,chip->concepts, "CHIP.NAME"); 1288 int x = chipName[2] - '0'; 1289 int y = chipName[3] - '0'; 1290 int k = 8 * x + y; 1291 float correction = solution->data.F64[k]; 1292 psLogMsg("psModules.detrend", PS_LOG_DETAIL, "Correcting background of chip %s by %f", 1293 chipName, correction); 1294 psBinaryOp(ro->image, ro->image, "-", psScalarAlloc(correction, PS_TYPE_F32)); 1295 psMetadataAddF32(ro->analysis, PS_LIST_TAIL, PM_PATTERN_CELL_CORRECTION, PS_META_REPLACE, 1296 "Pattern chip correction solution", correction); 1297 } 1298 1299 psFree(solution); 1300 psFree(meanMask); 1301 1302 return true; 1303 } -
branches/eam_branches/ipp-20121219/psModules/src/detrend/pmPattern.h
r33243 r35096 14 14 #include <pslib.h> 15 15 #include <pmFPA.h> 16 #include <pmFPAview.h> 17 #include <pmFPAfile.h> 18 #include <pmFPAfileFitsIO.h> 19 #include <pmFPAHeader.h> 20 #include <pmHDU.h> 21 #include <pmHDUUtils.h> 16 22 17 23 /// @addtogroup detrend Detrend Creation and Application … … 65 71 ); 66 72 73 bool pmPatternContinuityBackground(pmFPAfile *in, 74 pmFPAfile *out, 75 psStatsOptions bgStat, 76 psStatsOptions cellStat, 77 psImageMaskType maskVal, 78 psImageMaskType maskBad, 79 int edgeWidth); 80 67 81 /// Apply previously measured cell pattern correction 68 82 bool pmPatternContinuityApply(pmReadout *ro, ///< Readout to correct -
branches/eam_branches/ipp-20121219/psModules/src/imcombine/pmStack.c
r34842 r35096 1385 1385 1386 1386 psVector *pixelData = psVectorAlloc(input->n,PS_TYPE_F32); 1387 psVector *pixelMask = psVectorAlloc(input->n,PS_TYPE_VECTOR_MASK); 1387 1388 psStats *stats = psStatsAlloc(PS_STAT_ROBUST_MEDIAN); 1388 1389 … … 1392 1393 pmReadout *ro = stack->data[i]; 1393 1394 psImage *image = ro->image; 1395 pixelMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = 0; 1394 1396 pixelData->data.F32[i] = image->data.F32[y][x]; 1397 if (isfinite(image->data.F32[y][x])&& 1398 (fabs(image->data.F32[y][x]) < 1e5)) { 1399 pixelMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = 0; 1400 } 1401 else { 1402 pixelMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = 1; 1403 } 1404 #if (0) 1405 if ((x == 59)&&(y > 40)&&(y < 50)) { 1406 fprintf(stderr,"%d %d %d %d %g\n", 1407 x,y,i,pixelMask->data.PS_TYPE_VECTOR_MASK_DATA[i],pixelData->data.F32[i]); 1408 } 1409 #endif 1395 1410 } 1396 if (!psVectorStats(stats,pixelData,NULL, NULL,0)) {1411 if (!psVectorStats(stats,pixelData,NULL,pixelMask,1)) { 1397 1412 psError(PS_ERR_UNKNOWN, false, "Unable to calculate median"); 1398 1413 psFree(stats); 1399 1414 psFree(pixelData); 1415 psFree(pixelMask); 1400 1416 psFree(stack); 1401 1417 return(false); … … 1403 1419 combined->image->data.F32[y][x] = stats->robustMedian; 1404 1420 combined->mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] = 0; 1421 #if (0) 1422 if ((x == 59)&&(y > 40)&&(y < 50)) { 1423 fprintf(stderr,"%d %d %d %d %g\n", 1424 x,y,-1,combined->mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x], 1425 combined->image->data.F32[y][x]); 1426 } 1427 #endif 1405 1428 } 1406 1429 } … … 1408 1431 psFree(stats); 1409 1432 psFree(pixelData); 1433 psFree(pixelMask); 1410 1434 psFree(stack); 1411 1435 return (true); -
branches/eam_branches/ipp-20121219/psModules/src/objects/pmSourceIO_CMF.c.in
r34564 r35096 830 830 psMetadataAddF32 (row, PS_LIST_TAIL, "KRON_MAG", 0, "Kron Mag", kronMag); 831 831 832 @PS1_DV 1,PS1_DV2@ psMetadataAddF32 (row, PS_LIST_TAIL, "NPARAMS", 0, "number of model parameters", model->params->n);832 @PS1_DV0,PS1_DV1@ psMetadataAddF32 (row, PS_LIST_TAIL, "NPARAMS", 0, "number of model parameters", model->params->n); 833 833 @ALL,!PS1_DV0,!PS1_DV1@ psMetadataAddS32 (row, PS_LIST_TAIL, "NPARAMS", 0, "number of model parameters", model->params->n); 834 834 psMetadataAddStr (row, PS_LIST_TAIL, "MODEL_TYPE", 0, "name of model", pmModelClassGetName (model->type)); -
branches/eam_branches/ipp-20121219/psastro/src/psastroChooseRefstars.c
r34301 r35096 62 62 63 63 int nMax = psMetadataLookupS32 (&status, recipe, "PSASTRO.MAX.NREF"); 64 psF32 clampMagMin = psMetadataLookup S32 (&status, recipe, "REFSTAR_CLAMP_MAG_MIN");65 if (!status) clampMagMin = -5 ;64 psF32 clampMagMin = psMetadataLookupF32 (&status, recipe, "REFSTAR_CLAMP_MAG_MIN"); 65 if (!status) clampMagMin = -5.0; 66 66 67 67 // de-activate all files except PSASTRO.REFSTARS -
branches/eam_branches/ipp-20121219/psastro/src/psastroLoadRefstars.c
r33643 r35096 363 363 if (!status) ESCAPE ("missing DVO.GETSTAR.MIN.MAG.INST"); 364 364 365 // if non zero override the zero point in the PHOTCODE.DATA with this value 366 float fixedzeropt = psMetadataLookupF32(&status, recipe, "DVO.GETSTAR.FIXED.ZEROPT"); 367 365 368 // PHOTCODE.DATA is a multi of metadata items 366 369 psListIterator *iter = psListIteratorAlloc(item->data.list, PS_LIST_HEAD, false); … … 391 394 continue; 392 395 } 396 if (fixedzeropt != 0.0) { 397 // override the recipe's zero point with the fixed value (used for stacks) 398 zeropt = fixedzeropt; 399 } 393 400 394 401 // convert the minInst to a calibrated minimum magnitude -
branches/eam_branches/ipp-20121219/psconfig
- Property svn:mergeinfo set to
-
branches/eam_branches/ipp-20121219/psconfig/psbuild
r34087 r35096 426 426 427 427 print STDOUT "** if you use sh, bash or equivalent as your shell, add the following to your .bashrc\n"; 428 print STDOUT " if [ -e $psconfdir/psconfig.bash ] ; then ";429 print STDOUT " psconfig () { ";430 print STDOUT " source $psconfdir/psconfig.bash ";431 print STDOUT " } ";432 print STDOUT " else ";433 print STDOUT " psconfig () { ";434 print STDOUT " echo psconfig not available ";435 print STDOUT " } ";436 print STDOUT " fi ";428 print STDOUT " if [ -e $psconfdir/psconfig.bash ] ; then\n"; 429 print STDOUT " psconfig () {\n"; 430 print STDOUT " source $psconfdir/psconfig.bash\n"; 431 print STDOUT " }\n"; 432 print STDOUT " else\n"; 433 print STDOUT " psconfig () {\n"; 434 print STDOUT " echo psconfig not available\n"; 435 print STDOUT " }\n"; 436 print STDOUT " fi\n"; 437 437 print STDOUT " psconfig default\n"; 438 438 print STDOUT "\n"; -
branches/eam_branches/ipp-20121219/psphot
- Property svn:mergeinfo changed
/trunk/psphot merged: 35038
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20121219/psphot/src
- Property svn:mergeinfo changed
/trunk/psphot/src merged: 35038
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20121219/psphot/src/psphotSourceSize.c
r34769 r35096 13 13 bool altDiffExt; 14 14 float altDiffExtThresh; 15 bool extFitAll; 16 bool extFitAllReadout; 17 float extFitAllThresh; 15 18 float soft; 16 19 int grow; … … 127 130 // Threshold for this alternate method 128 131 options.altDiffExtThresh = psMetadataLookupF32(&status, recipe, "PSPHOT.EXT.DIFF.ALTERNATE.THRESH"); 132 assert (status); 133 // Option to enable fitting of all objects with extended model. 134 options.extFitAll = psMetadataLookupBool(&status, recipe, "PSPHOT.EXT.FIT.ALL.SOURCES"); 135 assert (status); 136 // Fitting everything is fine, but if the source density is high, we probably shouldn't. 137 options.extFitAllThresh = psMetadataLookupF32(&status, recipe, "PSPHOT.EXT.FIT.ALL.THRESH"); 129 138 assert (status); 130 139 … … 413 422 414 423 psLogMsg("psModules.objects", PS_LOG_INFO, "Source Size classifications: %4s %4s %4s %4s %4s", "Npsf", "Next", "Nsat", "Ncr", "Nskip"); 415 424 // Determine if this readout is above the threshold to ext fit all sources 425 if (options->extFitAll) { 426 float maskFrac = psMetadataLookupF32(&status,readout->analysis,"READOUT.MASK.FRAC"); 427 if (status) { 428 maskFrac = 0.0; 429 } 430 if (sources->n * (1.0 - maskFrac) > options->extFitAllThresh) { 431 options->extFitAllReadout = false; 432 } 433 else { 434 options->extFitAllReadout = true; 435 } 436 } 437 416 438 if (!psphotSourceClassRegion (NULL, &psfClump, sources, recipe, psf, options)) { 417 439 psLogMsg ("psphot", 4, "Failed to determine source classification for full image\n"); … … 420 442 } 421 443 return true; 422 444 423 445 int nRegions = psMetadataLookupS32 (&status, readout->analysis, "PSF.CLUMP.NREGIONS"); 424 446 for (int i = 0; i < nRegions; i ++) { … … 426 448 psMetadata *regionMD = psMetadataLookupPtr (&status, readout->analysis, regionName); 427 449 psAssert (regionMD, "regions must be defined by earlier call to psphotRoughClassRegion"); 428 450 429 451 psRegion *region = psMetadataLookupPtr (&status, regionMD, "REGION"); 430 452 psAssert (region, "regions must be defined by earlier call to psphotRoughClassRegion"); 431 453 432 454 // pull FWHM_X,Y from the recipe, use to define psfClump.X,Y 433 455 psfClump.X = psMetadataLookupF32 (&status, regionMD, "PSF.CLUMP.X"); psAssert (status, "missing PSF.CLUMP.X"); … … 559 581 // * SAT stars should not be faint, but defects may? 560 582 583 // If the recipe requests we do extended source fits to everything, set 584 // the EXT_LIMIT flag 585 if (options->extFitAllReadout) { 586 source->mode |= PM_SOURCE_MODE_EXT_LIMIT; 587 } 561 588 // Defects may not always match CRs from peak curvature analysis 562 589 // Defects may also be marked as SATSTAR -- XXX deactivate this flag? -
branches/eam_branches/ipp-20121219/psphot/src/psphotStackImageLoop.c
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20121219/pstamp/scripts
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20121219/psvideophot
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20121219/tools/queuessky.lap
r34902 r35096 18 18 19 19 20 my ($ramin, $ramax, $decmin, $decmax, $absglatmin, $g o);20 my ($ramin, $ramax, $decmin, $decmax, $absglatmin, $glatmin, $glatmax, $go); 21 21 my $combos = 5; 22 22 my $verbose = 0; … … 27 27 'dec_min=s' => \$decmin, 28 28 'dec_max=s' => \$decmax, 29 # 'absglatmin=s' => \$absglatmin, # not yet 30 'nfilters=s' => \$combos, 31 'go' => \$go, 32 'verbose|v' => \$verbose, 29 'glat_min=s' => \$glatmin, 30 'glat_max=s' => \$glatmax, 31 'abs_glat_min=s' => \$absglatmin, 32 'nfilters=s' => \$combos, 33 'go' => \$go, 34 'verbose|v' => \$verbose, 33 35 ) or pod2usage(2); 34 36 … … 57 59 $command .= " -dec_max $decmax" if defined $decmax; 58 60 59 # XXX TODO: implement absglatmin 61 $command .= " -glat_min $glatmin" if defined $glatmin; 62 $command .= " -glat_max $glatmax" if defined $glatmax; 63 64 $command .= " -abs_glat_min $absglatmin" if defined $absglatmin; 60 65 61 66 foreach my $filter_combo (@$filter_combos) { … … 72 77 } 73 78 } 74 75 76 79 77 80 exit 0;
Note:
See TracChangeset
for help on using the changeset viewer.
