Changeset 23688
- Timestamp:
- Apr 2, 2009, 2:51:37 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 3 deleted
- 147 edited
- 5 copied
-
. (modified) (1 prop)
-
Nebulous/nebclient/src/nebulous.h (modified) (1 diff)
-
Nebulous/nebclient/src/soapC.c (modified) (1 diff)
-
Nebulous/nebclient/src/soapClient.c (modified) (1 diff)
-
Nebulous/nebclient/src/soapServer.c (modified) (1 diff)
-
Ohana (modified) (1 prop)
-
dbconfig/cam.md (modified) (1 diff)
-
dbconfig/changes.txt (modified) (4 diffs)
-
dbconfig/chip.md (modified) (1 diff)
-
dbconfig/config.md (modified) (1 diff)
-
dbconfig/diff.md (modified) (1 diff)
-
dbconfig/guide.md (deleted)
-
dbconfig/ipp.m4 (modified) (1 diff)
-
dbconfig/new.md (copied) (copied from branches/pap/dbconfig/new.md )
-
dbconfig/raw.md (copied) (copied from branches/pap/dbconfig/raw.md )
-
dbconfig/stack.md (modified) (1 diff)
-
dbconfig/summitcopy.md (copied) (copied from branches/pap/dbconfig/summitcopy.md )
-
dbconfig/tasks.md (deleted)
-
dbconfig/warp.md (modified) (1 diff)
-
ippScripts/scripts/camera_exp.pl (modified) (4 diffs)
-
ippScripts/scripts/chip_imfile.pl (modified) (3 diffs)
-
ippScripts/scripts/detrend_correct_imfile.pl (modified) (1 diff)
-
ippScripts/scripts/detrend_norm_apply.pl (modified) (1 diff)
-
ippScripts/scripts/detrend_norm_calc.pl (modified) (1 diff)
-
ippScripts/scripts/detrend_norm_exp.pl (modified) (1 diff)
-
ippScripts/scripts/detrend_process_exp.pl (modified) (1 diff)
-
ippScripts/scripts/detrend_process_imfile.pl (modified) (1 diff)
-
ippScripts/scripts/detrend_reject_exp.pl (modified) (1 diff)
-
ippScripts/scripts/detrend_resid_exp.pl (modified) (1 diff)
-
ippScripts/scripts/detrend_resid_imfile.pl (modified) (1 diff)
-
ippScripts/scripts/detrend_stack.pl (modified) (1 diff)
-
ippScripts/scripts/diff_skycell.pl (modified) (3 diffs)
-
ippScripts/scripts/dist_advancerun.pl (modified) (1 diff)
-
ippScripts/scripts/dist_component.pl (modified) (1 diff)
-
ippScripts/scripts/fake_imfile.pl (modified) (1 diff)
-
ippScripts/scripts/flatcorr_proc.pl (modified) (1 diff)
-
ippScripts/scripts/magic_destreak.pl (modified) (1 diff)
-
ippScripts/scripts/magic_mask.pl (modified) (1 diff)
-
ippScripts/scripts/magic_process.pl (modified) (1 diff)
-
ippScripts/scripts/magic_tree.pl (modified) (1 diff)
-
ippScripts/scripts/register_exp.pl (modified) (1 diff)
-
ippScripts/scripts/register_imfile.pl (modified) (2 diffs)
-
ippScripts/scripts/stack_skycell.pl (modified) (3 diffs)
-
ippScripts/scripts/summit_copy.pl (modified) (1 diff)
-
ippScripts/scripts/warp_overlap.pl (modified) (1 diff)
-
ippScripts/scripts/warp_skycell.pl (modified) (5 diffs)
-
ippTools/configure.ac (modified) (1 diff)
-
ippTools/share/chiptool_completely_processed_exp.sql (modified) (1 diff)
-
ippTools/share/difftool_definebyquery.sql (modified) (2 diffs)
-
ippTools/share/difftool_definebyquery_part1.sql (modified) (1 diff)
-
ippTools/share/difftool_definebyquery_part2.sql (modified) (1 diff)
-
ippTools/share/difftool_definewarpwarp_insert.sql (modified) (1 diff)
-
ippTools/share/difftool_todiffskyfile.sql (modified) (2 diffs)
-
ippTools/share/disttool_toadvance.sql (modified) (5 diffs)
-
ippTools/share/flatcorr_completely_processed_chiprun.sql (modified) (2 diffs)
-
ippTools/share/flatcorr_pending.sql (modified) (2 diffs)
-
ippTools/share/magicdstool_completed_runs.sql (modified) (5 diffs)
-
ippTools/share/magicdstool_getskycells.sql (modified) (1 diff)
-
ippTools/share/magicdstool_todestreak.sql (modified) (3 diffs)
-
ippTools/share/magictool_chipprocessedimfile.sql (modified) (1 diff)
-
ippTools/share/magictool_definebyquery.sql (modified) (2 diffs)
-
ippTools/share/magictool_definebyquery_insert.sql (modified) (1 diff)
-
ippTools/share/magictool_definebyquery_select_test.sql (modified) (1 diff)
-
ippTools/share/magictool_definebyquery_temp_insert.sql (modified) (1 diff)
-
ippTools/share/magictool_diffskyfile.sql (modified) (1 diff)
-
ippTools/share/magictool_inputs.sql (modified) (2 diffs)
-
ippTools/share/magictool_warpskyfile.sql (modified) (1 diff)
-
ippTools/share/pxadmin_create_tables.sql (modified) (52 diffs)
-
ippTools/share/pxadmin_drop_tables.sql (modified) (2 diffs)
-
ippTools/share/stacktool_definebyquery_insert.sql (modified) (1 diff)
-
ippTools/share/stacktool_definebyquery_insert_random_part1.sql (modified) (1 diff)
-
ippTools/share/stacktool_definebyquery_part1.sql (modified) (1 diff)
-
ippTools/share/stacktool_definebyquery_test.sql (modified) (1 diff)
-
ippTools/share/stacktool_find_complete_warps.sql (modified) (2 diffs)
-
ippTools/share/stacktool_tosum.sql (modified) (1 diff)
-
ippTools/share/warptool_finished_run_select.sql (modified) (1 diff)
-
ippTools/share/warptool_imfile.sql (modified) (1 diff)
-
ippTools/share/warptool_revertwarped_delete.sql (modified) (1 diff)
-
ippTools/src/camtool.c (modified) (11 diffs)
-
ippTools/src/camtoolConfig.c (modified) (3 diffs)
-
ippTools/src/chiptool.c (modified) (9 diffs)
-
ippTools/src/chiptoolConfig.c (modified) (3 diffs)
-
ippTools/src/dettoolConfig.c (modified) (19 diffs)
-
ippTools/src/dettool_detrunsummary.c (modified) (9 diffs)
-
ippTools/src/dettool_normalizedexp.c (modified) (4 diffs)
-
ippTools/src/dettool_normalizedimfile.c (modified) (4 diffs)
-
ippTools/src/dettool_normalizedstat.c (modified) (3 diffs)
-
ippTools/src/dettool_processedexp.c (modified) (4 diffs)
-
ippTools/src/dettool_processedimfile.c (modified) (6 diffs)
-
ippTools/src/dettool_residexp.c (modified) (7 diffs)
-
ippTools/src/dettool_residimfile.c (modified) (8 diffs)
-
ippTools/src/dettool_stack.c (modified) (4 diffs)
-
ippTools/src/difftool.c (modified) (6 diffs)
-
ippTools/src/difftoolConfig.c (modified) (5 diffs)
-
ippTools/src/disttool.c (modified) (6 diffs)
-
ippTools/src/disttoolConfig.c (modified) (5 diffs)
-
ippTools/src/faketool.c (modified) (6 diffs)
-
ippTools/src/faketoolConfig.c (modified) (3 diffs)
-
ippTools/src/flatcorr.c (modified) (25 diffs)
-
ippTools/src/flatcorrConfig.c (modified) (1 diff)
-
ippTools/src/magicdstool.c (modified) (3 diffs)
-
ippTools/src/magicdstoolConfig.c (modified) (3 diffs)
-
ippTools/src/magictool.c (modified) (8 diffs)
-
ippTools/src/magictoolConfig.c (modified) (4 diffs)
-
ippTools/src/pztool.c (modified) (8 diffs)
-
ippTools/src/pztoolConfig.c (modified) (9 diffs)
-
ippTools/src/regtool.c (modified) (12 diffs)
-
ippTools/src/regtoolConfig.c (modified) (6 diffs)
-
ippTools/src/stacktool.c (modified) (9 diffs)
-
ippTools/src/stacktoolConfig.c (modified) (3 diffs)
-
ippTools/src/warptool.c (modified) (7 diffs)
-
ippTools/src/warptoolConfig.c (modified) (4 diffs)
-
ippconfig/recipes/ppStatsFromMetadata.config (modified) (6 diffs)
-
ppImage (modified) (1 prop)
-
ppImage/src/ppImage.h (modified) (3 diffs)
-
ppImage/src/ppImageAstrom.c (modified) (2 diffs)
-
ppImage/src/ppImageLoop.c (modified) (3 diffs)
-
ppImage/src/ppImagePhotom.c (modified) (3 diffs)
-
ppStack (modified) (1 prop)
-
ppStack/src/ppStackPhotometry.c (modified) (1 diff)
-
ppStack/src/ppStackSetup.c (modified) (1 diff)
-
ppSub (modified) (1 prop)
-
ppSub/src/Makefile.am (modified) (1 diff)
-
ppSub/src/ppSub.h (modified) (7 diffs)
-
ppSub/src/ppSubCamera.c (modified) (1 diff)
-
ppSub/src/ppSubData.c (copied) (copied from branches/pap/ppSub/src/ppSubData.c )
-
ppSub/src/ppSubLoop.c (modified) (15 diffs)
-
ppSub/src/ppSubMakePSF.c (modified) (3 diffs)
-
ppSub/src/ppSubMatchPSFs.c (modified) (3 diffs)
-
ppSub/src/ppSubReadout.c (modified) (4 diffs)
-
ppSub/src/ppSubReadoutPhotometry.c (modified) (3 diffs)
-
ppSub/src/ppSubReadoutUpdate.c (modified) (2 diffs)
-
psModules (modified) (1 prop)
-
psModules/src/config/pmConfigRecipes.c (modified) (7 diffs)
-
psModules/src/config/pmErrorCodes.dat (modified) (1 diff)
-
psModules/src/imcombine/pmSubtractionMatch.c (modified) (2 diffs)
-
psModules/src/imcombine/pmSubtractionStamps.c (modified) (2 diffs)
-
psastro (modified) (1 prop)
-
psastro/src/psastro.c (modified) (4 diffs)
-
psastro/src/psastro.h (modified) (2 diffs)
-
psastro/src/psastroAnalysis.c (modified) (3 diffs)
-
psastro/src/psastroDataSave.c (modified) (2 diffs)
-
psastro/src/psastroMetadataStats.c (modified) (4 diffs)
-
psconfig (modified) (1 prop)
-
psphot (modified) (1 prop)
-
psphot/src/psphot.h (modified) (1 diff)
-
psphot/src/psphotDefineFiles.c (modified) (2 diffs)
-
psphot/src/psphotMaskReadout.c (modified) (1 diff)
-
pswarp/src/Makefile.am (modified) (1 diff)
-
pswarp/src/pswarp.h (modified) (1 diff)
-
pswarp/src/pswarpArguments.c (modified) (3 diffs)
-
pswarp/src/pswarpErrorCodes.dat (modified) (1 diff)
-
pswarp/src/pswarpLoop.c (modified) (5 diffs)
-
pswarp/src/pswarpPixelFraction.c (deleted)
-
pswarp/src/pswarpPixelsLit.c (copied) (copied from branches/pap/pswarp/src/pswarpPixelsLit.c )
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/pap (added) merged: 23511,23520-23521,23532,23578-23581,23596-23599,23603-23604,23606-23608,23619-23621,23638-23639,23641,23646-23648,23651-23653,23656,23672-23674,23677-23684
- Property svn:mergeinfo changed
-
trunk/Nebulous/nebclient/src/nebulous.h
r23198 r23688 1 1 /* src/nebulous.h 2 2 Generated by wsdl2h 1.2.12 from nebulous.wsdl and typemap.dat 3 2009-0 3-05 21:11:05GMT3 2009-04-03 00:34:43 GMT 4 4 Copyright (C) 2001-2008 Robert van Engelen, Genivia Inc. All Rights Reserved. 5 5 This part of the software is released under one of the following licenses: -
trunk/Nebulous/nebclient/src/soapC.c
r23198 r23688 12 12 #endif 13 13 14 SOAP_SOURCE_STAMP("@(#) soapC.c ver 2.7.12 2009-0 3-05 21:11:05GMT")14 SOAP_SOURCE_STAMP("@(#) soapC.c ver 2.7.12 2009-04-03 00:34:43 GMT") 15 15 16 16 -
trunk/Nebulous/nebclient/src/soapClient.c
r23198 r23688 10 10 #endif 11 11 12 SOAP_SOURCE_STAMP("@(#) soapClient.c ver 2.7.12 2009-0 3-05 21:11:05GMT")12 SOAP_SOURCE_STAMP("@(#) soapClient.c ver 2.7.12 2009-04-03 00:34:43 GMT") 13 13 14 14 -
trunk/Nebulous/nebclient/src/soapServer.c
r23198 r23688 10 10 #endif 11 11 12 SOAP_SOURCE_STAMP("@(#) soapServer.c ver 2.7.12 2009-0 3-05 21:11:05GMT")12 SOAP_SOURCE_STAMP("@(#) soapServer.c ver 2.7.12 2009-04-03 00:34:43 GMT") 13 13 14 14 -
trunk/Ohana
- Property svn:mergeinfo changed (with no actual effect on merging)
-
trunk/dbconfig/cam.md
r20274 r23688 87 87 path_base STR 255 88 88 fault S16 0 # Key NOT NULL 89 quality S16 0 89 90 END 90 91 -
trunk/dbconfig/changes.txt
r23663 r23688 899 899 update chipRun SET magicked = 1 where chip_id = 11955; 900 900 901 902 -- Version 1.1.51 903 904 -- Distribution updates 901 905 CREATE TABLE distTarget ( 902 906 target_id BIGINT AUTO_INCREMENT, … … 908 912 PRIMARY KEY(target_id) 909 913 ) ENGINE=innodb DEFAULT CHARSET=latin1; 910 911 914 912 915 CREATE TABLE rcDSProduct ( … … 931 934 ) ENGINE=innodb DEFAULT CHARSET=latin1; 932 935 933 934 936 CREATE TABLE rcInterest ( 935 937 int_id BIGINT AUTO_INCREMENT, … … 967 969 ) ENGINE=innodb DEFAULT CHARSET=latin1; 968 970 969 -- 1.1.51970 971 971 ALTER TABLE distRun ADD COLUMN no_magic TINYINT AFTER clean; 972 973 974 -- Adding data quality flags 975 DROP TABLE guidePendingExp; 976 ALTER TABLE diffSkyfile ADD COLUMN quality SMALLINT NOT NULL DEFAULT 0 AFTER fault; 977 ALTER TABLE stackSumSkyfile ADD COLUMN quality SMALLINT NOT NULL DEFAULT 0 AFTER fault; 978 ALTER TABLE warpSkyfile ADD COLUMN quality SMALLINT NOT NULL DEFAULT 0 AFTER fault; 979 ALTER TABLE camProcessedExp ADD COLUMN quality SMALLINT NOT NULL DEFAULT 0 AFTER fault; 980 ALTER TABLE chipProcessedImfile ADD COLUMN quality SMALLINT NOT NULL DEFAULT 0 AFTER fault; 981 ALTER TABLE rawImfile ADD COLUMN quality SMALLINT NOT NULL DEFAULT 0 AFTER fault; 982 983 ALTER TABLE warpSkyfile DROP COLUMN ignored; 984 985 ALTER TABLE diffSkyfile ADD KEY(quality); 986 ALTER TABLE stackSumSkyfile ADD KEY(quality); 987 ALTER TABLE warpSkyfile ADD KEY(quality); 988 ALTER TABLE camProcessedExp ADD KEY(quality); 989 ALTER TABLE chipProcessedImfile ADD KEY(quality); 990 ALTER TABLE rawImfile ADD KEY(quality); 991 992 -- Version 1.1.52 -
trunk/dbconfig/chip.md
r23382 r23688 88 88 path_base STR 255 89 89 fault S16 0 # Key NOT NULL 90 quality S16 0 90 91 magicked BOOL f 91 92 END -
trunk/dbconfig/config.md
r23391 r23688 2 2 pkg_name STR ippdb 3 3 pkg_namespace STR ippdb 4 pkg_version STR 1.1.5 04 pkg_version STR 1.1.52 5 5 END -
trunk/dbconfig/diff.md
r23388 r23688 54 54 good_frac F32 0.0 # Key 55 55 fault S16 0 # Key 56 quality S16 0 56 57 magicked BOOL f 57 58 END -
trunk/dbconfig/ipp.m4
r23663 r23688 9 9 dnl include(telescope.md) 10 10 dnl include(skycell.md) 11 include(tasks.md) 12 include(guide.md) 11 include(summitcopy.md) 12 include(new.md) 13 include(raw.md) 13 14 include(chip.md) 14 15 include(cam.md) -
trunk/dbconfig/stack.md
r19930 r23688 46 46 good_frac F32 0.0 # Key 47 47 fault S16 0 # Key 48 quality S16 0 48 49 END -
trunk/dbconfig/warp.md
r23383 r23688 55 55 ymin S32 0 56 56 ymax S32 0 57 ignored BOOL f # Key58 57 fault S16 0 # Key 58 quality S16 0 59 59 magicked BOOL f 60 60 END -
trunk/ippScripts/scripts/camera_exp.pl
r23295 r23688 263 263 &my_die("Unable to perform psastro: $error_code", $cam_id, $error_code); 264 264 } 265 # XXX do we want to give an error if astrometry fails here? 266 &my_die("Unable to find expected output file: $fpaObjects", $cam_id, $PS_EXIT_PROG_ERROR) unless -f $ipprc->file_resolve($fpaObjects); 267 265 266 my $quality; # Quality flag 268 267 if ($do_stats) { 269 268 my $fpaStatsReal = $ipprc->file_resolve($fpaStats); … … 282 281 } 283 282 chomp $cmdflags; 283 284 ($quality) = $cmdflags =~ /-quality (\d+)/; 285 } 286 287 if (!$quality) { 288 &my_die("Unable to find expected output file: $fpaObjects", $cam_id, $PS_EXIT_PROG_ERROR) unless -f $ipprc->file_resolve($fpaObjects); 284 289 } 285 290 … … 375 380 $command .= " -addprocessedexp"; 376 381 $command .= " -uri UNKNOWN"; 377 $command .= " - code$exit_code";382 $command .= " -fault $exit_code"; 378 383 $command .= " -path_base $outroot"; 379 384 $command .= " -path_base $outroot" if defined $outroot; … … 381 386 } else { 382 387 $command .= " -updateprocessedexp"; 383 $command .= " - code$exit_code";388 $command .= " -fault $exit_code"; 384 389 } 385 390 $command .= " -hostname $host" if defined $host; -
trunk/ippScripts/scripts/chip_imfile.pl
r23588 r23688 181 181 ## allow the output images to be optional, depending on the recipe / reduction class 182 182 my $outputImageExpect = metadataLookupBool($recipeData, 'CHIP.FITS'); 183 if ($outputImageExpect) {184 &my_die("Couldn't find expected output file: $outputImage\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputImage);185 }186 187 183 my $outputMaskExpect = metadataLookupBool($recipeData, 'CHIP.MASK.FITS'); 188 if ($outputMaskExpect) {189 &my_die("Couldn't find expected output file: $outputMask\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputMask);190 }191 192 184 my $outputWeightExpect = metadataLookupBool($recipeData, 'CHIP.VARIANCE.FITS'); 193 if ($outputWeightExpect) { 194 &my_die("Couldn't find expected output file: $outputWeight\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputWeight); 195 } 196 197 &my_die("Couldn't find expected output file: $outputBin1\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputBin1); 198 &my_die("Couldn't find expected output file: $outputBin2\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputBin2); 199 185 186 my $quality; # Quality flag 200 187 if ($do_stats) { 201 188 my $outputStatsReal = $ipprc->file_resolve($outputStats); … … 214 201 } 215 202 chomp $cmdflags; 216 } 203 ($quality) = $cmdflags =~ /-quality (\d+)/; # Quality flag 204 } 205 206 if (!$quality) { 207 &my_die("Couldn't find expected output file: $outputImage\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless !$outputImageExpect or $ipprc->file_exists($outputImage); 208 &my_die("Couldn't find expected output file: $outputMask\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless !$outputMaskExpect or $ipprc->file_exists($outputMask); 209 &my_die("Couldn't find expected output file: $outputWeight\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless !$outputWeightExpect or $ipprc->file_exists($outputWeight); 210 &my_die("Couldn't find expected output file: $outputBin1\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputBin1); 211 &my_die("Couldn't find expected output file: $outputBin2\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputBin2); 212 } 213 217 214 } 218 215 … … 277 274 $command .= " -chip_id $chip_id"; 278 275 $command .= " -class_id $class_id"; 279 $command .= " - code$exit_code";276 $command .= " -fault $exit_code"; 280 277 $command .= " -dbname $dbname" if defined $dbname; 281 278 system ($command); -
trunk/ippScripts/scripts/detrend_correct_imfile.pl
r23295 r23688 132 132 $command .= " -class_id $class_id"; 133 133 $command .= " -path_base $outroot"; 134 $command .= " - code$exit_code";134 $command .= " -fault $exit_code"; 135 135 $command .= " -dbname $dbname" if defined $dbname; 136 136 system ($command); -
trunk/ippScripts/scripts/detrend_norm_apply.pl
r23464 r23688 206 206 $command .= " -class_id $class_id"; 207 207 $command .= " -path_base $outroot"; 208 $command .= " - code$exit_code";208 $command .= " -fault $exit_code"; 209 209 $command .= " -dbname $dbname" if defined $dbname; 210 210 system ($command); -
trunk/ippScripts/scripts/detrend_norm_calc.pl
r23464 r23688 239 239 $command .= " -iteration $iter"; 240 240 # XXX EAM : we should add this to the db : $command .= " -path_base $outroot"; 241 $command .= " - code$exit_code";241 $command .= " -fault $exit_code"; 242 242 $command .= " -dbname $dbname" if defined $dbname; 243 243 system ($command); -
trunk/ippScripts/scripts/detrend_norm_exp.pl
r23295 r23688 191 191 $command .= " -iteration $iter"; 192 192 $command .= " -path_base $outroot "; 193 $command .= " - code$exit_code";193 $command .= " -fault $exit_code"; 194 194 $command .= " -dbname $dbname" if defined $dbname; 195 195 system ($command); -
trunk/ippScripts/scripts/detrend_process_exp.pl
r23295 r23688 205 205 $command .= " -det_id $det_id"; 206 206 $command .= " -exp_id $exp_id"; 207 $command .= " - code$exit_code";207 $command .= " -fault $exit_code"; 208 208 $command .= " -path_base $outroot"; 209 209 $command .= " -dbname $dbname" if defined $dbname; -
trunk/ippScripts/scripts/detrend_process_imfile.pl
r23464 r23688 195 195 $command .= " -class_id $class_id"; 196 196 $command .= " -path_base $outroot"; 197 $command .= " - code$exit_code";197 $command .= " -fault $exit_code"; 198 198 $command .= " -dbname $dbname" if defined $dbname; 199 199 system ($command); -
trunk/ippScripts/scripts/detrend_reject_exp.pl
r23295 r23688 344 344 $command .= " -iteration $iter"; 345 345 # XXX EAM : we should add this to the db : $command .= " -path_base $outroot"; 346 $command .= " - code$exit_code";346 $command .= " -fault $exit_code"; 347 347 $command .= " -dbname $dbname" if defined $dbname; 348 348 system ($command); -
trunk/ippScripts/scripts/detrend_resid_exp.pl
r23427 r23688 651 651 $command .= " -exp_id $exp_id"; 652 652 $command .= " -path_base $outroot"; 653 $command .= " - code$exit_code";653 $command .= " -fault $exit_code"; 654 654 $command .= " -dbname $dbname" if defined $dbname; 655 655 system ($command); -
trunk/ippScripts/scripts/detrend_resid_imfile.pl
r23464 r23688 265 265 $command .= " -class_id $class_id"; 266 266 $command .= " -path_base $outroot"; 267 $command .= " - code$exit_code";267 $command .= " -fault $exit_code"; 268 268 $command .= " -dbname $dbname" if defined $dbname; 269 269 system ($command); -
trunk/ippScripts/scripts/detrend_stack.pl
r23464 r23688 262 262 $command .= " -class_id $class_id"; 263 263 # XXX EAM : we should add this to the db : $command .= " -path_base $outroot"; 264 $command .= " - code$exit_code";264 $command .= " -fault $exit_code"; 265 265 $command .= " -dbname $dbname" if defined $dbname; 266 266 system ($command); -
trunk/ippScripts/scripts/diff_skycell.pl
r23438 r23688 248 248 &my_die("Unable to perform ppSub: $error_code", $diff_id, $skycell_id, $error_code); 249 249 } 250 &my_die("Couldn't find expected output file: $outputName", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputName);251 &my_die("Couldn't find expected output file: $outputMask", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputMask);252 &my_die("Couldn't find expected output file: $outputVariance", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputVariance);253 # &my_die("Couldn't find expected output file: $outputSources", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputSources);254 # &my_die("Couldn't find expected output file: $bin1Name", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($bin1Name);255 # &my_die("Couldn't find expected output file: $bin2Name", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($bin2Name);256 250 257 251 my $outputStatsReal = $ipprc->file_resolve($outputStats); … … 270 264 } 271 265 chomp $cmdflags; 266 267 my ($quality) = $cmdflags =~ /-quality (\d+)/; # Quality flag 268 269 if (!$quality) { 270 &my_die("Couldn't find expected output file: $outputName", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputName); 271 &my_die("Couldn't find expected output file: $outputMask", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputMask); 272 &my_die("Couldn't find expected output file: $outputVariance", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputVariance); 273 # &my_die("Couldn't find expected output file: $outputSources", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputSources); 274 # &my_die("Couldn't find expected output file: $bin1Name", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($bin1Name); 275 # &my_die("Couldn't find expected output file: $bin2Name", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($bin2Name); 276 } 272 277 } 273 278 … … 304 309 warn($msg); 305 310 if (defined $diff_id and defined $skycell_id and not $no_update) { 306 my $command = "$difftool -adddiffskyfile -diff_id $diff_id -skycell_id $skycell_id - code$exit_code";311 my $command = "$difftool -adddiffskyfile -diff_id $diff_id -skycell_id $skycell_id -fault $exit_code"; 307 312 $command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400)); 308 313 $command .= " -hostname $host" if defined $host; -
trunk/ippScripts/scripts/dist_advancerun.pl
r23295 r23688 134 134 my $command = "$disttool -updaterun"; 135 135 $command .= " -dist_id $dist_id"; 136 $command .= " - code$exit_code";136 $command .= " -fault $exit_code"; 137 137 $command .= " -dbname $dbname" if defined $dbname; 138 138 -
trunk/ippScripts/scripts/dist_component.pl
r23441 r23688 304 304 $command .= " -dist_id $dist_id"; 305 305 $command .= " -component $component"; 306 $command .= " - code$exit_code";306 $command .= " -fault $exit_code"; 307 307 $command .= " -dbname $dbname" if defined $dbname; 308 308 -
trunk/ippScripts/scripts/fake_imfile.pl
r23295 r23688 216 216 $command .= " -path_base $outroot"; 217 217 $command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400)); 218 $command .= " - code$exit_code";218 $command .= " -fault $exit_code"; 219 219 $command .= " -dbname $dbname" if defined $dbname; 220 220 system ($command); -
trunk/ippScripts/scripts/flatcorr_proc.pl
r20540 r23688 320 320 my $command = "$flatcorr -addprocess"; 321 321 $command .= " -corr_id $corr_id"; 322 $command .= " - code$exit_code";322 $command .= " -fault $exit_code"; 323 323 $command .= " -hostname $host" if defined $host; 324 324 $command .= " -dbname $dbname" if defined $dbname; -
trunk/ippScripts/scripts/magic_destreak.pl
r23636 r23688 274 274 $command .= " -magic_ds_id $magic_ds_id"; 275 275 $command .= " -component $component"; 276 $command .= " - code$exit_code";276 $command .= " -fault $exit_code"; 277 277 $command .= " -dbname $dbname" if defined $dbname; 278 278 -
trunk/ippScripts/scripts/magic_mask.pl
r23295 r23688 152 152 my $command = "$magictool -addmask"; 153 153 $command .= " -magic_id $magic_id"; 154 $command .= " - code$exit_code";154 $command .= " -fault $exit_code"; 155 155 $command .= " -dbname $dbname" if defined $dbname; 156 156 system($command); -
trunk/ippScripts/scripts/magic_process.pl
r23637 r23688 343 343 $command .= " -magic_id $magic_id"; 344 344 $command .= " -node $node"; 345 $command .= " - code$exit_code";345 $command .= " -fault $exit_code"; 346 346 $command .= " -dbname $dbname" if defined $dbname; 347 347 system($command); -
trunk/ippScripts/scripts/magic_tree.pl
r23295 r23688 296 296 my $command = "$magictool -inputtree"; 297 297 $command .= " -magic_id $magic_id"; 298 $command .= " - code$exit_code";298 $command .= " -fault $exit_code"; 299 299 $command .= " -dbname $dbname" if defined $dbname; 300 300 system($command); -
trunk/ippScripts/scripts/register_exp.pl
r23295 r23688 191 191 carp($msg); 192 192 if (defined $exp_id and not $no_update) { 193 my $command = "$regtool -addprocessedexp -exp_id $exp_id - code$exit_code";193 my $command = "$regtool -addprocessedexp -exp_id $exp_id -fault $exit_code"; 194 194 $command .= " -hostname $host" if defined $host; 195 195 $command .= " -dbname $dbname" if defined $dbname; -
trunk/ippScripts/scripts/register_imfile.pl
r23540 r23688 112 112 113 113 # we require at a minimum: -telescope, -inst, -filelevel, -class_id, -exp_type 114 if (uc(&value_for_flag ($cmdflags, " NULL", "-telescope")) eq "NULL") { &my_die ("telescope not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); }115 if (uc(&value_for_flag ($cmdflags, " NULL", "-inst")) eq "NULL") { &my_die ("inst not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); }116 if (uc(&value_for_flag ($cmdflags, " NULL", "-filelevel")) eq "NULL") { &my_die ("filelevel not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); }117 if (uc(&value_for_flag ($cmdflags, " NULL", "-class_id")) eq "NULL") { &my_die ("class_id not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); }118 if (uc(&value_for_flag ($cmdflags, " NULL", "-exp_type")) eq "NULL") { &my_die ("exp_type not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); }114 if (uc(&value_for_flag ($cmdflags, "-telescope")) eq "NULL") { &my_die ("telescope not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); } 115 if (uc(&value_for_flag ($cmdflags, "-inst")) eq "NULL") { &my_die ("inst not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); } 116 if (uc(&value_for_flag ($cmdflags, "-filelevel")) eq "NULL") { &my_die ("filelevel not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); } 117 if (uc(&value_for_flag ($cmdflags, "-class_id")) eq "NULL") { &my_die ("class_id not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); } 118 if (uc(&value_for_flag ($cmdflags, "-exp_type")) eq "NULL") { &my_die ("exp_type not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); } 119 119 120 120 my $command = "$regtool -addprocessedimfile"; … … 226 226 $command .= " -inst UNKNOWN"; 227 227 $command .= " -class_id $tmp_class_id"; 228 $command .= " - code$exit_code";228 $command .= " -fault $exit_code"; 229 229 $command .= " -hostname $host" if defined $host; 230 230 $command .= " -dbname $dbname" if defined $dbname; -
trunk/ippScripts/scripts/stack_skycell.pl
r23380 r23688 232 232 &my_die("Unable to perform ppStack: $error_code", $stack_id, $error_code); 233 233 } 234 &my_die("Couldn't find expected output file: $outputName", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputName); 235 &my_die("Couldn't find expected output file: $outputMask", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputMask); 236 &my_die("Couldn't find expected output file: $outputWeight", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputWeight); 237 &my_die("Couldn't find expected output file: $outputSources", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputSources); 238 # &my_die("Couldn't find expected output file: $bin1Name", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($bin1Name); 239 # &my_die("Couldn't find expected output file: $bin2Name", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($bin2Name); 240 234 235 my $quality; # Quality flag 241 236 if ($do_stats) { 242 237 my $outputStatsReal = $ipprc->file_resolve($outputStats); … … 255 250 } 256 251 chomp $cmdflags; 257 } 252 253 ($quality) = $cmdflags =~ /-quality (\d+)/; # Quality flag 254 } 255 256 if (!$quality) { 257 &my_die("Couldn't find expected output file: $outputName", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputName); 258 &my_die("Couldn't find expected output file: $outputMask", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputMask); 259 &my_die("Couldn't find expected output file: $outputWeight", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputWeight); 260 &my_die("Couldn't find expected output file: $outputSources", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputSources); 261 # &my_die("Couldn't find expected output file: $bin1Name", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($bin1Name); 262 # &my_die("Couldn't find expected output file: $bin2Name", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($bin2Name); 263 } 264 258 265 } 259 266 … … 306 313 307 314 if (defined $stack_id and not $no_update) { 308 my $command = "$stacktool -stack_id $stack_id - code$exit_code";315 my $command = "$stacktool -stack_id $stack_id -fault $exit_code"; 309 316 if ($run_state eq 'new') { 310 317 $command .= " -addsumskyfile"; -
trunk/ippScripts/scripts/summit_copy.pl
r23497 r23688 148 148 $command .= " -class_id $class_id"; 149 149 $command .= " -uri $uri"; 150 $command .= " - code$exit_code";150 $command .= " -fault $exit_code"; 151 151 $command .= " -dbname $dbname" if defined $dbname; 152 152 -
trunk/ippScripts/scripts/warp_overlap.pl
r23295 r23688 193 193 my $command = "$warptool -addoverlap"; 194 194 $command .= " -warp_id $warp_id"; 195 $command .= " - code$exit_code";195 $command .= " -fault $exit_code"; 196 196 $command .= " -dbname $dbname" if defined $dbname; 197 197 system ($command); -
trunk/ippScripts/scripts/warp_skycell.pl
r23430 r23688 175 175 # Run pswarp 176 176 my $cmdflags; 177 my $accept = 1; # Accept the skycell?178 177 my $do_stats; 179 178 unless ($no_op) { … … 215 214 216 215 if ($do_stats) { 217 # Check first for the stats file , and if the ACCEPT flag is set.216 # Check first for the stats file 218 217 my $outputStatsReal = $ipprc->file_resolve($outputStats); 219 218 &my_die("Couldn't find expected output file: $outputStats", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless -f $outputStatsReal; … … 232 231 chomp $cmdflags; 233 232 234 if ($cmdflags =~ /-accept/) { 233 my ($quality) = $cmdflags =~ /-quality (\d+)/; # Quality flag 234 235 if (!$quality) { 235 236 &my_die("Couldn't find expected output file: $outputImage", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputImage); 236 237 &my_die("Couldn't find expected output file: $outputMask", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputMask); … … 249 250 $command .= " -magicked" if $magicked; 250 251 251 $command .= " -uri $outputImage" if $accept;252 $command .= " -uri $outputImage" if !$quality; 252 253 $command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400)); 253 $command .= " $cmdflags" if $accept;254 $command .= " $cmdflags"; 254 255 $command .= " -hostname $host" if defined $host; 255 256 $command .= " -dbname $dbname" if defined $dbname; … … 307 308 $command .= " -skycell_id $skycell_id"; 308 309 $command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400)); 309 $command .= " - code$exit_code";310 $command .= " -fault $exit_code"; 310 311 $command .= " -dbname $dbname" if defined $dbname; 311 312 run(command => $command, verbose => $verbose); -
trunk/ippTools/configure.ac
r23391 r23688 18 18 PKG_CHECK_MODULES([PSLIB], [pslib >= 1.1.0]) 19 19 PKG_CHECK_MODULES([PSMODULES], [psmodules >= 1.1.0]) 20 PKG_CHECK_MODULES([IPPDB], [ippdb >= 1.1.5 0])20 PKG_CHECK_MODULES([IPPDB], [ippdb >= 1.1.52]) 21 21 22 22 PXTOOLS_CFLAGS="${PSLIB_CFLAGS=} ${PSMODULES_CFLAGS=} ${IPPDB_CFLAGS=}" -
trunk/ippTools/share/chiptool_completely_processed_exp.sql
r23381 r23688 35 35 COUNT(rawImfile.class_id) = COUNT(chipProcessedImfile.class_id) 36 36 AND SUM(chipProcessedImfile.fault) = 0 37 AND SUM(chipProcessedImfile.quality > 0) != COUNT(*) 37 38 ) as Foo -
trunk/ippTools/share/difftool_definebyquery.sql
r20973 r23688 38 38 WHERE 39 39 warpSkyfile.fault = 0 40 AND warpSkyfile. ignored= 040 AND warpSkyfile.quality = 0 41 41 -- warpsToDiff WHERE hook %s 42 42 ) AS warpsToDiff … … 51 51 WHERE stackRun.state = 'full' 52 52 AND stackSumSkyfile.fault = 0 53 AND stackSumSkyfile.quality = 0 53 54 -- stacksForDiff WHERE hook %s 54 55 GROUP BY -
trunk/ippTools/share/difftool_definebyquery_part1.sql
r20973 r23688 1 SELECT 2 exp_id, 3 warp_id, 4 rawExp.filter, 5 warpRun.label, 6 warpRun.tess_id, 7 count(skycell_id) as skycell_count 8 FROM warpRun 9 JOIN warpSkyfile USING(warp_id) 10 JOIN fakeRun USING(fake_id) 11 JOIN camRun USING(cam_id) 12 JOIN chipRun USING (chip_id) 13 JOIN rawExp USING(exp_id) 14 LEFT JOIN diffRun USING(exp_id) 15 16 WHERE 17 warpSkyfile.ignored = 0 18 -- warp where hook %s 19 -- exp where hook %s 20 -- diff where hook %s 21 22 GROUP BY exp_id, warp_id DESC 1 SELECT 2 exp_id, 3 warp_id, 4 rawExp.filter, 5 warpRun.label, 6 warpRun.tess_id, 7 COUNT(skycell_id) as skycell_count 8 FROM warpRun 9 JOIN warpSkyfile USING(warp_id) 10 JOIN fakeRun USING(fake_id) 11 JOIN camRun USING(cam_id) 12 JOIN chipRun USING(chip_id) 13 JOIN rawExp USING(exp_id) 14 LEFT JOIN diffRun USING(exp_id) 15 WHERE 16 warpSkyfile.fault = 0 17 AND warpSkyfile.quality = 0 18 -- warp where hook %s 19 -- exp where hook %s 20 -- diff where hook %s 21 GROUP BY exp_id, warp_id DESC -
trunk/ippTools/share/difftool_definebyquery_part2.sql
r21308 r23688 1 1 -- insert skycells to diff 2 2 INSERT INTO skycellsToDiff 3 SELECT 4 0, -- diff_id 5 warpSkyfile.skycell_id, 6 warpSkyfile.warp_id, -- warp1 7 NULL, -- stack1 8 NULL, -- warp2 9 max_stack_id, -- stack2 10 warpSkyfile.tess_id, 11 0 12 FROM warpSkyfile 13 JOIN warpRun USING(warp_id) 14 LEFT JOIN ( 3 15 SELECT 4 0, -- diff_id 5 warpSkyfile.skycell_id, 6 warpSkyfile.warp_id, -- warp1 7 NULL, -- stack1 8 NULL, -- warp2 9 max_stack_id, -- stack2 10 warpSkyfile.tess_id, 11 0 12 FROM warpSkyfile 13 JOIN warpRun USING(warp_id) 14 LEFT JOIN ( 15 SELECT 16 MAX(stack_id) AS max_stack_id, -- most recent stack, by virtue of auto-increment 17 stackRun.skycell_id, 18 stackRun.tess_id, 19 filter 20 FROM stackRun 21 JOIN stackSumSkyfile USING(stack_id) 22 WHERE stackSumSkyfile.fault = 0 23 AND stackRun.state = 'full' 24 -- stacks where hook %s 25 GROUP BY 26 skycell_id, 27 filter 28 ) as bestStacks 29 USING(skycell_id) 30 WHERE 31 warpSkyfile.warp_id = %lld 32 AND ignored = 0 33 AND filter = '%s' 34 AND warpSkyfile.tess_id = bestStacks.tess_id 35 -- (good fraction test goes here for example also above) 36 -- warp where hook %s 16 MAX(stack_id) AS max_stack_id, -- most recent stack, by virtue of auto-increment 17 stackRun.skycell_id, 18 stackRun.tess_id, 19 filter 20 FROM stackRun 21 JOIN stackSumSkyfile USING(stack_id) 22 WHERE stackSumSkyfile.fault = 0 23 AND stackSumSkyfile.quality = 0 24 AND stackRun.state = 'full' 25 -- stacks where hook %s 26 GROUP BY 27 skycell_id, 28 filter 29 ) as bestStacks USING(skycell_id) 30 WHERE 31 warpSkyfile.warp_id = %lld 32 AND warpSkyfile.fault = 0 33 AND warpSkyfile.quality = 0 34 AND filter = '%s' 35 AND warpSkyfile.tess_id = bestStacks.tess_id 36 -- warp where hook %s -
trunk/ippTools/share/difftool_definewarpwarp_insert.sql
r23504 r23688 11 11 FROM warpSkyfile AS inputWarpSkyfile 12 12 JOIN warpSkyfile AS templateWarpSkyfile USING(skycell_id, tess_id) 13 WHERE inputWarpSkyfile. ignored= 014 AND templateWarpSkyfile. ignored= 013 WHERE inputWarpSkyfile.quality = 0 14 AND templateWarpSkyfile.quality = 0 15 15 AND inputWarpSkyfile.warp_id = %s 16 16 AND templateWarpSkyfile.warp_id = %s -
trunk/ippTools/share/difftool_todiffskyfile.sql
r21308 r23688 63 63 AND diffSkyfile.diff_id IS NULL) 64 64 OR (diffRun.state = 'update' 65 AND diffSkyfile.fault = 0) 65 AND diffSkyfile.fault = 0 66 AND diffSkyfile.quality = 0) 66 67 ) 67 68 -- Ensure input warps are available … … 69 70 OR (warpRun.state = 'full' 70 71 AND warpSkyfile.fault = 0 71 AND warpSkyfile. ignored= 0))72 AND warpSkyfile.quality = 0)) 72 73 -- Ensure input stacks are available 73 74 AND (diffInputSkyfile.stack1 IS NULL 74 75 OR (stackRun.state = 'full' 75 AND stackSumSkyfile.fault = 0)) 76 AND stackSumSkyfile.fault = 0 77 AND stackSumSkyfile.quality = 0)) 76 78 -- Ensure template warps are available 77 79 AND (diffInputSkyfile.warp2 IS NULL 78 80 OR (warpTemplateRun.state = 'full' 79 81 AND warpTemplateSkyfile.fault = 0 80 AND warpTemplateSkyfile. ignored= 0))82 AND warpTemplateSkyfile.quality = 0)) 81 83 -- Ensure template stacks are available 82 84 AND (diffInputSkyfile.stack2 IS NULL 83 85 OR (stackTemplateRun.state = 'full' 84 AND stackTemplateSkyfile.fault = 0)) 86 AND stackTemplateSkyfile.fault = 0 87 AND stackTemplateSkyfile.quality = 0)) 85 88 86 89 -
trunk/ippTools/share/disttool_toadvance.sql
r23245 r23688 7 7 ( 8 8 -- raw stage 9 SELECT 9 SELECT 10 10 distRun.dist_id, 11 11 stage, … … 29 29 UNION 30 30 -- chip stage 31 SELECT 31 SELECT 32 32 distRun.dist_id, 33 33 stage, … … 51 51 UNION 52 52 -- warp stage 53 SELECT 53 SELECT 54 54 distRun.dist_id, 55 55 stage, … … 66 66 AND distRun.stage = 'warp' 67 67 -- AND warpSkyfile.fault = 0 68 -- AND warpSkyfile. ignored= 068 -- AND warpSkyfile.quality = 0 69 69 GROUP BY 70 70 distRun.dist_id, … … 99 99 UNION 100 100 -- stack stage 101 SELECT 101 SELECT 102 102 distRun.dist_id, 103 103 stage, -
trunk/ippTools/share/flatcorr_completely_processed_chiprun.sql
r18366 r23688 14 14 dvodb 15 15 FROM 16 (SELECT 16 (SELECT 17 17 chipRun.*, 18 18 rawImfile.class_id as rawimfile_class_id, … … 33 33 COUNT(rawImfile.class_id) = COUNT(chipProcessedImfile.class_id) 34 34 AND SUM(chipProcessedImfile.fault) = 0 35 ) as Foo 35 AND SUM(chipProcessedImfile.quality > 0) != COUNT(*) 36 ) as Foo 36 37 ) as Bar -
trunk/ippTools/share/flatcorr_pending.sql
r18366 r23688 1 SELECT 1 SELECT 2 2 * 3 3 FROM … … 21 21 HAVING 22 22 COUNT(rawImfile.class_id) = COUNT(chipProcessedImfile.class_id) 23 AND SUM(chipProcessedImfile.fault ) = 023 AND SUM(chipProcessedImfile.fault > 0) = 0 24 24 -
trunk/ippTools/share/magicdstool_completed_runs.sql
r23389 r23688 4 4 ( 5 5 -- raw stage 6 SELECT 6 SELECT 7 7 magicDSRun.magic_ds_id 8 8 FROM magicDSRun … … 22 22 UNION 23 23 -- chip stage 24 SELECT 24 SELECT 25 25 magicDSRun.magic_ds_id 26 26 FROM magicDSRun … … 40 40 UNION 41 41 -- warp stage 42 SELECT 42 SELECT 43 43 magicDSRun.magic_ds_id 44 44 FROM magicDSRun … … 51 51 AND magicDSRun.stage = 'warp' 52 52 AND warpSkyfile.fault = 0 53 AND warpSkyfile. ignored= 053 AND warpSkyfile.quality = 0 54 54 GROUP BY 55 55 magicDSRun.magic_ds_id, … … 75 75 AND magicDSRun.stage = 'diff' 76 76 AND diffSkyfile.fault = 0 77 AND diffSkyfile.quality = 0 77 78 GROUP BY 78 79 magicDSRun.magic_ds_id, -
trunk/ippTools/share/magicdstool_getskycells.sql
r20973 r23688 21 21 ON warpSkyfile.warp_id = warpSkyCellMap.warp_id 22 22 AND warpSkyfile.skycell_id = warpSkyCellMap.skycell_id 23 AND warpSkyfile. ignored= 023 AND warpSkyfile.quality = 0 24 24 WHERE 25 25 diffSkyfile.fault = 0 26 AND diffSkyfile.quality = 0 26 27 AND magic_ds_id = %lld -
trunk/ippTools/share/magicdstool_todestreak.sql
r23389 r23688 61 61 AND chipRun.state = 'full' 62 62 AND chipProcessedImfile.fault = 0 63 AND chipProcessedImfile.quality = 0 63 64 AND magicDSFile.component IS NULL 64 65 UNION … … 95 96 AND warpRun.state = 'full' 96 97 AND warpSkyfile.fault = 0 97 AND warpSkyfile. ignored= 098 AND warpSkyfile.quality = 0 98 99 AND magicDSFile.component IS NULL 99 100 UNION … … 130 131 AND magicDSRun.stage = 'diff' 131 132 AND diffSkyfile.fault = 0 133 AND diffSkyfile.quality = 0 132 134 AND magicDSFile.component IS NULL 133 135 ) as Foo -
trunk/ippTools/share/magictool_chipprocessedimfile.sql
r23389 r23688 26 26 chipRun.state = 'full' 27 27 AND chipProcessedImfile.fault = 0 28 AND chipProcessedImfile.quality = 0 28 29 -- AND magicRun.state = 'full' 29 30 -- AND magicMask.fault = 0 -
trunk/ippTools/share/magictool_definebyquery.sql
r20743 r23688 45 45 WHERE 46 46 diffSkyfile.fault = 0 47 AND diffSkyfile.quality = 0 47 48 -- WHERE hook %s 48 AND exp_id = 3647549 AND diffRun.label = 'magic_2008-11-12'49 AND exp_id = 36475 50 AND diffRun.label = 'magic_2008-11-12' 50 51 GROUP BY 51 52 exp_id, … … 79 80 JOIN diffRun USING(diff_id) 80 81 WHERE 81 warpSkyfile. ignored= 082 warpSkyfile.quality = 0 82 83 -- magicSkycellNums WHERE hook %s 83 84 AND exp_id = 36475 -
trunk/ippTools/share/magictool_definebyquery_insert.sql
r20973 r23688 9 9 diff_id = @DIFF_ID@ -- Update this with the appropriate diff_id 10 10 AND fault = 0 11 AND quality = 0 -
trunk/ippTools/share/magictool_definebyquery_select_test.sql
r20475 r23688 25 25 JOIN warpSkyfile USING(warp_id, skycell_id) 26 26 WHERE 27 warpSkyfile. ignored= 027 warpSkyfile.quality = 0 28 28 AND warpRun.state = 'full' 29 29 -- INSERT HERE any additional restrictions (e.g., exp_id, warpSkyfile.good_frac) -
trunk/ippTools/share/magictool_definebyquery_temp_insert.sql
r20973 r23688 20 20 WHERE 21 21 diffSkyfile.fault = 0 22 AND diffSkyfile.quality = 0 22 23 -- WHERE hook %s 23 24 GROUP BY -
trunk/ippTools/share/magictool_diffskyfile.sql
r23389 r23688 20 20 ON warpSkyfile.warp_id = warpSkyCellMap.warp_id 21 21 AND warpSkyfile.skycell_id = warpSkyCellMap.skycell_id 22 AND warpSkyfile. ignored= 022 AND warpSkyfile.quality = 0 23 23 WHERE 24 24 diffRun.state = 'full' 25 25 AND diffSkyfile.fault = 0 26 AND diffSkyfile.quality = 0 26 27 -- AND magicRun.state = 'full' 27 28 -- AND magicMask.fault = 0 -
trunk/ippTools/share/magictool_inputs.sql
r20973 r23688 10 10 diffSkyfile.path_base, 11 11 diffSkyfile.fault 12 diffSkyfile.quality 12 13 FROM magicRun 13 14 JOIN magicInputSkyfile … … 35 36 WHERE 36 37 fault = 0 38 AND quality = 0 -
trunk/ippTools/share/magictool_warpskyfile.sql
r23389 r23688 21 21 warpRun.state = 'full' 22 22 AND warpSkyfile.fault = 0 23 AND warpSkyfile.quality = 0 23 24 -- AND magicRun.state = 'full' 24 25 -- AND magicMask.fault = 0 -
trunk/ippTools/share/pxadmin_create_tables.sql
r23659 r23688 18 18 epoch TIMESTAMP DEFAULT CURRENT_TIMESTAMP, 19 19 PRIMARY KEY(exp_name, camera, telescope), 20 KEY(fault) )21 ENGINE=innodb DEFAULT CHARSET=latin1;20 KEY(fault) 21 ) ENGINE=innodb DEFAULT CHARSET=latin1; 22 22 23 23 CREATE TABLE summitImfile ( … … 34 34 PRIMARY KEY(exp_name, camera, telescope, class, class_id), 35 35 KEY(file_id), 36 FOREIGN KEY (exp_name, camera, telescope) 37 REFERENCES summitExp(exp_name, camera, telescope)) 38 ENGINE=innodb DEFAULT CHARSET=latin1; 36 FOREIGN KEY(exp_name, camera, telescope) REFERENCES summitExp(exp_name, camera, telescope) 37 ) ENGINE=innodb DEFAULT CHARSET=latin1; 39 38 40 39 CREATE TABLE pzDownloadExp ( … … 46 45 PRIMARY KEY(exp_name, camera, telescope), 47 46 KEY(state), 48 FOREIGN KEY (exp_name, camera, telescope) 49 REFERENCES summitExp(exp_name, camera, telescope)) 50 ENGINE=innodb DEFAULT CHARSET=latin1; 47 FOREIGN KEY(exp_name, camera, telescope) REFERENCES summitExp(exp_name, camera, telescope) 48 ) ENGINE=innodb DEFAULT CHARSET=latin1; 51 49 52 50 CREATE TABLE pzDownloadImfile ( … … 62 60 PRIMARY KEY(exp_name, camera, telescope, class, class_id), 63 61 KEY(fault), 64 FOREIGN KEY (exp_name, camera, telescope) 65 REFERENCES pzDownloadExp(exp_name, camera, telescope), 66 FOREIGN KEY (exp_name, camera, telescope, class, class_id) 67 REFERENCES summitImfile(exp_name, camera, telescope, class, class_id)) ENGINE=innodb DEFAULT CHARSET=latin1; 62 FOREIGN KEY (exp_name, camera, telescope) REFERENCES pzDownloadExp(exp_name, camera, telescope), 63 FOREIGN KEY(exp_name, camera, telescope, class, class_id) REFERENCES summitImfile(exp_name, camera, telescope, class, class_id) 64 ) ENGINE=innodb DEFAULT CHARSET=latin1; 68 65 69 66 CREATE TABLE newExp ( … … 98 95 epoch TIMESTAMP DEFAULT CURRENT_TIMESTAMP, 99 96 PRIMARY KEY(exp_id, tmp_class_id), 100 FOREIGN KEY (exp_id) 101 REFERENCES newExp(exp_id)) 102 ENGINE=innodb DEFAULT CHARSET=latin1; 97 FOREIGN KEY(exp_id) REFERENCES newExp(exp_id) 98 ) ENGINE=innodb DEFAULT CHARSET=latin1; 103 99 104 100 CREATE TABLE rawExp ( … … 172 168 KEY(end_stage), 173 169 KEY(fault), 174 FOREIGN KEY (exp_id) 175 REFERENCES newExp(exp_id)) 176 ENGINE=innodb DEFAULT CHARSET=latin1; 170 FOREIGN KEY(exp_id) REFERENCES newExp(exp_id) 171 ) ENGINE=innodb DEFAULT CHARSET=latin1; 177 172 178 173 CREATE TABLE rawImfile ( … … 237 232 ignored TINYINT DEFAULT 0, 238 233 hostname VARCHAR(64), 234 quality SMALLINT NOT NULL DEFAULT 0, 239 235 fault SMALLINT NOT NULL, 240 236 epoch TIMESTAMP DEFAULT CURRENT_TIMESTAMP, … … 245 241 KEY(fault), 246 242 KEY(raw_image_id), 243 KEY(quality), 247 244 UNIQUE KEY(exp_id, tmp_class_id), 248 FOREIGN KEY (exp_id, tmp_class_id) 249 REFERENCES newImfile(exp_id, tmp_class_id)) 250 ENGINE=innodb DEFAULT CHARSET=latin1; 251 252 CREATE TABLE guidePendingExp (guide_id BIGINT AUTO_INCREMENT, exp_id BIGINT, recipe VARCHAR(64), PRIMARY KEY(guide_id), KEY(guide_id), KEY(exp_id)) ENGINE=innodb DEFAULT CHARSET=latin1; 245 FOREIGN KEY(exp_id, tmp_class_id) REFERENCES newImfile(exp_id, tmp_class_id) 246 ) ENGINE=innodb DEFAULT CHARSET=latin1; 253 247 254 248 CREATE TABLE chipRun ( … … 273 267 KEY(end_stage), 274 268 INDEX(chip_id, exp_id), 275 FOREIGN KEY (exp_id) 276 REFERENCES rawExp(exp_id)) 277 ENGINE=innodb DEFAULT CHARSET=latin1; 269 FOREIGN KEY(exp_id) REFERENCES rawExp(exp_id) 270 ) ENGINE=innodb DEFAULT CHARSET=latin1; 278 271 279 272 CREATE TABLE chipImfile ( … … 283 276 PRIMARY KEY(chip_id, class_id), 284 277 KEY(chip_imfile_id), 285 FOREIGN KEY (chip_id) REFERENCES chipRun(chip_id))286 ENGINE=innodb DEFAULT CHARSET=latin1;278 FOREIGN KEY(chip_id) REFERENCES chipRun(chip_id) 279 ) ENGINE=innodb DEFAULT CHARSET=latin1; 287 280 288 281 CREATE TABLE chipProcessedImfile ( … … 343 336 n_cr INT, 344 337 path_base VARCHAR(255), 338 quality SMALLINT NOT NULL DEFAULT 0, 345 339 fault SMALLINT NOT NULL, 346 340 magicked BIGINT, … … 348 342 KEY(data_state), 349 343 KEY(fault), 350 FOREIGN KEY (chip_id, exp_id) 351 REFERENCES chipRun(chip_id, exp_id), 352 FOREIGN KEY (exp_id, class_id) 353 REFERENCES rawImfile(exp_id, class_id)) 354 ENGINE=innodb DEFAULT CHARSET=latin1; 344 KEY(quality), 345 FOREIGN KEY(chip_id, exp_id) REFERENCES chipRun(chip_id, exp_id), 346 FOREIGN KEY(exp_id, class_id) REFERENCES rawImfile(exp_id, class_id) 347 ) ENGINE=innodb DEFAULT CHARSET=latin1; 355 348 356 349 CREATE TABLE chipMask ( 357 350 label VARCHAR(64), 358 PRIMARY KEY(label) )359 ENGINE=innodb DEFAULT CHARSET=latin1;351 PRIMARY KEY(label) 352 ) ENGINE=innodb DEFAULT CHARSET=latin1; 360 353 361 354 CREATE TABLE camRun ( … … 380 373 KEY(end_stage), 381 374 INDEX(cam_id, chip_id), 382 FOREIGN KEY (chip_id) 383 REFERENCES chipRun(chip_id)) 384 ENGINE=innodb DEFAULT CHARSET=latin1; 375 FOREIGN KEY(chip_id) REFERENCES chipRun(chip_id) 376 ) ENGINE=innodb DEFAULT CHARSET=latin1; 385 377 386 378 CREATE TABLE camProcessedExp ( … … 444 436 n_astrom INT, 445 437 path_base VARCHAR(255), 438 quality SMALLINT NOT NULL DEFAULT 0, 446 439 fault SMALLINT NOT NULL, 447 440 PRIMARY KEY(cam_id), 448 441 KEY(fault), 449 FOREIGN KEY (cam_id)450 REFERENCES camRun(cam_id))451 ENGINE=innodb DEFAULT CHARSET=latin1;442 KEY(quality), 443 FOREIGN KEY(cam_id) REFERENCES camRun(cam_id) 444 ) ENGINE=innodb DEFAULT CHARSET=latin1; 452 445 453 446 CREATE TABLE camMask ( 454 447 label VARCHAR(64), 455 PRIMARY KEY(label) )456 ENGINE=innodb DEFAULT CHARSET=latin1;448 PRIMARY KEY(label) 449 ) ENGINE=innodb DEFAULT CHARSET=latin1; 457 450 458 451 CREATE TABLE fakeRun ( … … 475 468 KEY(end_stage), 476 469 INDEX(fake_id, cam_id), 477 FOREIGN KEY (cam_id) 478 REFERENCES camRun(cam_id)) 479 ENGINE=innodb DEFAULT CHARSET=latin1; 470 FOREIGN KEY(cam_id) REFERENCES camRun(cam_id) 471 ) ENGINE=innodb DEFAULT CHARSET=latin1; 480 472 481 473 CREATE TABLE fakeProcessedImfile ( … … 493 485 PRIMARY KEY(fake_id, exp_id, class_id), 494 486 KEY(fault), 495 FOREIGN KEY (fake_id) 496 REFERENCES fakeRun(fake_id), 497 FOREIGN KEY (exp_id, class_id) 498 REFERENCES rawImfile(exp_id, class_id)) 499 ENGINE=innodb DEFAULT CHARSET=latin1; 487 FOREIGN KEY(fake_id) REFERENCES fakeRun(fake_id), 488 FOREIGN KEY(exp_id, class_id) REFERENCES rawImfile(exp_id, class_id) 489 ) ENGINE=innodb DEFAULT CHARSET=latin1; 500 490 501 491 CREATE TABLE fakeMask ( 502 492 label VARCHAR(64), 503 PRIMARY KEY(label) )504 ENGINE=innodb DEFAULT CHARSET=latin1;493 PRIMARY KEY(label) 494 ) ENGINE=innodb DEFAULT CHARSET=latin1; 505 495 506 496 CREATE TABLE detRun ( … … 535 525 ref_det_id BIGINT, 536 526 ref_iter INT, 537 -- parent INT, :: dropping this538 527 PRIMARY KEY(det_id), 539 528 KEY(det_id), … … 543 532 KEY(state), 544 533 KEY(label), 545 -- KEY(parent), :: dropping this 546 INDEX(det_id, iteration)) 547 ENGINE=innodb DEFAULT CHARSET=latin1; 534 INDEX(det_id, iteration) 535 ) ENGINE=innodb DEFAULT CHARSET=latin1; 548 536 549 537 CREATE TABLE detInputExp ( 550 det_id BIGINT, 551 iteration INT, 552 exp_id BIGINT, 553 include TINYINT, 554 PRIMARY KEY(det_id, iteration, exp_id), 555 INDEX(det_id, exp_id), 556 INDEX(det_id, iteration), 557 FOREIGN KEY (det_id) 558 REFERENCES detRun(det_id), 559 FOREIGN KEY (exp_id) 560 REFERENCES rawExp(exp_id)) 561 ENGINE=innodb DEFAULT CHARSET=latin1; 538 det_id BIGINT, 539 iteration INT, 540 exp_id BIGINT, 541 include TINYINT, 542 PRIMARY KEY(det_id, iteration, exp_id), 543 INDEX(det_id, exp_id), 544 INDEX(det_id, iteration), 545 FOREIGN KEY(det_id) REFERENCES detRun(det_id), 546 FOREIGN KEY(exp_id) REFERENCES rawExp(exp_id) 547 ) ENGINE=innodb DEFAULT CHARSET=latin1; 562 548 563 549 CREATE TABLE detProcessedImfile ( … … 585 571 INDEX(det_id, class_id), 586 572 INDEX(det_id, exp_id), 587 FOREIGN KEY (det_id, exp_id) 588 REFERENCES detInputExp(det_id, exp_id), 589 FOREIGN KEY (exp_id, class_id) 590 REFERENCES rawImfile(exp_id, class_id) 573 FOREIGN KEY(det_id, exp_id) REFERENCES detInputExp(det_id, exp_id), 574 FOREIGN KEY(exp_id, class_id) REFERENCES rawImfile(exp_id, class_id) 591 575 ) ENGINE=innodb DEFAULT CHARSET=latin1; 592 576 … … 611 595 PRIMARY KEY(det_id, exp_id), 612 596 KEY(fault), 613 FOREIGN KEY (det_id, exp_id) 614 REFERENCES detInputExp(det_id, exp_id), 615 FOREIGN KEY (det_id, exp_id) 616 REFERENCES detProcessedImfile(det_id, exp_id) 597 FOREIGN KEY(det_id, exp_id) REFERENCES detInputExp(det_id, exp_id), 598 FOREIGN KEY(det_id, exp_id) REFERENCES detProcessedImfile(det_id, exp_id) 617 599 ) ENGINE=innodb DEFAULT CHARSET=latin1; 618 600 … … 635 617 PRIMARY KEY(det_id, iteration, class_id), 636 618 KEY(fault), 637 FOREIGN KEY (det_id, iteration) 638 REFERENCES detInputExp(det_id, iteration), 639 FOREIGN KEY (det_id, class_id) 640 REFERENCES detProcessedImfile(det_id, class_id) 619 FOREIGN KEY(det_id, iteration) REFERENCES detInputExp(det_id, iteration), 620 FOREIGN KEY(det_id, class_id) REFERENCES detProcessedImfile(det_id, class_id) 641 621 ) ENGINE=innodb DEFAULT CHARSET=latin1; 642 622 … … 650 630 PRIMARY KEY(det_id, iteration, class_id), 651 631 KEY(fault), 652 FOREIGN KEY (det_id, iteration) 653 REFERENCES detInputExp(det_id, iteration), 654 FOREIGN KEY (det_id, iteration, class_id) 655 REFERENCES detStackedImfile(det_id, iteration, class_id) 632 FOREIGN KEY(det_id, iteration) REFERENCES detInputExp(det_id, iteration), 633 FOREIGN KEY(det_id, iteration, class_id) REFERENCES detStackedImfile(det_id, iteration, class_id) 656 634 ) ENGINE=innodb DEFAULT CHARSET=latin1; 657 635 … … 675 653 KEY(fault), 676 654 INDEX(det_id, iteration), 677 FOREIGN KEY (det_id) 678 REFERENCES detInputExp(det_id), 679 FOREIGN KEY (det_id, iteration, class_id) 680 REFERENCES detNormalizedStatImfile(det_id, iteration, class_id) 655 FOREIGN KEY(det_id) REFERENCES detInputExp(det_id), 656 FOREIGN KEY(det_id, iteration, class_id) REFERENCES detNormalizedStatImfile(det_id, iteration, class_id) 681 657 ) ENGINE=innodb DEFAULT CHARSET=latin1; 682 658 … … 698 674 PRIMARY KEY(det_id, iteration), 699 675 KEY(fault), 700 FOREIGN KEY (det_id, iteration) 701 REFERENCES detInputExp(det_id, iteration), 702 FOREIGN KEY (det_id, iteration) 703 REFERENCES detNormalizedImfile(det_id, iteration) 676 FOREIGN KEY(det_id, iteration) REFERENCES detInputExp(det_id, iteration), 677 FOREIGN KEY(det_id, iteration) REFERENCES detNormalizedImfile(det_id, iteration) 704 678 ) ENGINE=innodb DEFAULT CHARSET=latin1; 705 679 … … 736 710 KEY(fault), 737 711 INDEX(det_id, iteration, exp_id), 738 FOREIGN KEY (det_id, iteration, exp_id) 739 REFERENCES detInputExp(det_id, iteration, exp_id), 740 FOREIGN KEY (det_id, exp_id, class_id) 741 REFERENCES detProcessedImfile(det_id, exp_id, class_id) 712 FOREIGN KEY (det_id, iteration, exp_id) REFERENCES detInputExp(det_id, iteration, exp_id), 713 FOREIGN KEY (det_id, exp_id, class_id) REFERENCES detProcessedImfile(det_id, exp_id, class_id) 742 714 ) ENGINE=innodb DEFAULT CHARSET=latin1; 743 715 … … 771 743 KEY(fault), 772 744 INDEX(det_id, iteration), 773 FOREIGN KEY (det_id, iteration, exp_id) 774 REFERENCES detInputExp(det_id, iteration, exp_id), 775 FOREIGN KEY (det_id, iteration, exp_id) 776 REFERENCES detResidImfile(det_id, iteration, exp_id) 745 FOREIGN KEY(det_id, iteration, exp_id) REFERENCES detInputExp(det_id, iteration, exp_id), 746 FOREIGN KEY(det_id, iteration, exp_id) REFERENCES detResidImfile(det_id, iteration, exp_id) 777 747 ) ENGINE=innodb DEFAULT CHARSET=latin1; 778 748 … … 788 758 PRIMARY KEY(det_id, iteration), 789 759 KEY(fault), 790 FOREIGN KEY (det_id, iteration) 791 REFERENCES detInputExp(det_id, iteration), 792 FOREIGN KEY (det_id, iteration) 793 REFERENCES detResidExp(det_id, iteration) 760 FOREIGN KEY(det_id, iteration) REFERENCES detInputExp(det_id, iteration), 761 FOREIGN KEY(det_id, iteration) REFERENCES detResidExp(det_id, iteration) 794 762 ) ENGINE=innodb DEFAULT CHARSET=latin1; 795 763 … … 812 780 PRIMARY KEY(det_id, iteration, class_id), 813 781 KEY(fault), 814 FOREIGN KEY (det_id, iteration) 815 REFERENCES detRun(det_id, iteration) 782 FOREIGN KEY(det_id, iteration) REFERENCES detRun(det_id, iteration) 816 783 ) ENGINE=innodb DEFAULT CHARSET=latin1; 817 784 … … 838 805 KEY(end_stage), 839 806 INDEX(warp_id, fake_id), 840 FOREIGN KEY (fake_id) 841 REFERENCES fakeRun(fake_id) 807 FOREIGN KEY(fake_id) REFERENCES fakeRun(fake_id) 842 808 ) ENGINE=innodb DEFAULT CHARSET=latin1; 843 809 … … 850 816 PRIMARY KEY(warp_id, skycell_id, tess_id, class_id), 851 817 KEY(fault), 852 FOREIGN KEY (warp_id) 853 REFERENCES warpRun(warp_id) 818 FOREIGN KEY(warp_id) REFERENCES warpRun(warp_id) 854 819 ) ENGINE=innodb DEFAULT CHARSET=latin1; 855 820 … … 860 825 PRIMARY KEY(warp_id, skycell_id), 861 826 KEY(warp_skyfile_id), 862 FOREIGN KEY (warp_id) REFERENCES warpRun(warp_id))863 ENGINE=innodb DEFAULT CHARSET=latin1;827 FOREIGN KEY(warp_id) REFERENCES warpRun(warp_id) 828 ) ENGINE=innodb DEFAULT CHARSET=latin1; 864 829 865 830 … … 881 846 ymin INT, 882 847 ymax INT, 883 ignored TINYINT,848 quality SMALLINT NOT NULL DEFAULT 0, 884 849 fault SMALLINT, 885 850 magicked TINYINT, 886 851 PRIMARY KEY(warp_id, skycell_id, tess_id), 887 852 KEY(good_frac), 888 KEY( ignored), KEY(fault),889 FOREIGN KEY (warp_id, skycell_id, tess_id)890 REFERENCES warpSkyCellMap(warp_id, skycell_id, tess_id)853 KEY(fault), 854 KEY(quality), 855 FOREIGN KEY(warp_id, skycell_id, tess_id) REFERENCES warpSkyCellMap(warp_id, skycell_id, tess_id) 891 856 ) ENGINE=innodb DEFAULT CHARSET=latin1; 892 857 … … 918 883 warp_id BIGINT, 919 884 PRIMARY KEY(stack_id, warp_id), 920 FOREIGN KEY (stack_id) REFERENCESstackRun(stack_id),921 FOREIGN KEY (warp_id) REFERENCESwarpSkyfile(warp_id)885 FOREIGN KEY(stack_id) REFERENCES stackRun(stack_id), 886 FOREIGN KEY(warp_id) REFERENCES warpSkyfile(warp_id) 922 887 ) ENGINE=innodb DEFAULT CHARSET=latin1; 923 888 … … 948 913 hostname VARCHAR(64), 949 914 good_frac FLOAT, 915 quality SMALLINT NOT NULL DEFAULT 0, 950 916 fault SMALLINT, 951 917 PRIMARY KEY(stack_id), … … 953 919 KEY(good_frac), 954 920 KEY(fault), 955 FOREIGN KEY (stack_id) REFERENCES stackRun(stack_id) 921 KEY(quality), 922 FOREIGN KEY(stack_id) REFERENCES stackRun(stack_id) 956 923 ) ENGINE=innodb DEFAULT CHARSET=latin1; 957 924 … … 971 938 KEY(state), 972 939 KEY(tess_id), 973 FOREIGN KEY (exp_id) REFERENCES rawExp(exp_id)940 FOREIGN KEY(exp_id) REFERENCES rawExp(exp_id) 974 941 ) ENGINE=innodb DEFAULT CHARSET=latin1; 975 942 … … 991 958 KEY(skycell_id), 992 959 KEY(tess_id), 993 FOREIGN KEY (diff_id) REFERENCESdiffRun(diff_id),994 FOREIGN KEY (warp1, skycell_id, tess_id) REFERENCESwarpSkyfile(warp_id, skycell_id, tess_id),995 FOREIGN KEY (warp2, skycell_id, tess_id) REFERENCESwarpSkyfile(warp_id, skycell_id, tess_id),996 FOREIGN KEY (stack1) REFERENCESstackSumSkyfile(stack_id),997 FOREIGN KEY (stack2) REFERENCESstackSumSkyfile(stack_id)960 FOREIGN KEY(diff_id) REFERENCES diffRun(diff_id), 961 FOREIGN KEY(warp1, skycell_id, tess_id) REFERENCES warpSkyfile(warp_id, skycell_id, tess_id), 962 FOREIGN KEY(warp2, skycell_id, tess_id) REFERENCES warpSkyfile(warp_id, skycell_id, tess_id), 963 FOREIGN KEY(stack1) REFERENCES stackSumSkyfile(stack_id), 964 FOREIGN KEY(stack2) REFERENCES stackSumSkyfile(stack_id) 998 965 ) ENGINE=innodb DEFAULT CHARSET=latin1; 999 966 … … 1022 989 hostname VARCHAR(64), 1023 990 good_frac FLOAT, 991 quality SMALLINT NOT NULL DEFAULT 0, 1024 992 fault SMALLINT, 1025 993 magicked TINYINT, … … 1027 995 KEY(good_frac), 1028 996 KEY(fault), 1029 FOREIGN KEY (diff_id) REFERENCES diffRun(diff_id) 997 KEY(quality), 998 FOREIGN KEY(diff_id) REFERENCES diffRun(diff_id) 1030 999 ) ENGINE=innodb DEFAULT CHARSET=latin1; 1031 1000 … … 1047 1016 KEY(label), 1048 1017 KEY(fault), 1049 FOREIGN KEY (exp_id) REFERENCES rawExp(exp_id),1050 FOREIGN KEY (diff_id) REFERENCES diffRun(diff_id)1018 FOREIGN KEY(exp_id) REFERENCES rawExp(exp_id), 1019 FOREIGN KEY(diff_id) REFERENCES diffRun(diff_id) 1051 1020 ) ENGINE=innodb DEFAULT CHARSET=latin1; 1052 1021 … … 1056 1025 node VARCHAR(64), 1057 1026 PRIMARY KEY(magic_id, diff_id, node), 1058 FOREIGN KEY (magic_id) REFERENCESmagicRun(magic_id),1059 FOREIGN KEY (diff_id) REFERENCES diffRun(diff_id)1027 FOREIGN KEY(magic_id) REFERENCES magicRun(magic_id), 1028 FOREIGN KEY(diff_id) REFERENCES diffRun(diff_id) 1060 1029 ) ENGINE=innodb DEFAULT CHARSET=latin1; 1061 1030 … … 1068 1037 KEY(dep), 1069 1038 INDEX(magic_id, node), 1070 FOREIGN KEY (magic_id) REFERENCESmagicRun(magic_id)1039 FOREIGN KEY(magic_id) REFERENCES magicRun(magic_id) 1071 1040 ) ENGINE=innodb DEFAULT CHARSET=latin1; 1072 1041 … … 1077 1046 fault SMALLINT, 1078 1047 PRIMARY KEY(magic_id, node), 1079 FOREIGN KEY (magic_id) REFERENCESmagicRun(magic_id),1080 FOREIGN KEY (magic_id, node) REFERENCESmagicTree(magic_id, node),1048 FOREIGN KEY(magic_id) REFERENCES magicRun(magic_id), 1049 FOREIGN KEY(magic_id, node) REFERENCES magicTree(magic_id, node), 1081 1050 KEY(fault) 1082 1051 ) ENGINE=innodb DEFAULT CHARSET=latin1; … … 1088 1057 fault SMALLINT, 1089 1058 PRIMARY KEY(magic_id), 1090 FOREIGN KEY (magic_id) REFERENCESmagicRun(magic_id),1059 FOREIGN KEY(magic_id) REFERENCES magicRun(magic_id), 1091 1060 KEY(fault) 1092 1061 ) ENGINE=innodb DEFAULT CHARSET=latin1; … … 1109 1078 KEY(magic_id), 1110 1079 KEY(label), 1111 FOREIGN KEY (magic_id) REFERENCESmagicRun(magic_id)1080 FOREIGN KEY(magic_id) REFERENCES magicRun(magic_id) 1112 1081 ) ENGINE=innodb DEFAULT CHARSET=latin1; 1113 1082 … … 1120 1089 PRIMARY KEY(magic_ds_id, component), 1121 1090 KEY(fault), 1122 FOREIGN KEY (magic_ds_id) REFERENCES magicDSRun(magic_ds_id)1091 FOREIGN KEY(magic_ds_id) REFERENCES magicDSRun(magic_ds_id) 1123 1092 ) ENGINE=innodb DEFAULT CHARSET=latin1; 1124 1093 … … 1139 1108 KEY(cal_id), 1140 1109 KEY(last_step), 1141 FOREIGN KEY (cal_id) REFERENCEScalDB(cal_id)1110 FOREIGN KEY(cal_id) REFERENCES calDB(cal_id) 1142 1111 ) ENGINE=innodb DEFAULT CHARSET=latin1; 1143 1112 … … 1167 1136 include TINYINT, 1168 1137 PRIMARY KEY(corr_id, chip_id), 1169 FOREIGN KEY (corr_id) REFERENCESflatcorrRun(corr_id),1170 FOREIGN KEY (chip_id) REFERENCESchipRun(chip_id)1138 FOREIGN KEY(corr_id) REFERENCES flatcorrRun(corr_id), 1139 FOREIGN KEY(chip_id) REFERENCES chipRun(chip_id) 1171 1140 ) ENGINE=innodb DEFAULT CHARSET=latin1; 1172 1141 … … 1177 1146 include TINYINT, 1178 1147 PRIMARY KEY(corr_id, cam_id), 1179 FOREIGN KEY (corr_id) REFERENCESflatcorrRun(corr_id),1180 FOREIGN KEY (chip_id) REFERENCESchipRun(chip_id),1181 FOREIGN KEY (cam_id) REFERENCEScamRun(cam_id)1148 FOREIGN KEY(corr_id) REFERENCES flatcorrRun(corr_id), 1149 FOREIGN KEY(chip_id) REFERENCES chipRun(chip_id), 1150 FOREIGN KEY(cam_id) REFERENCES camRun(cam_id) 1182 1151 ) ENGINE=innodb DEFAULT CHARSET=latin1; 1183 1152 … … 1231 1200 PRIMARY KEY(job_id, req_id), 1232 1201 KEY(job_id), 1233 FOREIGN KEY (req_id) REFERENCESpstampRequest(req_id)1202 FOREIGN KEY(req_id) REFERENCES pstampRequest(req_id) 1234 1203 ) ENGINE=innodb DEFAULT CHARSET=latin1; 1235 1204 1236 1205 CREATE TABLE distTarget ( 1237 target_id BIGINT AUTO_INCREMENT, 1206 target_id BIGINT AUTO_INCREMENT, 1238 1207 obs_mode VARCHAR(64), 1239 1208 stage VARCHAR(64), … … 1263 1232 1264 1233 CREATE TABLE distComponent ( 1265 dist_id BIGINT, 1234 dist_id BIGINT, 1266 1235 component VARCHAR(64), 1267 1236 bytes INT, … … 1335 1304 1336 1305 1337 -- This comment line is here to avoid empty query error. 1306 -- This comment line is here to avoid empty query error. 1338 1307 -- Another way to avoid that problem is to omit the semicolon above but I think that is untidy. -
trunk/ippTools/share/pxadmin_drop_tables.sql
r23390 r23688 1 1 SET FOREIGN_KEY_CHECKS=0; 2 2 3 DROP TABLE IF EXISTS pzDataStore; 3 4 DROP TABLE IF EXISTS summitExp; … … 9 10 DROP TABLE IF EXISTS rawExp; 10 11 DROP TABLE IF EXISTS rawImfile; 11 DROP TABLE IF EXISTS guidePendingExp;12 12 DROP TABLE IF EXISTS chipRun; 13 13 DROP TABLE IF EXISTS chipProcessedImfile; -
trunk/ippTools/share/stacktool_definebyquery_insert.sql
r19258 r23688 21 21 AND rawExp.filter = '%s' 22 22 AND warpSkyfile.fault = 0 23 AND warpSkyfile. ignored= 023 AND warpSkyfile.quality = 0 -
trunk/ippTools/share/stacktool_definebyquery_insert_random_part1.sql
r19258 r23688 28 28 AND rawExp.filter = '%s' -- the result of the query is grouped by filter and inserted for one at a time 29 29 AND warpSkyfile.fault = 0 30 AND warpSkyfile. ignored= 030 AND warpSkyfile.quality = 0 31 31 -- Put additional constraints here 32 32 -- stacktool_definebyquery_insert_random_part2.sql goes here -
trunk/ippTools/share/stacktool_definebyquery_part1.sql
r19258 r23688 17 17 COUNT(warpSkyfile.skycell_id) AS num_warp -- number of warps that can be stacked 18 18 FROM warpRun 19 JOIN warpSkyfile USING(warp_id)20 JOIN fakeRun USING(fake_id)21 JOIN camRun USING(cam_id)22 JOIN chipRun USING(chip_id)23 JOIN rawExp USING(exp_id)19 JOIN warpSkyfile USING(warp_id) 20 JOIN fakeRun USING(fake_id) 21 JOIN camRun USING(cam_id) 22 JOIN chipRun USING(chip_id) 23 JOIN rawExp USING(exp_id) 24 24 WHERE 25 25 warpRun.state = 'full' 26 AND warpSkyfile.ignored= 027 AND warpSkyfile.fault= 026 AND warpSkyfile.fault = 0 27 AND warpSkyfile.quality = 0 28 28 -- Here should follow the SQL in stacktool_definebyquery_part2.sql, 29 29 -- after any additional WHERE conditions have been added -
trunk/ippTools/share/stacktool_definebyquery_test.sql
r19258 r23688 31 31 WHERE 32 32 warpRun.state = 'full' 33 AND warpSkyfile. ignored= 033 AND warpSkyfile.quality = 0 34 34 AND warpSkyfile.fault = 0 35 35 -- Any additional selection on warps/exposures goes here -
trunk/ippTools/share/stacktool_find_complete_warps.sql
r19258 r23688 6 6 COUNT(stackRun.stack_id) AS num_extant 7 7 FROM warpRun 8 JOIN warpSkyfile 8 JOIN warpSkyfile 9 9 USING(warp_id) 10 10 JOIN fakeRun … … 23 23 WHERE 24 24 warpRun.state = 'full' 25 AND warpSkyfile.ignored = 0 25 AND warpSkyfile.fault = 0 26 AND warpSkyfile.quality = 0 26 27 GROUP BY 27 28 warpSkyfile.skycell_id, stackRun.stack_id -
trunk/ippTools/share/stacktool_tosum.sql
r19678 r23688 12 12 USING(stack_id) 13 13 WHERE 14 ((stackRun.state = 'new' 15 AND stackSumSkyfile.stack_id IS NULL) 16 OR 17 (stackRun.state = 'update' 18 AND stackSumSkyfile.fault = 0)) 14 ((stackRun.state = 'new' AND stackSumSkyfile.stack_id IS NULL) 15 OR (stackRun.state = 'update' AND stackSumSkyfile.fault = 0 AND stackSumSkyfile.quality = 0)) -
trunk/ippTools/share/warptool_finished_run_select.sql
r23459 r23688 19 19 HAVING 20 20 COUNT(warpSkyCellMap.warp_id) = COUNT(warpSkyfile.warp_id) 21 AND SUM(warpSkyfile.fault ) = 021 AND SUM(warpSkyfile.fault > 0) = 0 22 22 ) as Foo -
trunk/ippTools/share/warptool_imfile.sql
r20608 r23688 26 26 AND camRun.state = 'full' 27 27 AND chipRun.state = 'full' 28 AND chipProcessedImfile.quality = 0 29 and camProcessedExp.quality = 0 28 30 -
trunk/ippTools/share/warptool_revertwarped_delete.sql
r20722 r23688 7 7 AND chipRun.exp_id = rawExp.exp_id 8 8 AND warpSkyfile.fault != 0 9 -
trunk/ippTools/src/camtool.c
r23616 r23688 468 468 469 469 PXOPT_LOOKUP_STR(path_base, config->args, "-path_base", false, false); 470 PXOPT_LOOKUP_S16(code, config->args, "-code", false, false); 470 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 471 PXOPT_LOOKUP_S16(quality, config->args, "-quality", false, false); 471 472 472 473 // generate restrictions … … 533 534 zpt_lq, 534 535 zpt_uq, 535 fwhm_major,536 fwhm_major_lq,537 fwhm_major_uq,538 fwhm_minor,539 fwhm_minor_lq,540 fwhm_minor_uq,541 542 iq_fwhm_major,543 iq_fwhm_major_err,544 iq_fwhm_minor,545 iq_fwhm_minor_err,536 fwhm_major, 537 fwhm_major_lq, 538 fwhm_major_uq, 539 fwhm_minor, 540 fwhm_minor_lq, 541 fwhm_minor_uq, 542 543 iq_fwhm_major, 544 iq_fwhm_major_err, 545 iq_fwhm_minor, 546 iq_fwhm_minor_err, 546 547 547 548 iq_m2, … … 576 577 n_astrom, 577 578 path_base, 578 code 579 fault, 580 quality 579 581 ); 580 582 … … 599 601 600 602 // NULL for end_stage means go as far as possible 601 // EAM : skip here if code!= 0603 // EAM : skip here if fault != 0 602 604 // Also, we can run fake even if tess_id is not defined 603 if ( code|| (pendingRow->end_stage && psStrcasestr(pendingRow->end_stage, "cam"))) {605 if (fault || (pendingRow->end_stage && psStrcasestr(pendingRow->end_stage, "cam"))) { 604 606 psFree(row); 605 607 psFree(pendingRow); … … 745 747 PXOPT_COPY_STR(config->args, where, "-label", "camRun.label", "=="); 746 748 PXOPT_COPY_STR(config->args, where, "-reduction", "camRun.reduction", "=="); 747 PXOPT_COPY_S16(config->args, where, "- code","camProcessedExp.fault", "==");749 PXOPT_COPY_S16(config->args, where, "-fault", "camProcessedExp.fault", "=="); 748 750 749 751 if (!psListLength(where->list) && !psMetadataLookupBool(NULL, config->args, "-all")) { … … 833 835 PS_ASSERT_PTR_NON_NULL(config, false); 834 836 835 PXOPT_LOOKUP_S16( code, config->args, "-code", true, false);837 PXOPT_LOOKUP_S16(fault, config->args, "-fault", true, false); 836 838 837 839 psMetadata *where = psMetadataAlloc(); … … 841 843 PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "=="); 842 844 843 if (!pxSetFaultCode(config->dbh, "camProcessedExp", where, code)) {845 if (!pxSetFaultCode(config->dbh, "camProcessedExp", where, fault)) { 844 846 psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag"); 845 847 psFree (where); … … 1114 1116 char sqlFilename[80]; 1115 1117 } ExportTable; 1116 1118 1117 1119 int numExportTables = 2; 1118 1120 … … 1194 1196 1195 1197 PS_ASSERT_PTR_NON_NULL(config, NULL); 1196 1198 1197 1199 PXOPT_LOOKUP_STR(infile, config->args, "-infile", true, false); 1198 1200 … … 1205 1207 psAssert (item, "entry not in input?"); 1206 1208 psAssert (item->type == PS_DATA_METADATA_MULTI, "entry not multi?"); 1207 1209 1208 1210 psMetadataItem *entry = psListGet (item->data.list, 0); 1209 1211 assert (entry); … … 1214 1216 // fprintf (stdout, "---- cam run ----\n"); 1215 1217 // psMetadataPrint (stderr, entry->data.md, 1); 1216 1218 1217 1219 item = psMetadataLookup (input, "camProcessedImfile"); 1218 1220 psAssert (item, "entry not in input?"); -
trunk/ippTools/src/camtoolConfig.c
r23616 r23688 164 164 165 165 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-path_base", 0, "define base output location", NULL); 166 psMetadataAddS16(addprocessedexpArgs, PS_LIST_TAIL, "-code", 0, "set fault code", 0); 166 psMetadataAddS16(addprocessedexpArgs, PS_LIST_TAIL, "-fault", 0, "set fault code", 0); 167 psMetadataAddS16(addprocessedexpArgs, PS_LIST_TAIL, "-quality", 0, "set quality", 0); 167 168 psMetadataAddBool(addprocessedexpArgs, PS_LIST_TAIL, "-faulted", 0, "only return imfiles with a fault status set", false); 168 169 … … 191 192 192 193 psMetadataAddBool(revertprocessedexpArgs, PS_LIST_TAIL, "-all", 0, "allow everything to be queued without search terms", false); 194 psMetadataAddS16(revertprocessedexpArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 193 195 194 196 // -updateprocessedexp … … 199 201 psMetadataAddStr(updateprocessedexpArgs, PS_LIST_TAIL, "-class", 0, "search by class", NULL); 200 202 psMetadataAddStr(updateprocessedexpArgs, PS_LIST_TAIL, "-class_id", 0, "search by class ID", NULL); 201 psMetadataAddS16(updateprocessedexpArgs, PS_LIST_TAIL, "- code", 0, "set fault code (required)", INT16_MAX);203 psMetadataAddS16(updateprocessedexpArgs, PS_LIST_TAIL, "-fault", 0, "set fault code (required)", INT16_MAX); 202 204 203 205 // -block -
trunk/ippTools/src/chiptool.c
r23657 r23688 409 409 PXOPT_LOOKUP_F32(dtime_script, config->args, "-dtime_script", false, false); 410 410 PXOPT_LOOKUP_STR(hostname, config->args, "-hostname", false, false); 411 PXOPT_LOOKUP_F32(n_stars, config->args, "-n_stars", false, false);412 PXOPT_LOOKUP_F32(n_psfstars, config->args, "-n_psfstars", false, false);413 PXOPT_LOOKUP_F32(n_iqstars, config->args, "-n_iqstars", false, false);414 PXOPT_LOOKUP_F32(n_extended, config->args, "-n_extended", false, false);415 PXOPT_LOOKUP_F32(n_cr, config->args, "-n_cr", false, false);416 PXOPT_LOOKUP_STR(path_base, config->args, "-path_base", false, false);417 PXOPT_LOOKUP_BOOL(magicked, config->args, "-magicked", false);411 PXOPT_LOOKUP_F32(n_stars, config->args, "-n_stars", false, false); 412 PXOPT_LOOKUP_F32(n_psfstars, config->args, "-n_psfstars", false, false); 413 PXOPT_LOOKUP_F32(n_iqstars, config->args, "-n_iqstars", false, false); 414 PXOPT_LOOKUP_F32(n_extended, config->args, "-n_extended", false, false); 415 PXOPT_LOOKUP_F32(n_cr, config->args, "-n_cr", false, false); 416 PXOPT_LOOKUP_STR(path_base, config->args, "-path_base", false, false); 417 PXOPT_LOOKUP_BOOL(magicked, config->args, "-magicked", false); 418 418 419 419 // default values 420 PXOPT_LOOKUP_S16(code, config->args, "-code", false, false); 420 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 421 PXOPT_LOOKUP_S16(quality, config->args, "-quality", false, false); 421 422 422 423 if (!psDBTransaction(config->dbh)) { … … 449 450 fwhm_minor_uq, 450 451 451 iq_fwhm_major,452 iq_fwhm_major_err,453 iq_fwhm_minor,454 iq_fwhm_minor_err,455 456 iq_m2,457 iq_m2_err,458 iq_m2_lq,459 iq_m2_uq,460 461 iq_m2c,462 iq_m2c_err,463 iq_m2c_lq,464 iq_m2c_uq,465 466 iq_m2s,467 iq_m2s_err,468 iq_m2s_lq,469 iq_m2s_uq,470 471 iq_m3,472 iq_m3_err,473 iq_m3_lq,474 iq_m3_uq,475 476 iq_m4,477 iq_m4_err,478 iq_m4_lq,479 iq_m4_uq,452 iq_fwhm_major, 453 iq_fwhm_major_err, 454 iq_fwhm_minor, 455 iq_fwhm_minor_err, 456 457 iq_m2, 458 iq_m2_err, 459 iq_m2_lq, 460 iq_m2_uq, 461 462 iq_m2c, 463 iq_m2c_err, 464 iq_m2c_lq, 465 iq_m2c_uq, 466 467 iq_m2s, 468 iq_m2s_err, 469 iq_m2s_lq, 470 iq_m2s_uq, 471 472 iq_m3, 473 iq_m3_err, 474 iq_m3_lq, 475 iq_m3_uq, 476 477 iq_m4, 478 iq_m4_err, 479 iq_m4_lq, 480 iq_m4_uq, 480 481 481 482 dtime_detrend, … … 490 491 n_cr, 491 492 path_base, 492 code, 493 fault, 494 quality, 493 495 magicked 494 496 )) { … … 618 620 PXOPT_COPY_STR(config->args, where, "-label", "chipRun.label", "LIKE"); 619 621 PXOPT_COPY_STR(config->args, where, "-reduction", "chipRun.reduction", "=="); 620 PXOPT_COPY_S16(config->args, where, "- code", "chipProcessedImfile.fault", "==");622 PXOPT_COPY_S16(config->args, where, "-fault", "chipProcessedImfile.fault", "=="); 621 623 622 624 if (!psListLength(where->list) … … 659 661 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); 660 662 PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "=="); 661 PXOPT_LOOKUP_S16( code, config->args, "-code", true, false);662 663 if (!pxSetFaultCode(config->dbh, "chipProcessedImfile", where, code)) {663 PXOPT_LOOKUP_S16(fault, config->args, "-fault", true, false); 664 665 if (!pxSetFaultCode(config->dbh, "chipProcessedImfile", where, fault)) { 664 666 psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag"); 665 667 return false; … … 1280 1282 char sqlFilename[80]; 1281 1283 } ExportTable; 1282 1284 1283 1285 int numExportTables = 3; 1284 1286 … … 1360 1362 { 1361 1363 unsigned int nFail; 1362 1364 1363 1365 int numImportTables = 2; 1364 1366 1365 1367 char tables[2] [80] = {"chipImfile", "chipProcessedImfile"}; 1366 1368 1367 1369 PS_ASSERT_PTR_NON_NULL(config, NULL); 1368 1370 1369 1371 PXOPT_LOOKUP_STR(infile, config->args, "-infile", true, false); 1370 1372 … … 1386 1388 // fprintf (stdout, "---- chip run ----\n"); 1387 1389 // psMetadataPrint (stderr, entry->data.md, 1); 1388 1390 1389 1391 for (int i = 0; i < numImportTables; i++) { 1390 1392 psMetadataItem *item = psMetadataLookup (input, tables[i]); 1391 1393 psAssert (item, "entry not in input?"); 1392 1394 psAssert (item->type == PS_DATA_METADATA_MULTI, "entry not multi?"); 1393 1395 1394 1396 switch (i) { 1395 1397 case 0: … … 1405 1407 } 1406 1408 break; 1407 1409 1408 1410 case 1: 1409 1411 for (int i = 0; i < item->data.list->n; i++) { -
trunk/ippTools/src/chiptoolConfig.c
r23615 r23688 146 146 147 147 psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-path_base", 0, "define base output location", NULL); 148 psMetadataAddS16(addprocessedimfileArgs, PS_LIST_TAIL, "-code", 0, "set fault code", 0); 148 psMetadataAddS16(addprocessedimfileArgs, PS_LIST_TAIL, "-fault", 0, "set fault code", 0); 149 psMetadataAddS16(addprocessedimfileArgs, PS_LIST_TAIL, "-quality", 0, "set quality", 0); 149 150 psMetadataAddBool(addprocessedimfileArgs, PS_LIST_TAIL, "-magicked", 0, "define magicked status", false); 150 151 … … 171 172 pxchipSetSearchArgs(revertprocessedimfileArgs); 172 173 psMetadataAddBool(revertprocessedimfileArgs, PS_LIST_TAIL, "-all", 0, "allow everything to be queued without search terms", false); 173 psMetadataAddS16(revertprocessedimfileArgs, PS_LIST_TAIL, "- code", 0, "search by fault code", 0);174 psMetadataAddS16(revertprocessedimfileArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 174 175 175 176 // -updateprocessedimfile … … 177 178 psMetadataAddS64(updateprocessedimfileArgs, PS_LIST_TAIL, "-chip_id", 0, "search by chip ID", 0); 178 179 psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-class_id", 0, "search by class ID", NULL); 179 psMetadataAddS16(updateprocessedimfileArgs, PS_LIST_TAIL, "- code", 0, "set fault code (required)", 0);180 psMetadataAddS16(updateprocessedimfileArgs, PS_LIST_TAIL, "-fault", 0, "set fault code (required)", 0); 180 181 181 182 // -advanceexp -
trunk/ippTools/src/dettoolConfig.c
r23332 r23688 254 254 psMetadataAddS64(addprocessedimfileArgs, PS_LIST_TAIL, "-exp_id", 0, "define exp ID (required)", 0); 255 255 psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-class_id", 0, "define class ID (required)", NULL); 256 psMetadataAddS16(addprocessedimfileArgs, PS_LIST_TAIL, "- code", 0, "set fault code", 0);256 psMetadataAddS16(addprocessedimfileArgs, PS_LIST_TAIL, "-fault", 0, "set fault code", 0); 257 257 psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-uri", 0, "define URI", NULL); 258 258 psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-recip", 0, "define recipe", NULL); … … 287 287 psMetadataAddS64(revertprocessedimfileArgs, PS_LIST_TAIL, "-exp_id", 0, "search by exposure ID", 0); 288 288 psMetadataAddStr(revertprocessedimfileArgs, PS_LIST_TAIL, "-class_id", 0, "search by class ID", NULL); 289 psMetadataAddS16(revertprocessedimfileArgs, PS_LIST_TAIL, "- code", 0, "search by fault code", 0);289 psMetadataAddS16(revertprocessedimfileArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 290 290 291 291 // -updateprocessedimfile … … 334 334 psMetadataAddF64(addprocessedexpArgs, PS_LIST_TAIL, "-user_5", 0, "define user statistic (5)", NAN); 335 335 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-path_base", 0, "define base output location", NULL); 336 psMetadataAddS16(addprocessedexpArgs, PS_LIST_TAIL, "- code", 0, "set fault code", 0);336 psMetadataAddS16(addprocessedexpArgs, PS_LIST_TAIL, "-fault", 0, "set fault code", 0); 337 337 338 338 // -proccessedexp … … 348 348 psMetadataAddS64(revertprocessedexpArgs, PS_LIST_TAIL, "-det_id", 0, "search by detrend ID (required)", 0); 349 349 psMetadataAddS64(revertprocessedexpArgs, PS_LIST_TAIL, "-exp_id", 0, "search by exposure ID", 0); 350 psMetadataAddS16(revertprocessedexpArgs, PS_LIST_TAIL, "- code", 0, "search by fault code", 0);350 psMetadataAddS16(revertprocessedexpArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 351 351 352 352 // -updateprocessedexp … … 380 380 psMetadataAddS32(addstackedArgs, PS_LIST_TAIL, "-iteration", 0, "define iteration number (required)", 0); 381 381 psMetadataAddStr(addstackedArgs, PS_LIST_TAIL, "-class_id", 0, "define class ID (required)", NULL); 382 psMetadataAddS16(addstackedArgs, PS_LIST_TAIL, "- code", 0, "set fault code", 0);382 psMetadataAddS16(addstackedArgs, PS_LIST_TAIL, "-fault", 0, "set fault code", 0); 383 383 psMetadataAddStr(addstackedArgs, PS_LIST_TAIL, "-uri", 0, "define URI", NULL); 384 384 psMetadataAddStr(addstackedArgs, PS_LIST_TAIL, "-recip", 0, "define recipe", NULL); … … 407 407 psMetadataAddS32(revertstackedArgs, PS_LIST_TAIL, "-iteration", 0, "search by iteration number", 0); 408 408 psMetadataAddStr(revertstackedArgs, PS_LIST_TAIL, "-class_id", 0, "search by class ID", NULL); 409 psMetadataAddS16(revertstackedArgs, PS_LIST_TAIL, "- code", 0, "search by fault code", 0);409 psMetadataAddS16(revertstackedArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 410 410 411 411 // -updatestacked … … 443 443 psMetadataAddStr(addnormstatArgs, PS_LIST_TAIL, "-class_id", 0, "define class ID (required)", NULL); 444 444 psMetadataAddF32(addnormstatArgs, PS_LIST_TAIL, "-norm", 0, "define normal value (required)", NAN); 445 psMetadataAddS16(addnormstatArgs, PS_LIST_TAIL, "- code", 0, "set fault code", 0);445 psMetadataAddS16(addnormstatArgs, PS_LIST_TAIL, "-fault", 0, "set fault code", 0); 446 446 447 447 // -normalizedstat … … 459 459 psMetadataAddS32(revertnormalizedstatArgs, PS_LIST_TAIL, "-iteration", 0, "search by iteration number", 0); 460 460 psMetadataAddStr(revertnormalizedstatArgs, PS_LIST_TAIL, "-class_id", 0, "search by class ID", NULL); 461 psMetadataAddS16(revertnormalizedstatArgs, PS_LIST_TAIL, "- code", 0, "search by fault code", 0);461 psMetadataAddS16(revertnormalizedstatArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 462 462 463 463 // -updatenormalizedstat … … 494 494 psMetadataAddS32(addnormalizedimfileArgs, PS_LIST_TAIL, "-iteration", 0, "define iteration number", 0); 495 495 psMetadataAddStr(addnormalizedimfileArgs, PS_LIST_TAIL, "-class_id", 0, "define class ID (required)", NULL); 496 psMetadataAddS16(addnormalizedimfileArgs, PS_LIST_TAIL, "- code", 0, "set fault code", 0);496 psMetadataAddS16(addnormalizedimfileArgs, PS_LIST_TAIL, "-fault", 0, "set fault code", 0); 497 497 psMetadataAddStr(addnormalizedimfileArgs, PS_LIST_TAIL, "-uri", 0, "define URI", NULL); 498 498 psMetadataAddF64(addnormalizedimfileArgs, PS_LIST_TAIL, "-bg", 0, "define exposure background", NAN); … … 521 521 psMetadataAddS32(revertnormalizedimfileArgs, PS_LIST_TAIL, "-iteration", 0, "search by iteration number", 0); 522 522 psMetadataAddStr(revertnormalizedimfileArgs, PS_LIST_TAIL, "-class_id", 0, "search by class ID", NULL); 523 psMetadataAddS16(revertnormalizedimfileArgs, PS_LIST_TAIL, "- code", 0, "search by fault code", 0);523 psMetadataAddS16(revertnormalizedimfileArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 524 524 525 525 // -updatenormalizedimfile … … 555 555 psMetadataAddS64(addnormalizedexpArgs, PS_LIST_TAIL, "-det_id", 0, "define detrend ID (required)", 0); 556 556 psMetadataAddS32(addnormalizedexpArgs, PS_LIST_TAIL, "-iteration", 0, "define iteration number", 0); 557 psMetadataAddS16(addnormalizedexpArgs, PS_LIST_TAIL, "- code", 0, "set fault code", 0);557 psMetadataAddS16(addnormalizedexpArgs, PS_LIST_TAIL, "-fault", 0, "set fault code", 0); 558 558 psMetadataAddStr(addnormalizedexpArgs, PS_LIST_TAIL, "-recip", 0, "search for recipe", NULL); 559 559 psMetadataAddF64(addnormalizedexpArgs, PS_LIST_TAIL, "-bg", 0, "define exposure background", NAN); … … 580 580 psMetadataAddS64(revertnormalizedexpArgs, PS_LIST_TAIL, "-det_id", 0, "search by detrend ID (required)", 0); 581 581 psMetadataAddS32(revertnormalizedexpArgs, PS_LIST_TAIL, "-iteration", 0, "search by iteration number", 0); 582 psMetadataAddS16(revertnormalizedexpArgs, PS_LIST_TAIL, "- code", 0, "search by fault code", 0);582 psMetadataAddS16(revertnormalizedexpArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 583 583 584 584 // -updatenormalizedexp … … 616 616 psMetadataAddS64(addresidimfileArgs, PS_LIST_TAIL, "-exp_id", 0, "define detrend ID (required)", 0); 617 617 psMetadataAddStr(addresidimfileArgs, PS_LIST_TAIL, "-class_id", 0, "define class ID (required)", NULL); 618 psMetadataAddS16(addresidimfileArgs, PS_LIST_TAIL, "- code", 0, "set fault code", 0);618 psMetadataAddS16(addresidimfileArgs, PS_LIST_TAIL, "-fault", 0, "set fault code", 0); 619 619 psMetadataAddStr(addresidimfileArgs, PS_LIST_TAIL, "-uri", 0, "define resid file URI", NULL); 620 620 psMetadataAddStr(addresidimfileArgs, PS_LIST_TAIL, "-recip", 0, "define recipe", NULL); … … 658 658 psMetadataAddS64(revertresidimfileArgs, PS_LIST_TAIL, "-exp_id", 0, "search by detrend ID", 0); 659 659 psMetadataAddStr(revertresidimfileArgs, PS_LIST_TAIL, "-class_id", 0, "search for class ID", NULL); 660 psMetadataAddS16(revertresidimfileArgs, PS_LIST_TAIL, "- code", 0, "search by fault code", 0);660 psMetadataAddS16(revertresidimfileArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 661 661 662 662 // -updateresidimfile … … 696 696 psMetadataAddS32(addresidexpArgs, PS_LIST_TAIL, "-iteration", 0, "define iteration number", 0); 697 697 psMetadataAddS64(addresidexpArgs, PS_LIST_TAIL, "-exp_id", 0, "define detrend ID (required)", 0); 698 psMetadataAddS16(addresidexpArgs, PS_LIST_TAIL, "- code", 0, "set fault code", 0);698 psMetadataAddS16(addresidexpArgs, PS_LIST_TAIL, "-fault", 0, "set fault code", 0); 699 699 psMetadataAddStr(addresidexpArgs, PS_LIST_TAIL, "-recip", 0, "define recipe", NULL); 700 700 psMetadataAddF64(addresidexpArgs, PS_LIST_TAIL, "-bg", 0, "define exposure background", NAN); … … 734 734 psMetadataAddS32(revertresidexpArgs, PS_LIST_TAIL, "-iteration", 0, "search by iteration number", 0); 735 735 psMetadataAddS64(revertresidexpArgs, PS_LIST_TAIL, "-exp_id", 0, "search by detrend ID", 0); 736 psMetadataAddS16(revertresidexpArgs, PS_LIST_TAIL, "- code", 0, "search by fault code", 0);736 psMetadataAddS16(revertresidexpArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 737 737 738 738 // -updateresidexp … … 777 777 psMetadataAddF64(adddetrunsummaryArgs, PS_LIST_TAIL, "-bg_stdev", 0, "define exposure background stdev", NAN); 778 778 psMetadataAddF64(adddetrunsummaryArgs, PS_LIST_TAIL, "-bg_mean_stdev", 0, "define exposure background mean stdev", NAN); 779 psMetadataAddS16(adddetrunsummaryArgs, PS_LIST_TAIL, "- code", 0, "set fault code", 0);779 psMetadataAddS16(adddetrunsummaryArgs, PS_LIST_TAIL, "-fault", 0, "set fault code", 0); 780 780 psMetadataAddBool(adddetrunsummaryArgs, PS_LIST_TAIL, "-accept", 0, "declare that this detrun iteration is accepted as a master", false); 781 781 psMetadataAddBool(adddetrunsummaryArgs, PS_LIST_TAIL, "-again", 0, "start a new iteration of this detrend run", false); … … 794 794 psMetadataAddS64(revertdetrunsummaryArgs, PS_LIST_TAIL, "-det_id", 0, "search by detrend ID (required)", 0); 795 795 psMetadataAddS32(revertdetrunsummaryArgs, PS_LIST_TAIL, "-iteration", 0, "search by iteration number", 0); 796 psMetadataAddS16(revertdetrunsummaryArgs, PS_LIST_TAIL, "- code", 0, "search by fault code", 0);796 psMetadataAddS16(revertdetrunsummaryArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 797 797 798 798 // -updatedetrunsummary … … 886 886 PXOPT_ADD_MODE("-input", "", DETTOOL_MODE_INPUT, inputArgs); 887 887 888 PXOPT_ADD_MODE("-toprocessedimfile", "", DETTOOL_MODE_TOPROCESSEDIMFILE, toprocessedimfileArgs);889 PXOPT_ADD_MODE("-addprocessedimfile", "", DETTOOL_MODE_ADDPROCESSEDIMFILE, addprocessedimfileArgs);890 PXOPT_ADD_MODE("-processedimfile", "", DETTOOL_MODE_PROCESSEDIMFILE, processedimfileArgs);891 PXOPT_ADD_MODE("-revertprocessedimfile", "", DETTOOL_MODE_REVERTPROCESSEDIMFILE, revertprocessedimfileArgs);892 PXOPT_ADD_MODE("-updateprocessedimfile", "", DETTOOL_MODE_UPDATEPROCESSEDIMFILE, updateprocessedimfileArgs);888 PXOPT_ADD_MODE("-toprocessedimfile", "", DETTOOL_MODE_TOPROCESSEDIMFILE, toprocessedimfileArgs); 889 PXOPT_ADD_MODE("-addprocessedimfile", "", DETTOOL_MODE_ADDPROCESSEDIMFILE, addprocessedimfileArgs); 890 PXOPT_ADD_MODE("-processedimfile", "", DETTOOL_MODE_PROCESSEDIMFILE, processedimfileArgs); 891 PXOPT_ADD_MODE("-revertprocessedimfile", "", DETTOOL_MODE_REVERTPROCESSEDIMFILE, revertprocessedimfileArgs); 892 PXOPT_ADD_MODE("-updateprocessedimfile", "", DETTOOL_MODE_UPDATEPROCESSEDIMFILE, updateprocessedimfileArgs); 893 893 PXOPT_ADD_MODE("-pendingcleanup_processedimfile", "", DETTOOL_MODE_PENDINGCLEANUP_PROCESSEDIMFILE, pendingcleanup_processedimfileArgs); 894 894 PXOPT_ADD_MODE("-donecleanup_processedimfile", "", DETTOOL_MODE_DONECLEANUP_PROCESSEDIMFILE, donecleanup_processedimfileArgs); -
trunk/ippTools/src/dettool_detrunsummary.c
r21402 r23688 101 101 102 102 // default values 103 PXOPT_LOOKUP_S16( code, config->args, "-code", false, false);103 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 104 104 PXOPT_LOOKUP_BOOL(accept, config->args, "-accept", false); 105 105 … … 107 107 det_id, 108 108 iteration, 109 "full",109 "full", 110 110 bg, 111 111 bg_stdev, 112 112 bg_mean_stdev, 113 113 accept, 114 code114 fault 115 115 ); 116 116 } … … 120 120 { 121 121 PS_ASSERT_PTR_NON_NULL(config, false); 122 122 123 123 // build a query to search by det_id, iteration, exp_id 124 124 psMetadata *where = psMetadataAlloc(); … … 129 129 PXOPT_LOOKUP_BOOL(again, config->args, "-again", false); 130 130 131 // The values supplied as arguments on the command (eg, -bg) are parsed 132 // by mdToDetRunSummary below. 131 // The values supplied as arguments on the command (eg, -bg) are parsed 132 // by mdToDetRunSummary below. 133 133 // XXX why is there ever more than one? 134 134 … … 141 141 if (psListLength(where->list)) { 142 142 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 143 psStringAppend(&query, " WHERE %s", whereClause);144 psFree(whereClause);143 psStringAppend(&query, " WHERE %s", whereClause); 144 psFree(whereClause); 145 145 } 146 146 psFree(where); … … 199 199 psFree(output); 200 200 201 // XXX this logic does not deal with the case of - codebeing set202 // XXX it should be an error for -again and - codeto both be set201 // XXX this logic does not deal with the case of -fault being set 202 // XXX it should be an error for -again and -fault to both be set 203 203 if (again) { 204 204 if (!startNewIteration(config, det_id)) { … … 306 306 PXOPT_COPY_S64(config->args, where, "-det_id", "det_id", "=="); 307 307 PXOPT_COPY_S32(config->args, where, "-iteration", "iteration", "=="); 308 PXOPT_COPY_STR(config->args, where, "- code", "fault", "==");308 PXOPT_COPY_STR(config->args, where, "-fault", "fault", "=="); 309 309 310 310 psString query = pxDataGet("dettool_revertdetrunsummary.sql"); … … 340 340 { 341 341 PS_ASSERT_PTR_NON_NULL(config, false); 342 342 343 343 PXOPT_LOOKUP_S64(det_id, config->args, "-det_id", true, false); // required 344 344 PXOPT_LOOKUP_BOOL(accept, config->args, "-accept", false); … … 355 355 } 356 356 357 char *query = "UPDATE detRunSummary SET accept = %d WHERE det_id = %"PRId64; 357 char *query = "UPDATE detRunSummary SET accept = %d WHERE det_id = %"PRId64; 358 358 if (!p_psDBRunQueryF(config->dbh, query, accept, det_id)) { 359 359 psError(PS_ERR_UNKNOWN, false, "database error"); -
trunk/ippTools/src/dettool_normalizedexp.c
r19092 r23688 72 72 { 73 73 PS_ASSERT_PTR_NON_NULL(config, false); 74 74 75 75 PXOPT_LOOKUP_S64(det_id, config->args, "-det_id", true, false); // required 76 76 PXOPT_LOOKUP_S32(iteration, config->args, "-iteration", false, false); 77 PXOPT_LOOKUP_S16( code, config->args, "-code", false, false);78 PXOPT_LOOKUP_STR(recipe, config->args, "-recip", ( code == 0), false); // Required if code== 077 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 78 PXOPT_LOOKUP_STR(recipe, config->args, "-recip", (fault == 0), false); // Required if fault == 0 79 79 PXOPT_LOOKUP_F64(bg, config->args, "-bg", false, false); 80 80 PXOPT_LOOKUP_F64(bg_stdev, config->args, "-bg_stdev", false, false); … … 117 117 // insert the new row into the detProcessedImfile table 118 118 if (!detNormalizedExpInsert( 119 config->dbh,120 det_id,121 iteration,122 recipe,123 bg,124 bg_stdev,125 bg_mean_stdev,126 user_1,127 user_2,128 user_3,129 user_4,130 user_5,131 path_base,132 "full",133 code 134 )) {119 config->dbh, 120 det_id, 121 iteration, 122 recipe, 123 bg, 124 bg_stdev, 125 bg_mean_stdev, 126 user_1, 127 user_2, 128 user_3, 129 user_4, 130 user_5, 131 path_base, 132 "full", 133 fault 134 )) { 135 135 psError(PS_ERR_UNKNOWN, false, "database error"); 136 136 return false; … … 221 221 PXOPT_COPY_S64(config->args, where, "-det_id", "det_id", "=="); 222 222 PXOPT_COPY_S32(config->args, where, "-iteration", "iteration", "=="); 223 PXOPT_COPY_S16(config->args, where, "- code", "fault", "==");223 PXOPT_COPY_S16(config->args, where, "-fault", "fault", "=="); 224 224 225 225 psString query = pxDataGet("dettool_revertnormalizedexp.sql"); … … 260 260 261 261 if (!setNormExpDataState(config, det_id, iteration, data_state)) { 262 return false;262 return false; 263 263 } 264 264 return true; -
trunk/ippTools/src/dettool_normalizedimfile.c
r19092 r23688 80 80 PXOPT_LOOKUP_STR(class_id, config->args, "-class_id", true, false); 81 81 82 PXOPT_LOOKUP_S16( code, config->args, "-code", false, false);83 84 // Required if code== 085 PXOPT_LOOKUP_STR(uri, config->args, "-uri", ( code== 0), false);82 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 83 84 // Required if fault == 0 85 PXOPT_LOOKUP_STR(uri, config->args, "-uri", (fault == 0), false); 86 86 87 87 // optional … … 97 97 98 98 if (!detNormalizedImfileInsert( 99 config->dbh,100 det_id,101 iteration,102 class_id,103 uri,104 bg,105 bg_stdev,106 bg_mean_stdev,107 user_1,108 user_2,109 user_3,110 user_4,111 user_5,112 path_base,113 "full",114 code 115 )) {99 config->dbh, 100 det_id, 101 iteration, 102 class_id, 103 uri, 104 bg, 105 bg_stdev, 106 bg_mean_stdev, 107 user_1, 108 user_2, 109 user_3, 110 user_4, 111 user_5, 112 path_base, 113 "full", 114 fault 115 )) { 116 116 psError(PS_ERR_UNKNOWN, false, "database error"); 117 117 return false; … … 201 201 PXOPT_COPY_S32(config->args, where, "-iteration", "iteration", "=="); 202 202 PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "=="); 203 PXOPT_COPY_S16(config->args, where, "- code", "fault", "==");203 PXOPT_COPY_S16(config->args, where, "-fault", "fault", "=="); 204 204 205 205 psString query = pxDataGet("dettool_revertnormalizedimfile.sql"); … … 241 241 242 242 if (!setNormImfileDataState(config, det_id, iteration, class_id, data_state)) { 243 return false;243 return false; 244 244 } 245 245 return true; -
trunk/ippTools/src/dettool_normalizedstat.c
r19092 r23688 83 83 // default 84 84 PXOPT_LOOKUP_S32(iteration, config->args, "-iteration", false, false); 85 PXOPT_LOOKUP_S16(code, config->args, "- code", false, false);85 PXOPT_LOOKUP_S16(code, config->args, "-fault", false, false); 86 86 87 87 detNormalizedStatImfileRow *row = detNormalizedStatImfileRowAlloc 88 (det_id,89 iteration,90 class_id,91 norm,92 "full",93 code);94 88 (det_id, 89 iteration, 90 class_id, 91 norm, 92 "full", 93 code); 94 95 95 if (!detNormalizedStatImfileInsertObject(config->dbh, row)) { 96 psError(PS_ERR_UNKNOWN, false, "database error");97 return false;96 psError(PS_ERR_UNKNOWN, false, "database error"); 97 return false; 98 98 } 99 99 … … 181 181 PXOPT_COPY_S32(config->args, where, "-iteration", "iteration", "=="); 182 182 PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "=="); 183 PXOPT_COPY_S16(config->args, where, "- code", "fault", "==");183 PXOPT_COPY_S16(config->args, where, "-fault", "fault", "=="); 184 184 185 185 psString query = pxDataGet("dettool_revertnormalizedstat.sql"); … … 221 221 222 222 if (!setNormStatImfileDataState(config, det_id, iteration, class_id, data_state)) { 223 return false;223 return false; 224 224 } 225 225 return true; -
trunk/ippTools/src/dettool_processedexp.c
r21402 r23688 80 80 81 81 // default values 82 PXOPT_LOOKUP_S16( code, config->args, "-code", false, false);83 84 // Required if code== 085 PXOPT_LOOKUP_STR(recipe, config->args, "-recip", ( code== 0), false);82 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 83 84 // Required if fault == 0 85 PXOPT_LOOKUP_STR(recipe, config->args, "-recip", (fault == 0), false); 86 86 87 87 // optional … … 141 141 user_5, 142 142 path_base, 143 "full",144 code143 "full", 144 fault 145 145 ); 146 146 … … 231 231 PXOPT_COPY_S64(config->args, where, "-det_id", "det_id", "=="); 232 232 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 233 PXOPT_COPY_S16(config->args, where, "- code", "fault", "==");233 PXOPT_COPY_S16(config->args, where, "-fault", "fault", "=="); 234 234 235 235 psString query = pxDataGet("dettool_revertprocessedexp.sql"); … … 269 269 PXOPT_LOOKUP_STR(data_state, config->args, "-data_state", true, false); 270 270 if (!setProcessedExpDataState(config, det_id, exp_id, data_state)) { 271 return false;271 return false; 272 272 } 273 273 return true; -
trunk/ippTools/src/dettool_processedimfile.c
r23229 r23688 92 92 93 93 // default values 94 PXOPT_LOOKUP_S16( code, config->args, "-code", false, false);95 96 // Required if code== 097 PXOPT_LOOKUP_STR(uri, config->args, "-uri", ( code== 0), false);98 PXOPT_LOOKUP_STR(recipe, config->args, "-recip", ( code== 0), false);94 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 95 96 // Required if fault == 0 97 PXOPT_LOOKUP_STR(uri, config->args, "-uri", (fault == 0), false); 98 PXOPT_LOOKUP_STR(recipe, config->args, "-recip", (fault == 0), false); 99 99 100 100 // optional … … 144 144 user_5, 145 145 path_base, 146 "full",147 code146 "full", 147 fault 148 148 ); 149 149 psFree(rawImfiles); … … 190 190 psStringAppend(&query, " %s", whereClause); 191 191 psFree(whereClause); 192 hasWhere = true;192 hasWhere = true; 193 193 } 194 194 psFree (where); … … 196 196 // restrict search to included imfiles 197 197 if (included) { 198 if (hasWhere) {199 psStringAppend(&query, " AND detInputExp.include = 1");200 } else {201 psStringAppend(&query, " WHERE detInputExp.include = 1");202 }203 hasWhere = true;198 if (hasWhere) { 199 psStringAppend(&query, " AND detInputExp.include = 1"); 200 } else { 201 psStringAppend(&query, " WHERE detInputExp.include = 1"); 202 } 203 hasWhere = true; 204 204 } 205 205 206 206 if (hasWhere) { 207 psStringAppend(&query, " AND");207 psStringAppend(&query, " AND"); 208 208 } else { 209 psStringAppend(&query, " WHERE");209 psStringAppend(&query, " WHERE"); 210 210 } 211 211 212 212 if (faulted) { 213 213 // list only faulted rows 214 psStringAppend(&query, " %s", " detProcessedImfile.fault != 0");214 psStringAppend(&query, " %s", " detProcessedImfile.fault != 0"); 215 215 } else { 216 216 // don't list faulted rows … … 263 263 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 264 264 PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "=="); 265 PXOPT_COPY_S16(config->args, where, "- code", "fault", "==");265 PXOPT_COPY_S16(config->args, where, "-fault", "fault", "=="); 266 266 267 267 psString query = pxDataGet("dettool_revertprocessedimfile.sql"); … … 303 303 304 304 if (!setProcessedImfileDataState(config, det_id, exp_id, class_id, data_state)) { 305 return false;305 return false; 306 306 } 307 307 return true; -
trunk/ippTools/src/dettool_residexp.c
r19092 r23688 95 95 PXOPT_LOOKUP_S32(iteration, config->args, "-iteration", false, false); 96 96 PXOPT_LOOKUP_S64(exp_id, config->args, "-exp_id", true, false); // required 97 PXOPT_LOOKUP_S16( code, config->args, "-code", false, false);98 PXOPT_LOOKUP_STR(recipe, config->args, "-recip", ( code == 0), false); // Required if code== 097 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 98 PXOPT_LOOKUP_STR(recipe, config->args, "-recip", (fault == 0), false); // Required if fault == 0 99 99 PXOPT_LOOKUP_F64(bg, config->args, "-bg", false, false); 100 100 PXOPT_LOOKUP_F64(bg_stdev, config->args, "-bg_stdev", false, false); … … 124 124 125 125 if (psListLength(where->list)) { 126 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);127 psStringAppend(&query, " WHERE %s", whereClause);128 psFree(whereClause);126 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 127 psStringAppend(&query, " WHERE %s", whereClause); 128 psFree(whereClause); 129 129 } 130 130 psFree(where); … … 151 151 152 152 if (!detResidExpInsert( 153 config->dbh,153 config->dbh, 154 154 det_id, 155 155 iteration, … … 174 174 user_5, 175 175 path_base, 176 "full",176 "full", 177 177 !reject, 178 code178 fault 179 179 )) { 180 180 psError(PS_ERR_UNKNOWN, false, "database error"); … … 225 225 if (reject) { 226 226 psStringAppend(&query, " %s", "AND detResidExp.accept != 0"); 227 } 227 } 228 228 229 229 // treat limit == 0 as "no limit" … … 273 273 PXOPT_COPY_S32(config->args, where, "-iteration", "iteration", "=="); 274 274 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 275 PXOPT_COPY_S16(config->args, where, "- code", "fault", "==");275 PXOPT_COPY_S16(config->args, where, "-fault", "fault", "=="); 276 276 277 277 psString query = pxDataGet("dettool_revertresidexp.sql"); … … 330 330 PXOPT_LOOKUP_STR(data_state, config->args, "-data_state", false, false); 331 331 if (data_state) { 332 if (!isValidDataState (data_state)) return false;332 if (!isValidDataState (data_state)) return false; 333 333 } 334 334 -
trunk/ippTools/src/dettool_residimfile.c
r23229 r23688 75 75 PS_ASSERT_PTR_NON_NULL(config, false); 76 76 77 77 78 78 PXOPT_LOOKUP_S64(det_id, config->args, "-det_id", true, false); // required 79 79 PXOPT_LOOKUP_S32(iteration, config->args, "-iteration", false, false); … … 84 84 PXOPT_LOOKUP_S64(exp_id, config->args, "-exp_id", true, false); // required 85 85 PXOPT_LOOKUP_STR(class_id, config->args, "-class_id", true, false); // required 86 PXOPT_LOOKUP_S16( code, config->args, "-code", false, false);87 PXOPT_LOOKUP_STR(uri, config->args, "-uri", ( code == 0), false); // Required if code== 088 PXOPT_LOOKUP_STR(recipe, config->args, "-recip", ( code == 0), false); // Required if code== 086 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 87 PXOPT_LOOKUP_STR(uri, config->args, "-uri", (fault == 0), false); // Required if fault == 0 88 PXOPT_LOOKUP_STR(recipe, config->args, "-recip", (fault == 0), false); // Required if fault == 0 89 89 PXOPT_LOOKUP_F64(bg, config->args, "-bg", false, false); 90 90 PXOPT_LOOKUP_F64(bg_stdev, config->args, "-bg_stdev", false, false); … … 107 107 108 108 if (!detResidImfileInsert( 109 config->dbh,109 config->dbh, 110 110 det_id, 111 111 iteration, … … 134 134 user_5, 135 135 path_base, 136 "full",137 code136 "full", 137 fault 138 138 )) { 139 139 psError(PS_ERR_UNKNOWN, false, "database error"); … … 174 174 psStringAppend(&query, " %s", whereClause); 175 175 psFree(whereClause); 176 hasWhere = true;176 hasWhere = true; 177 177 } 178 178 psFree(where); … … 180 180 // restrict search to included imfiles 181 181 if (included) { 182 if (hasWhere) {183 psStringAppend(&query, " AND detInputExp.include = 1");184 } else {185 psStringAppend(&query, " WHERE detInputExp.include = 1");186 }187 hasWhere = true;182 if (hasWhere) { 183 psStringAppend(&query, " AND detInputExp.include = 1"); 184 } else { 185 psStringAppend(&query, " WHERE detInputExp.include = 1"); 186 } 187 hasWhere = true; 188 188 } 189 189 190 190 if (hasWhere) { 191 psStringAppend(&query, " AND");191 psStringAppend(&query, " AND"); 192 192 } else { 193 psStringAppend(&query, " WHERE");193 psStringAppend(&query, " WHERE"); 194 194 } 195 195 … … 249 249 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 250 250 PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "=="); 251 PXOPT_COPY_S16(config->args, where, "- code", "fault", "==");251 PXOPT_COPY_S16(config->args, where, "-fault", "fault", "=="); 252 252 253 253 psString query = pxDataGet("dettool_revertresidimfile.sql"); … … 289 289 PXOPT_LOOKUP_STR(data_state, config->args, "-data_state", true, false); 290 290 if (!setResidImfileDataState(config, det_id, iteration, exp_id, class_id, data_state)) { 291 return false;291 return false; 292 292 } 293 293 return true; -
trunk/ippTools/src/dettool_stack.c
r19092 r23688 127 127 PXOPT_LOOKUP_STR(class_id, config->args, "-class_id", true, false); 128 128 129 PXOPT_LOOKUP_S16( code, config->args, "-code", false, false);130 131 // Required if code== 0132 PXOPT_LOOKUP_STR(uri, config->args, "-uri", ( code== 0), false);133 PXOPT_LOOKUP_STR(recipe, config->args, "-recip", ( code== 0), false);129 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 130 131 // Required if fault == 0 132 PXOPT_LOOKUP_STR(uri, config->args, "-uri", (fault == 0), false); 133 PXOPT_LOOKUP_STR(recipe, config->args, "-recip", (fault == 0), false); 134 134 135 135 // optional … … 188 188 user_4, 189 189 user_5, 190 "full",191 code190 "full", 191 fault 192 192 ); 193 193 … … 286 286 PXOPT_COPY_S32(config->args, where, "-iteration", "iteration", "=="); 287 287 PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "=="); 288 PXOPT_COPY_S16(config->args, where, "- code", "fault", "==");288 PXOPT_COPY_S16(config->args, where, "-fault", "fault", "=="); 289 289 290 290 psString query = pxDataGet("dettool_revertstacked.sql"); … … 326 326 327 327 if (!setStackedImfileDataState(config, det_id, iteration, class_id, data_state)) { 328 return false;328 return false; 329 329 } 330 330 return true; -
trunk/ippTools/src/difftool.c
r23634 r23688 485 485 PXOPT_LOOKUP_S64(diff_id, config->args, "-diff_id", true, false); // required 486 486 PXOPT_LOOKUP_STR(skycell_id, config->args, "-skycell_id", true, false); 487 PXOPT_LOOKUP_S16(code, config->args, "-code", false, false); 488 PXOPT_LOOKUP_STR(uri, config->args, "-uri", (code == 0), false); 489 PXOPT_LOOKUP_STR(path_base, config->args, "-path_base", (code == 0), false); 487 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 488 PXOPT_LOOKUP_S16(quality, config->args, "-quality", false, false); 489 PXOPT_LOOKUP_STR(uri, config->args, "-uri", (fault == 0), false); 490 PXOPT_LOOKUP_STR(path_base, config->args, "-path_base", (fault == 0), false); 490 491 491 492 // optional … … 540 541 hostname, 541 542 good_frac, 542 code, 543 fault, 544 quality, 543 545 magicked 544 546 )) { … … 578 580 PXOPT_COPY_S64(config->args, where, "-diff_skyfile_id", "diffInputSkyfile.diff_skyfile_id", "=="); 579 581 PXOPT_COPY_STR(config->args, where, "-tess_id", "diffSkyfile.tess_id", "=="); 580 PXOPT_COPY_S16(config->args, where, "- code", "diffSkyfile.fault", "==");582 PXOPT_COPY_S16(config->args, where, "-fault", "diffSkyfile.fault", "=="); 581 583 PXOPT_COPY_S64(config->args, where, "-exp_id", "rawExp.exp_id", "=="); 582 584 PXOPT_COPY_STR(config->args, where, "-exp_name", "rawExp.exp_name", "=="); … … 655 657 PXOPT_COPY_S64(config->args, where, "-diff_id", "diffSkyfile.diff_id", "=="); 656 658 PXOPT_COPY_STR(config->args, where, "-label", "diffRun.label", "=="); 657 PXOPT_COPY_S16(config->args, where, "- code", "fault", "==");659 PXOPT_COPY_S16(config->args, where, "-fault", "fault", "=="); 658 660 659 661 if (!psDBTransaction(config->dbh)) { … … 1269 1271 PXOPT_COPY_S64(config->args, selectWhere, "-exp_id", "inputRawExp.exp_id", "=="); 1270 1272 PXOPT_COPY_STR(config->args, selectWhere, "-filter", "inputRawExp.filter", "=="); 1273 PXOPT_COPY_STR(config->args, selectWhere, "-obs_mode", "inputRawExp.obs_mode", "=="); 1274 PXOPT_COPY_STR(config->args, selectWhere, "-obs_mode", "templateRawExp.obs_mode", "=="); 1271 1275 PXOPT_COPY_STR(config->args, selectWhere, "-input_label", "inputWarpRun.label", "=="); 1272 1276 PXOPT_COPY_STR(config->args, selectWhere, "-template_label", "templateWarpRun.label", "=="); … … 1662 1666 PS_ASSERT_PTR_NON_NULL(config, false); 1663 1667 1664 PXOPT_LOOKUP_S16( code, config->args, "-code", true, false);1668 PXOPT_LOOKUP_S16(fault, config->args, "-fault", true, false); 1665 1669 1666 1670 psMetadata *where = psMetadataAlloc(); 1667 1671 PXOPT_COPY_S64(config->args, where, "-diff_id", "diff_id", "=="); 1668 1672 1669 if (!pxSetFaultCode(config->dbh, "diffSkyfile", where, code)) {1673 if (!pxSetFaultCode(config->dbh, "diffSkyfile", where, fault)) { 1670 1674 psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag"); 1671 1675 psFree (where); -
trunk/ippTools/src/difftoolConfig.c
r23634 r23688 88 88 psMetadataAddS64(adddiffskyfileArgs, PS_LIST_TAIL, "-diff_id", 0, "define warp ID (required)", 0); 89 89 psMetadataAddStr(adddiffskyfileArgs, PS_LIST_TAIL, "-skycell_id", 0, "define skycell of file (required)", 0); 90 psMetadataAddS16(adddiffskyfileArgs, PS_LIST_TAIL, "-code", 0, "set fault code", 0); 90 psMetadataAddS16(adddiffskyfileArgs, PS_LIST_TAIL, "-fault", 0, "set fault code", 0); 91 psMetadataAddS16(adddiffskyfileArgs, PS_LIST_TAIL, "-quality", 0, "set quality", 0); 91 92 psMetadataAddStr(adddiffskyfileArgs, PS_LIST_TAIL, "-uri", 0, "define URI of file", 0); 92 93 psMetadataAddStr(adddiffskyfileArgs, PS_LIST_TAIL, "-path_base", 0, "define base output location", 0); … … 123 124 psMetadataAddU64(diffskyfileArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0); 124 125 psMetadataAddBool(diffskyfileArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); 125 psMetadataAddS16(diffskyfileArgs, PS_LIST_TAIL, "- code", 0, "deifine fault code", 0);126 psMetadataAddS16(diffskyfileArgs, PS_LIST_TAIL, "-fault", 0, "define fault code", 0); 126 127 127 128 // -revertdiffskyfile … … 129 130 psMetadataAddS64(revertdiffskyfileArgs, PS_LIST_TAIL, "-diff_id", 0, "search by diff ID", 0); 130 131 psMetadataAddStr(revertdiffskyfileArgs, PS_LIST_TAIL, "-label", 0, "search by label", NULL); 131 psMetadataAddS16(revertdiffskyfileArgs, PS_LIST_TAIL, "- code", 0, "search by fault code", 0);132 psMetadataAddS16(revertdiffskyfileArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 132 133 133 134 // -definepoprun … … 171 172 psMetadataAddStr(definewarpwarpArgs, PS_LIST_TAIL, "-filter", 0, "search by filter", NULL); 172 173 psMetadataAddF32(definewarpwarpArgs, PS_LIST_TAIL, "-distance", 0, "limit distance between input and template (deg)", NAN); 174 psMetadataAddStr(definewarpwarpArgs, PS_LIST_TAIL, "-obs_mode", 0, "search by observation mode", NULL); 173 175 psMetadataAddF32(definewarpwarpArgs, PS_LIST_TAIL, "-timediff", 0, "limit time difference between input and template", NAN); 174 176 psMetadataAddF32(definewarpwarpArgs, PS_LIST_TAIL, "-rotdiff", 0, "limit rotator difference between input and template", NAN); … … 205 207 psMetadata *updatediffskyfileArgs = psMetadataAlloc(); 206 208 psMetadataAddS64(updatediffskyfileArgs, PS_LIST_TAIL, "-diff_id", 0, "define diff ID (required)", 0); 207 psMetadataAddS16(updatediffskyfileArgs, PS_LIST_TAIL, "- code", 0, "set fault code (required)", 0);209 psMetadataAddS16(updatediffskyfileArgs, PS_LIST_TAIL, "-fault", 0, "set fault code (required)", 0); 208 210 209 211 // -exportrun -
trunk/ippTools/src/disttool.c
r23661 r23688 106 106 107 107 // TODO: should we check that stage_id actually exists for stage 108 // in magicdstool we queue off of a magic_id so the stage_id, exp_id, and cam_id get looked up 108 // in magicdstool we queue off of a magic_id so the stage_id, exp_id, and cam_id get looked up 109 109 // when the run is queued 110 110 … … 151 151 PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false); 152 152 PXOPT_LOOKUP_STR(label, config->args, "-set_label", false, false); 153 PXOPT_LOOKUP_S16( code, config->args, "-code", false, false);154 155 if ((!state) && (!label) && (! code)) {156 psError(PXTOOLS_ERR_DATA, false, "parameters (- codeor -set_state or -set_label) are required");153 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 154 155 if ((!state) && (!label) && (!fault)) { 156 psError(PXTOOLS_ERR_DATA, false, "parameters (-fault or -set_state or -set_label) are required"); 157 157 psFree(where); 158 158 return false; … … 169 169 } 170 170 171 if ( code) {172 psStringAppend(&query, " , fault = %d", code);171 if (fault) { 172 psStringAppend(&query, " , fault = %d", fault); 173 173 } 174 174 … … 195 195 PXOPT_COPY_STR(config->args, where, "-state", "state", "=="); 196 196 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 197 PXOPT_COPY_S16(config->args, where, "- code", "distComponent.fault", "==");197 PXOPT_COPY_S16(config->args, where, "-fault", "distComponent.fault", "=="); 198 198 199 199 // It might be useful to be able to query by the parameters of the underlying runs … … 402 402 // unless fault code is set require filename, bytes, and md5sum 403 403 bool require_fileinfo = false; 404 PXOPT_LOOKUP_S16( code, config->args, "-code", false, false);405 if (! code) {404 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 405 if (!fault) { 406 406 require_fileinfo = true; 407 407 } … … 410 410 PXOPT_LOOKUP_STR(name, config->args, "-name", require_fileinfo, false); 411 411 412 if (!distComponentInsert(config->dbh, dist_id, component, bytes, md5sum, "full", name, code)) {412 if (!distComponentInsert(config->dbh, dist_id, component, bytes, md5sum, "full", name, fault)) { 413 413 psError(PS_ERR_UNKNOWN, false, "database error"); 414 414 return false; -
trunk/ippTools/src/disttoolConfig.c
r23661 r23688 46 46 psMetadata *definerunArgs = psMetadataAlloc(); 47 47 psMetadataAddStr(definerunArgs, PS_LIST_TAIL, "-stage", 0, "define stage for bundle (required)", NULL); 48 psMetadataAddS64(definerunArgs, PS_LIST_TAIL, "-stage_id", 0, "define stage_id (required)", 0); 48 psMetadataAddS64(definerunArgs, PS_LIST_TAIL, "-stage_id", 0, "define stage_id (required)", 0); 49 49 psMetadataAddStr(definerunArgs, PS_LIST_TAIL, "-outroot", 0, "define output destination (required)", NULL); 50 50 psMetadataAddS64(definerunArgs, PS_LIST_TAIL, "-target_id", 0, "define stage_id", 0); … … 52 52 psMetadataAddBool(definerunArgs, PS_LIST_TAIL, "-no_magic", 0, "magic is not needed", false); 53 53 psMetadataAddStr(definerunArgs, PS_LIST_TAIL, "-set_label", 0, "define label for run", NULL); 54 54 55 55 // -updaterun 56 56 psMetadata *updaterunArgs = psMetadataAlloc(); 57 psMetadataAddS64(updaterunArgs, PS_LIST_TAIL, "-dist_id", 0, "define dist_id", 0); 57 psMetadataAddS64(updaterunArgs, PS_LIST_TAIL, "-dist_id", 0, "define dist_id", 0); 58 58 psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-set_state", 0, "new value for state", NULL); 59 59 psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-set_label", 0, "new value for label", NULL); … … 61 61 psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-state", 0, "value for state", NULL); 62 62 psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-label", 0, "limit updates to label", NULL); 63 psMetadataAddS16(updaterunArgs, PS_LIST_TAIL, "- code", 0, "define fault code", 0);64 63 psMetadataAddS16(updaterunArgs, PS_LIST_TAIL, "-fault", 0, "define fault code", 0); 64 65 65 // -revertrun 66 66 psMetadata *revertrunArgs = psMetadataAlloc(); 67 psMetadataAddS64(revertrunArgs, PS_LIST_TAIL, "-dist_id", 0, "define dist_id", 0); 67 psMetadataAddS64(revertrunArgs, PS_LIST_TAIL, "-dist_id", 0, "define dist_id", 0); 68 68 psMetadataAddStr(revertrunArgs, PS_LIST_TAIL, "-stage", 0, "define stage", NULL); 69 psMetadataAddS64(revertrunArgs, PS_LIST_TAIL, "-stage_id", 0, "define stage_id", 0); 69 psMetadataAddS64(revertrunArgs, PS_LIST_TAIL, "-stage_id", 0, "define stage_id", 0); 70 70 psMetadataAddStr(revertrunArgs, PS_LIST_TAIL, "-state", 0, "define state", NULL); 71 71 psMetadataAddStr(revertrunArgs, PS_LIST_TAIL, "-label", 0, "define label", NULL); 72 psMetadataAddS16(revertrunArgs, PS_LIST_TAIL, "- code", 0, "define fault code", 0);72 psMetadataAddS16(revertrunArgs, PS_LIST_TAIL, "-fault", 0, "define fault code", 0); 73 73 psMetadataAddBool(revertrunArgs, PS_LIST_TAIL, "-all", 0, "revert all faulted runs", NULL); 74 74 75 75 // -pendingcomponent 76 76 psMetadata *pendingcomponentArgs = psMetadataAlloc(); 77 psMetadataAddS64(pendingcomponentArgs, PS_LIST_TAIL, "-dist_id", 0, "define dist_id", 0); 77 psMetadataAddS64(pendingcomponentArgs, PS_LIST_TAIL, "-dist_id", 0, "define dist_id", 0); 78 78 psMetadataAddStr(pendingcomponentArgs, PS_LIST_TAIL, "-stage", 0, "limit results to runs for stage", NULL); 79 79 psMetadataAddStr(pendingcomponentArgs, PS_LIST_TAIL, "-label", 0, "limit results to label", NULL); … … 84 84 // -addprocessedcomponent 85 85 psMetadata *addprocessedcomponentArgs = psMetadataAlloc(); 86 psMetadataAddS64(addprocessedcomponentArgs, PS_LIST_TAIL, "-dist_id", 0, "define dist_id", 0); 86 psMetadataAddS64(addprocessedcomponentArgs, PS_LIST_TAIL, "-dist_id", 0, "define dist_id", 0); 87 87 psMetadataAddStr(addprocessedcomponentArgs, PS_LIST_TAIL, "-component", 0, "define component (required)", NULL); 88 88 psMetadataAddStr(addprocessedcomponentArgs, PS_LIST_TAIL, "-name", 0, "define file name", NULL); 89 psMetadataAddS32(addprocessedcomponentArgs, PS_LIST_TAIL, "-bytes", 0, "define file size", 0); 89 psMetadataAddS32(addprocessedcomponentArgs, PS_LIST_TAIL, "-bytes", 0, "define file size", 0); 90 90 psMetadataAddStr(addprocessedcomponentArgs, PS_LIST_TAIL, "-md5sum", 0, "define stage for bundle", NULL); 91 psMetadataAddS32(addprocessedcomponentArgs, PS_LIST_TAIL, "- code", 0, "define fault code", 0);91 psMetadataAddS32(addprocessedcomponentArgs, PS_LIST_TAIL, "-fault", 0, "define fault code", 0); 92 92 93 93 // -processedcomponent 94 94 psMetadata *processedcomponentArgs = psMetadataAlloc(); 95 psMetadataAddS64(processedcomponentArgs, PS_LIST_TAIL, "-dist_id", 0, "define dist_id", 0); 95 psMetadataAddS64(processedcomponentArgs, PS_LIST_TAIL, "-dist_id", 0, "define dist_id", 0); 96 96 psMetadataAddU64(processedcomponentArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0); 97 97 psMetadataAddBool(processedcomponentArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); … … 99 99 // -toadvance 100 100 psMetadata *toadvanceArgs = psMetadataAlloc(); 101 psMetadataAddS64(toadvanceArgs, PS_LIST_TAIL, "-dist_id", 0, "define dist_id", 0); 101 psMetadataAddS64(toadvanceArgs, PS_LIST_TAIL, "-dist_id", 0, "define dist_id", 0); 102 102 psMetadataAddU64(toadvanceArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0); 103 103 psMetadataAddBool(toadvanceArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); -
trunk/ippTools/src/faketool.c
r23339 r23688 496 496 497 497 // default values 498 PXOPT_LOOKUP_S16( code, config->args, "-code", false, false);498 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 499 499 500 500 if (!psDBTransaction(config->dbh)) { … … 513 513 path_base, 514 514 "full", 515 code,515 fault, 516 516 NULL // epoch 517 517 )) { … … 687 687 PS_ASSERT_PTR_NON_NULL(config, false); 688 688 689 PXOPT_LOOKUP_S16( code, config->args, "-code", true, false);689 PXOPT_LOOKUP_S16(fault, config->args, "-fault", true, false); 690 690 691 691 psMetadata *where = psMetadataAlloc(); … … 693 693 PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "=="); 694 694 695 if (!pxSetFaultCode(config->dbh, "fakeProcessedImfile", where, code)) {695 if (!pxSetFaultCode(config->dbh, "fakeProcessedImfile", where, fault)) { 696 696 psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag"); 697 697 psFree(where); … … 1238 1238 1239 1239 int numExportTables = 2; 1240 1240 1241 1241 PS_ASSERT_PTR_NON_NULL(config, NULL); 1242 1242 … … 1316 1316 1317 1317 PS_ASSERT_PTR_NON_NULL(config, NULL); 1318 1318 1319 1319 PXOPT_LOOKUP_STR(infile, config->args, "-infile", true, false); 1320 1320 -
trunk/ippTools/src/faketoolConfig.c
r23339 r23688 175 175 psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-hostname", 0, "define hostname", NULL); 176 176 psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-path_base", 0, "define base output location", NULL); 177 psMetadataAddS16(addprocessedimfileArgs, PS_LIST_TAIL, "- code", 0, "set fault code", 0);177 psMetadataAddS16(addprocessedimfileArgs, PS_LIST_TAIL, "-fault", 0, "set fault code", 0); 178 178 179 179 // -processedimfile … … 193 193 psMetadataAddS64(updateprocessedimfileArgs, PS_LIST_TAIL, "-exp_id", 0, "search by exposure ID", 0); 194 194 psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-class_id", 0, "search by class ID", NULL); 195 psMetadataAddS16(updateprocessedimfileArgs, PS_LIST_TAIL, "- code", 0, "set fault code (required)", 0);195 psMetadataAddS16(updateprocessedimfileArgs, PS_LIST_TAIL, "-fault", 0, "set fault code (required)", 0); 196 196 197 197 // -revertprocessedimfile … … 239 239 240 240 psMetadataAddBool(revertprocessedimfileArgs, PS_LIST_TAIL, "-all", 0, "allow everything to be queued without search terms", false); 241 psMetadataAddS16(revertprocessedimfileArgs, PS_LIST_TAIL, "- code", 0, "search by fault code", 0);241 psMetadataAddS16(revertprocessedimfileArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 242 242 243 243 -
trunk/ippTools/src/flatcorr.c
r23310 r23688 117 117 } 118 118 119 // require the camera to be defined: this analysis does not make sense 119 // require the camera to be defined: this analysis does not make sense 120 120 // across multiple cameras 121 121 PXOPT_LOOKUP_STR(camera, config->args, "-inst", true, false); … … 169 169 170 170 if (pretend) { 171 for (long i = 0; i < psArrayLength(output); i++) {172 // negative simple so the default is true173 if (!ippdbPrintMetadataRaw(stdout, output->data[i], !simple)) {174 psError(PS_ERR_UNKNOWN, false, "failed to print array");175 psFree(output);176 return false;177 }178 }171 for (long i = 0; i < psArrayLength(output); i++) { 172 // negative simple so the default is true 173 if (!ippdbPrintMetadataRaw(stdout, output->data[i], !simple)) { 174 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 175 psFree(output); 176 return false; 177 } 178 } 179 179 psFree(output); 180 180 return true; … … 191 191 // create a new flatcorrRun 192 192 if (!flatcorrRunInsert( 193 config->dbh,193 config->dbh, 194 194 0, // corr_id 195 det_type,195 det_type, 196 196 dvodb, 197 camera,198 telescope,199 NULL,197 camera, 198 telescope, 199 NULL, 200 200 filter, 201 201 "reg", // state … … 203 203 label, 204 204 reduction, 205 region,206 NULL,207 0205 region, 206 NULL, 207 0 208 208 )) { 209 209 if (!psDBRollback(config->dbh)) { … … 304 304 // create a new flatcorrRun 305 305 flatcorrRunRow *row = flatcorrRunRowAlloc( 306 0, // corr_id307 det_type,308 dvodb,309 camera,310 telescope,311 NULL,312 filter,313 "reg", // state314 workdir,315 label,316 reduction,317 region,318 NULL, // hostname319 0 // fault306 0, // corr_id 307 det_type, 308 dvodb, 309 camera, 310 telescope, 311 NULL, 312 filter, 313 "reg", // state 314 workdir, 315 label, 316 reduction, 317 region, 318 NULL, // hostname 319 0 // fault 320 320 ); 321 321 … … 328 328 return false; 329 329 } 330 330 331 331 // figure out the ID of the flatcorrRun we just created 332 332 psS64 corr_id = psDBLastInsertID(config->dbh); … … 365 365 psString query = pxDataGet("flatcorr_dropchip.sql"); 366 366 if (!query) { 367 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");368 return false;367 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 368 return false; 369 369 } 370 370 … … 390 390 psString query = pxDataGet("flatcorr_chiprundone.sql"); 391 391 if (!query) { 392 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");393 return false;392 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 393 return false; 394 394 } 395 395 396 396 // treat limit == 0 as "no limit" 397 397 if (limit) { 398 psString limitString = psDBGenerateLimitSQL(limit);399 psStringAppend(&query, " %s", limitString);400 psFree(limitString);398 psString limitString = psDBGenerateLimitSQL(limit); 399 psStringAppend(&query, " %s", limitString); 400 psFree(limitString); 401 401 } 402 402 … … 459 459 // queue the exp 460 460 if (!pxcamQueueByChipID( 461 config,462 row->chip_id,463 row->workdir,464 row->label,465 row->reduction,466 row->expgroup,467 row->dvodb,468 row->tess_id,469 "camera")) {461 config, 462 row->chip_id, 463 row->workdir, 464 row->label, 465 row->reduction, 466 row->expgroup, 467 row->dvodb, 468 row->tess_id, 469 "camera")) { 470 470 if (!psDBRollback(config->dbh)) { 471 471 psError(PS_ERR_UNKNOWN, false, "database error"); … … 478 478 } 479 479 480 // figure out the ID of the flatcorrRun we just created481 psS64 cam_id = psDBLastInsertID(config->dbh);482 483 // add the camRun entry to the flatcorrCamLink table (include is TRUE)480 // figure out the ID of the flatcorrRun we just created 481 psS64 cam_id = psDBLastInsertID(config->dbh); 482 483 // add the camRun entry to the flatcorrCamLink table (include is TRUE) 484 484 if (!flatcorrCamLinkInsert(config->dbh, corr_id, row->chip_id, cam_id, 1)) { 485 485 if (!psDBRollback(config->dbh)) { … … 489 489 return false; 490 490 } 491 491 492 492 psFree(row); 493 493 } … … 513 513 psString query = pxDataGet("flatcorr_dropcamera.sql"); 514 514 if (!query) { 515 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");516 return false;515 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 516 return false; 517 517 } 518 518 … … 537 537 psString query = pxDataGet("flatcorr_pendingprocess.sql"); 538 538 if (!query) { 539 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");540 return false;539 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 540 return false; 541 541 } 542 542 543 543 // treat limit == 0 as "no limit" 544 544 if (limit) { 545 psString limitString = psDBGenerateLimitSQL(limit);546 psStringAppend(&query, " %s", limitString);547 psFree(limitString);545 psString limitString = psDBGenerateLimitSQL(limit); 546 psStringAppend(&query, " %s", limitString); 547 psFree(limitString); 548 548 } 549 549 … … 566 566 567 567 if (!ippdbPrintMetadatas(stdout, output, "flatcorrPending", !simple)) { 568 psError(PS_ERR_UNKNOWN, false, "failed to print array");569 psFree(output);570 return false;568 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 569 psFree(output); 570 return false; 571 571 } 572 572 … … 588 588 // treat limit == 0 as "no limit" 589 589 if (limit) { 590 psString limitString = psDBGenerateLimitSQL(limit);591 psStringAppend(&query, " %s", limitString);592 psFree(limitString);590 psString limitString = psDBGenerateLimitSQL(limit); 591 psStringAppend(&query, " %s", limitString); 592 psFree(limitString); 593 593 } 594 594 … … 611 611 612 612 if (!ippdbPrintMetadatas(stdout, output, "flatcorrPending", !simple)) { 613 psError(PS_ERR_UNKNOWN, false, "failed to print array");614 psFree(output);615 return false;613 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 614 psFree(output); 615 return false; 616 616 } 617 617 … … 628 628 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 629 629 PXOPT_LOOKUP_BOOL(limit, config->args, "-limit", false); 630 630 631 631 psMetadata *where = psMetadataAlloc(); 632 632 PXOPT_COPY_S64(config->args, where, "-chip_id", "chipProcessedImfile.chip_id", "=="); … … 647 647 // treat limit == 0 as "no limit" 648 648 if (limit) { 649 psString limitString = psDBGenerateLimitSQL(limit);650 psStringAppend(&query, " %s", limitString);651 psFree(limitString);649 psString limitString = psDBGenerateLimitSQL(limit); 650 psStringAppend(&query, " %s", limitString); 651 psFree(limitString); 652 652 } 653 653 … … 670 670 671 671 if (!ippdbPrintMetadatas(stdout, output, "flatcorrPending", !simple)) { 672 psError(PS_ERR_UNKNOWN, false, "failed to print array");673 psFree(output);674 return false;672 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 673 psFree(output); 674 return false; 675 675 } 676 676 … … 685 685 PXOPT_LOOKUP_S64(corr_id, config->args, "-corr_id", true, false); 686 686 PXOPT_LOOKUP_STR(hostname, config->args, "-hostname", false, false); 687 PXOPT_LOOKUP_S16( code, config->args, "-code", false, false);687 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 688 688 689 689 char *query = "UPDATE flatcorrRun SET state = 'full', hostname = '%s', fault = '%hd' WHERE corr_id = %" PRId64; 690 690 691 if (!p_psDBRunQueryF(config->dbh, query, hostname, code, corr_id)) {691 if (!p_psDBRunQueryF(config->dbh, query, hostname, fault, corr_id)) { 692 692 psError(PS_ERR_UNKNOWN, false, "failed to change state for corr_id %" PRId64, corr_id); 693 693 return false; … … 721 721 722 722 // check that state is a valid string value 723 if (!strcmp(state, "reg") && 724 !strcmp(state, "new") && 725 !strcmp(state, "full"))723 if (!strcmp(state, "reg") && 724 !strcmp(state, "new") && 725 !strcmp(state, "full")) 726 726 { 727 727 psError(PS_ERR_UNKNOWN, false, "invalid state: %s", state); … … 745 745 char sqlFilename[80]; 746 746 } ExportTable; 747 747 748 748 int numExportTables = 3; 749 749 … … 825 825 unsigned int nFail; 826 826 psMetadataItem *item, *entry; 827 827 828 828 int numImportTables = 3; 829 829 830 830 char tables[3] [80] = {"flatcorrRun", "flatcorrCamLink", "flatcorrChipLink"}; 831 831 832 832 PS_ASSERT_PTR_NON_NULL(config, NULL); 833 833 834 834 PXOPT_LOOKUP_STR(infile, config->args, "-infile", true, false); 835 835 … … 843 843 psAssert (item, "entry not in input?"); 844 844 psAssert (item->type == PS_DATA_METADATA_MULTI, "entry not multi?"); 845 845 846 846 entry = psListGet (item->data.list, 0); 847 847 assert (entry); 848 848 assert (entry->type == PS_DATA_METADATA); 849 849 850 850 switch (i) { 851 851 case 0: … … 857 857 // psMetadataPrint (stderr, entry->data.md, 1); 858 858 break; 859 } 859 } 860 860 case 1: 861 861 { -
trunk/ippTools/src/flatcorrConfig.c
r23310 r23688 106 106 psMetadataAddS64 (addprocessArgs, PS_LIST_TAIL, "-corr_id", 0, "add complete run for specified corr_id (required)", 0); 107 107 psMetadataAddStr (addprocessArgs, PS_LIST_TAIL, "-hostname", 0, "set hostname", NULL); 108 psMetadataAddS16 (addprocessArgs, PS_LIST_TAIL, "- code", 0, "set fault code", 0);108 psMetadataAddS16 (addprocessArgs, PS_LIST_TAIL, "-fault", 0, "set fault code", 0); 109 109 110 110 // -updaterun -
trunk/ippTools/src/magicdstool.c
r23438 r23688 599 599 600 600 // default values 601 PXOPT_LOOKUP_S16( code, config->args, "-code", false, false);601 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 602 602 PXOPT_LOOKUP_STR(backup_path_base, config->args, "-backup_path_base", false, false); 603 603 PXOPT_LOOKUP_STR(recovery_path_base, config->args, "-recovery_path_base", false, false); 604 604 PXOPT_LOOKUP_BOOL(setmagicked, config->args, "-setmagicked", false); 605 605 606 if (setmagicked && ( code!= 0)) {606 if (setmagicked && (fault != 0)) { 607 607 psError(PS_ERR_UNKNOWN, true, " cannot setmagicked for faulted file"); 608 608 return false; … … 625 625 } 626 626 627 if (!magicDSFileInsert(config->dbh, magic_ds_id, component, backup_path_base, recovery_path_base, code)) {627 if (!magicDSFileInsert(config->dbh, magic_ds_id, component, backup_path_base, recovery_path_base, fault)) { 628 628 // rollback 629 629 if (!psDBRollback(config->dbh)) { … … 781 781 PXOPT_COPY_S64(config->args, where, "-magic_ds_id", "magic_ds_id", "=="); 782 782 PXOPT_COPY_STR(config->args, where, "-component", "component", "=="); 783 PXOPT_COPY_S16(config->args, where, "- code", "fault", "==");783 PXOPT_COPY_S16(config->args, where, "-fault", "fault", "=="); 784 784 785 785 psString query = psStringCopy("DELETE FROM magicDSFile WHERE fault != 0"); -
trunk/ippTools/src/magicdstoolConfig.c
r23389 r23688 99 99 psMetadataAddStr(adddestreakedfileArgs, PS_LIST_TAIL, "-recovery_path_base", 0, "define recovery pixels URI", NULL); 100 100 psMetadataAddBool(adddestreakedfileArgs, PS_LIST_TAIL, "-setmagicked", 0, "update the magicked state of the file", false); 101 psMetadataAddS16(adddestreakedfileArgs, PS_LIST_TAIL, "- code", 0, "set fault code", 0);101 psMetadataAddS16(adddestreakedfileArgs, PS_LIST_TAIL, "-fault", 0, "set fault code", 0); 102 102 103 103 // -revertdestreakedfile … … 105 105 psMetadataAddS64(revertdestreakedfileArgs, PS_LIST_TAIL, "-magic_ds_id", 0, "search by magictool de-streak ID", 0); 106 106 psMetadataAddStr(revertdestreakedfileArgs, PS_LIST_TAIL, "-component", 0, "search by component", NULL); 107 psMetadataAddS16(revertdestreakedfileArgs, PS_LIST_TAIL, "- code", 0, "search by fault code", 0);107 psMetadataAddS16(revertdestreakedfileArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 108 108 109 109 // -getskycells … … 125 125 PXOPT_ADD_MODE("-updaterun", "update state of magic de-streak run", 126 126 MAGICDSTOOL_MODE_UPDATERUN, updaterunArgs); 127 PXOPT_ADD_MODE("-todestreak", "show pending files", 127 PXOPT_ADD_MODE("-todestreak", "show pending files", 128 128 MAGICDSTOOL_MODE_TODESTREAK, todestreakArgs); 129 129 PXOPT_ADD_MODE("-adddestreakedfile", "add a de-streaked file", -
trunk/ippTools/src/magictool.c
r23660 r23688 535 535 536 536 // default values 537 PXOPT_LOOKUP_S16( code, config->args, "-code", false, false);538 539 if ( code> 0) {537 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 538 539 if (fault > 0) { 540 540 char *query = "UPDATE magicRun SET fault = %d, state = 'full' WHERE magic_id = %" PRId64; 541 if (!p_psDBRunQueryF(config->dbh, query, code, magic_id)) {541 if (!p_psDBRunQueryF(config->dbh, query, fault, magic_id)) { 542 542 psError(PS_ERR_UNKNOWN, false, 543 543 "failed to set fault for magic_id %" PRId64, magic_id); … … 561 561 psMetadata *where = psMetadataAlloc(); 562 562 PXOPT_COPY_S64(config->args, where, "-magic_id", "magic_id", "=="); 563 PXOPT_COPY_S16(config->args, where, "- code", "fault", "==");563 PXOPT_COPY_S16(config->args, where, "-fault", "fault", "=="); 564 564 565 565 psString query = psStringCopy("UPDATE magicRun SET fault = 0, state = 'run' WHERE fault != 0"); … … 908 908 909 909 // default values 910 PXOPT_LOOKUP_S16( code, config->args, "-code", false, false);910 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 911 911 912 912 if (!magicNodeResultInsert(config->dbh, … … 914 914 node, 915 915 uri, 916 code916 fault 917 917 )) { 918 918 psError(PS_ERR_UNKNOWN, false, "database error"); … … 931 931 PXOPT_COPY_STR(config->args, where, "-node", "node", "=="); 932 932 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 933 PXOPT_COPY_S16(config->args, where, "- code", "magicNodeResult.fault", "==");933 PXOPT_COPY_S16(config->args, where, "-fault", "fault", "=="); 934 934 935 935 psString query = pxDataGet("magictool_revertnode.sql"); … … 1037 1037 1038 1038 // default values 1039 PXOPT_LOOKUP_S16( code, config->args, "-code", false, false);1039 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 1040 1040 1041 1041 if (!psDBTransaction(config->dbh)) { … … 1048 1048 uri, 1049 1049 streaks, 1050 code1050 fault 1051 1051 )) { 1052 1052 psError(PS_ERR_UNKNOWN, false, "database error"); … … 1094 1094 psMetadata *where = psMetadataAlloc(); 1095 1095 PXOPT_COPY_S64(config->args, where, "-magic_id", "magic_id", "=="); 1096 PXOPT_COPY_S16(config->args, where, "- code", "fault", "==");1096 PXOPT_COPY_S16(config->args, where, "-fault", "fault", "=="); 1097 1097 1098 1098 if (!psDBTransaction(config->dbh)) { -
trunk/ippTools/src/magictoolConfig.c
r23660 r23688 100 100 psMetadataAddS64(inputtreeArgs, PS_LIST_TAIL, "-magic_id", 0, "define magictool ID (required)", 0); 101 101 psMetadataAddStr(inputtreeArgs, PS_LIST_TAIL, "-dep_file", 0, "order of operations dep. file", NULL); 102 psMetadataAddS16(inputtreeArgs, PS_LIST_TAIL, "- code", 0, "set fault code", 0);102 psMetadataAddS16(inputtreeArgs, PS_LIST_TAIL, "-fault", 0, "set fault code", 0); 103 103 104 104 // -reverttree 105 105 psMetadata *reverttreeArgs = psMetadataAlloc(); 106 106 psMetadataAddS64(reverttreeArgs, PS_LIST_TAIL, "-magic_id", 0, "search by magictool ID", 0); 107 psMetadataAddS16(reverttreeArgs, PS_LIST_TAIL, "- code", 0, "search by fault code", 0);107 psMetadataAddS16(reverttreeArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 108 108 109 109 // -inputs … … 126 126 psMetadataAddStr(addresultArgs, PS_LIST_TAIL, "-node", 0, "define symbolic node name (required)", NULL); 127 127 psMetadataAddStr(addresultArgs, PS_LIST_TAIL, "-uri", 0, "define URI", NULL); 128 psMetadataAddS16(addresultArgs, PS_LIST_TAIL, "- code", 0, "set fault code", 0);128 psMetadataAddS16(addresultArgs, PS_LIST_TAIL, "-fault", 0, "set fault code", 0); 129 129 130 130 // -revertnode … … 133 133 psMetadataAddStr(revertnodeArgs, PS_LIST_TAIL, "-node", 0, "search by node name", NULL); 134 134 psMetadataAddStr(revertnodeArgs, PS_LIST_TAIL, "-label",0, "search by label", NULL); 135 psMetadataAddS16(revertnodeArgs, PS_LIST_TAIL, "- code", 0, "search by fault code", 0);135 psMetadataAddS16(revertnodeArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 136 136 137 137 // -tomask … … 145 145 psMetadataAddStr(addmaskArgs, PS_LIST_TAIL, "-uri", 0, "define URI", NULL); 146 146 psMetadataAddS32(addmaskArgs, PS_LIST_TAIL, "-streaks", 0, "define number of streaks", 0); 147 psMetadataAddS16(addmaskArgs, PS_LIST_TAIL, "- code", 0, "set fault code", 0);147 psMetadataAddS16(addmaskArgs, PS_LIST_TAIL, "-fault", 0, "set fault code", 0); 148 148 149 149 // -revertmask 150 150 psMetadata *revertmaskArgs = psMetadataAlloc(); 151 151 psMetadataAddS64(revertmaskArgs, PS_LIST_TAIL, "-magic_id", 0, "search by magictool ID", 0); 152 psMetadataAddS16(revertmaskArgs, PS_LIST_TAIL, "- code", 0, "search by fault code", 0);152 psMetadataAddS16(revertmaskArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 153 153 154 154 // -mask -
trunk/ippTools/src/pztool.c
r23497 r23688 338 338 // a lot simplier than a complicated scheme (tried that) to attempt to 339 339 // request on the right number of rows for each camera 340 340 341 341 // treat limit == 0 as "no limit" 342 342 if (limit) { … … 403 403 404 404 // default values 405 PXOPT_LOOKUP_S16( code, config->args, "-code", false, false);405 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 406 406 407 407 // start a transaction early so it will contain any row level locks … … 410 410 return false; 411 411 } 412 412 413 413 // query to get an excluse lock on this exposure in 414 414 // pzDownloadExp … … 421 421 PXOPT_COPY_STR(config->args, where, "-inst", "camera", "=="); 422 422 PXOPT_COPY_STR(config->args, where, "-telescope", "telescope", "=="); 423 423 424 424 if (psListLength(where->list)) { 425 425 psString whereClause = psDBGenerateWhereSQL(where, NULL); … … 455 455 class_id, 456 456 uri, 457 code,457 fault, 458 458 NULL, // epoch 459 459 hostname … … 605 605 psError(PS_ERR_UNKNOWN, false, "database error"); 606 606 return false; 607 } 607 } 608 608 609 609 // sanity check: we should have inserted at least one row … … 675 675 // init 676 676 long counter = 0, // the total number of elements zipped so far 677 i = 0, // which array in the set 677 i = 0, // which array in the set 678 678 index = 0; // the depth into each array 679 679 // test … … 782 782 PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "=="); 783 783 784 PXOPT_LOOKUP_S16( code, config->args, "-code", true, false);785 786 if (!pxSetFaultCode(config->dbh, "pzDownloadImfile", where, code)) {784 PXOPT_LOOKUP_S16(fault, config->args, "-fault", true, false); 785 786 if (!pxSetFaultCode(config->dbh, "pzDownloadImfile", where, fault)) { 787 787 psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag"); 788 psFree (where);789 return false;788 psFree (where); 789 return false; 790 790 } 791 791 psFree(where); -
trunk/ippTools/src/pztoolConfig.c
r23497 r23688 45 45 // -adddatastore 46 46 psMetadata *adddatastoreArgs = psMetadataAlloc(); 47 psMetadataAddStr(adddatastoreArgs, PS_LIST_TAIL, "-inst", 0, "define camera ID", NULL); 48 psMetadataAddStr(adddatastoreArgs, PS_LIST_TAIL, "-telescope", 0, "define telescope ID", NULL); 47 psMetadataAddStr(adddatastoreArgs, PS_LIST_TAIL, "-inst", 0, "define camera ID", NULL); 48 psMetadataAddStr(adddatastoreArgs, PS_LIST_TAIL, "-telescope", 0, "define telescope ID", NULL); 49 49 psMetadataAddStr(adddatastoreArgs, PS_LIST_TAIL, "-uri", 0, "define storage uri", NULL); 50 50 51 51 // -datastore 52 52 psMetadata *datastoreArgs = psMetadataAlloc(); … … 55 55 // -seen 56 56 psMetadata *seenArgs = psMetadataAlloc(); 57 psMetadataAddStr(seenArgs, PS_LIST_TAIL, "-exp_name", 0, "define exposure ID", NULL); 58 psMetadataAddStr(seenArgs, PS_LIST_TAIL, "-inst", 0, "define camera ID", NULL); 59 psMetadataAddStr(seenArgs, PS_LIST_TAIL, "-telescope", 0, "define telescope ID", NULL); 60 psMetadataAddStr(seenArgs, PS_LIST_TAIL, "-exp_type", 0, "define exposure type", NULL); 57 psMetadataAddStr(seenArgs, PS_LIST_TAIL, "-exp_name", 0, "define exposure ID", NULL); 58 psMetadataAddStr(seenArgs, PS_LIST_TAIL, "-inst", 0, "define camera ID", NULL); 59 psMetadataAddStr(seenArgs, PS_LIST_TAIL, "-telescope", 0, "define telescope ID", NULL); 60 psMetadataAddStr(seenArgs, PS_LIST_TAIL, "-exp_type", 0, "define exposure type", NULL); 61 61 psMetadataAddBool(seenArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); 62 62 63 63 // -pendingexp 64 64 psMetadata *pendingexpArgs = psMetadataAlloc(); 65 psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-exp_name", 0, "define exposure ID", NULL); 66 psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-inst", 0, "define camera ID", NULL); 67 psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-telescope", 0, "define telescope ID", NULL); 68 psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-exp_type", 0, "define exposure type", NULL); 65 psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-exp_name", 0, "define exposure ID", NULL); 66 psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-inst", 0, "define camera ID", NULL); 67 psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-telescope", 0, "define telescope ID", NULL); 68 psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-exp_type", 0, "define exposure type", NULL); 69 69 psMetadataAddBool(pendingexpArgs, PS_LIST_TAIL, "-desc", 0, "sort ouput in descending format", false); 70 70 psMetadataAddU64(pendingexpArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0); … … 73 73 // -pendingimfile 74 74 psMetadata *pendingimfileArgs = psMetadataAlloc(); 75 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_name", 0, "define exposure ID", NULL); 76 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-inst", 0, "define camera ID", NULL); 77 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-telescope", 0, "define telescope ID", NULL); 78 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_type", 0, "define exposure type", NULL); 75 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_name", 0, "define exposure ID", NULL); 76 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-inst", 0, "define camera ID", NULL); 77 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-telescope", 0, "define telescope ID", NULL); 78 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_type", 0, "define exposure type", NULL); 79 79 psMetadataAddBool(pendingimfileArgs, PS_LIST_TAIL, "-desc", 0, "sort ouput in descending format", false); 80 80 psMetadataAddU64(pendingimfileArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0); … … 83 83 // -copydone 84 84 psMetadata *copydoneArgs = psMetadataAlloc(); 85 psMetadataAddStr(copydoneArgs, PS_LIST_TAIL, "-exp_name", 0, "define exposure ID (required)", NULL); 86 psMetadataAddStr(copydoneArgs, PS_LIST_TAIL, "-inst", 0, "define camera ID (required)", NULL); 87 psMetadataAddStr(copydoneArgs, PS_LIST_TAIL, "-telescope", 0, "define telescope ID (required)", NULL); 85 psMetadataAddStr(copydoneArgs, PS_LIST_TAIL, "-exp_name", 0, "define exposure ID (required)", NULL); 86 psMetadataAddStr(copydoneArgs, PS_LIST_TAIL, "-inst", 0, "define camera ID (required)", NULL); 87 psMetadataAddStr(copydoneArgs, PS_LIST_TAIL, "-telescope", 0, "define telescope ID (required)", NULL); 88 88 psMetadataAddStr(copydoneArgs, PS_LIST_TAIL, "-class", 0, "define class", NULL); 89 89 psMetadataAddStr(copydoneArgs, PS_LIST_TAIL, "-class_id", 0, "define class_id", NULL); … … 95 95 psMetadataAddStr(copydoneArgs, PS_LIST_TAIL, "-label", 0, "define the label for the chip stage", NULL); 96 96 psMetadataAddStr(copydoneArgs, PS_LIST_TAIL, "-hostname", 0, "define the host that copied the image", NULL); 97 psMetadataAddS16(copydoneArgs, PS_LIST_TAIL, "- code", 0, "set fault code", 0);97 psMetadataAddS16(copydoneArgs, PS_LIST_TAIL, "-fault", 0, "set fault code", 0); 98 98 psMetadataAddBool(copydoneArgs, PS_LIST_TAIL, "-row_lock", 0, "lock pzDownImfile rows while advancing an exposure", false); 99 99 // XXX: remove this once advance is fixed … … 102 102 // -copied 103 103 psMetadata *copiedArgs = psMetadataAlloc(); 104 psMetadataAddStr(copiedArgs, PS_LIST_TAIL, "-exp_name", 0, "define exposure ID", NULL); 105 psMetadataAddStr(copiedArgs, PS_LIST_TAIL, "-inst", 0, "define camera ID", NULL); 106 psMetadataAddStr(copiedArgs, PS_LIST_TAIL, "-telescope", 0, "define telescope ID", NULL); 104 psMetadataAddStr(copiedArgs, PS_LIST_TAIL, "-exp_name", 0, "define exposure ID", NULL); 105 psMetadataAddStr(copiedArgs, PS_LIST_TAIL, "-inst", 0, "define camera ID", NULL); 106 psMetadataAddStr(copiedArgs, PS_LIST_TAIL, "-telescope", 0, "define telescope ID", NULL); 107 107 psMetadataAddStr(copiedArgs, PS_LIST_TAIL, "-class", 0, "define class", NULL); 108 108 psMetadataAddStr(copiedArgs, PS_LIST_TAIL, "-class_id", 0, "define class_id", NULL); … … 113 113 // -updatecopied 114 114 psMetadata *updatecopiedArgs = psMetadataAlloc(); 115 psMetadataAddStr(updatecopiedArgs, PS_LIST_TAIL, "-exp_name", 0, "define exposure ID (required)", NULL); 116 psMetadataAddStr(updatecopiedArgs, PS_LIST_TAIL, "-inst", 0, "define camera ID (required)", NULL); 117 psMetadataAddStr(updatecopiedArgs, PS_LIST_TAIL, "-telescope", 0, "define telescope ID (required)", NULL); 115 psMetadataAddStr(updatecopiedArgs, PS_LIST_TAIL, "-exp_name", 0, "define exposure ID (required)", NULL); 116 psMetadataAddStr(updatecopiedArgs, PS_LIST_TAIL, "-inst", 0, "define camera ID (required)", NULL); 117 psMetadataAddStr(updatecopiedArgs, PS_LIST_TAIL, "-telescope", 0, "define telescope ID (required)", NULL); 118 118 psMetadataAddStr(updatecopiedArgs, PS_LIST_TAIL, "-class", 0, "define class", NULL); 119 119 psMetadataAddStr(updatecopiedArgs, PS_LIST_TAIL, "-class_id", 0, "define class_id", NULL); 120 psMetadataAddS16(updatecopiedArgs, PS_LIST_TAIL, "- code", 0, "search by fault code", 0);120 psMetadataAddS16(updatecopiedArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 121 121 122 122 // -revertcopied 123 123 psMetadata *revertcopiedArgs = psMetadataAlloc(); 124 psMetadataAddStr(revertcopiedArgs, PS_LIST_TAIL, "-exp_name", 0, "define exposure ID (required)", NULL); 125 psMetadataAddStr(revertcopiedArgs, PS_LIST_TAIL, "-inst", 0, "define camera ID (required)", NULL); 126 psMetadataAddStr(revertcopiedArgs, PS_LIST_TAIL, "-telescope", 0, "define telescope ID (required)", NULL); 124 psMetadataAddStr(revertcopiedArgs, PS_LIST_TAIL, "-exp_name", 0, "define exposure ID (required)", NULL); 125 psMetadataAddStr(revertcopiedArgs, PS_LIST_TAIL, "-inst", 0, "define camera ID (required)", NULL); 126 psMetadataAddStr(revertcopiedArgs, PS_LIST_TAIL, "-telescope", 0, "define telescope ID (required)", NULL); 127 127 psMetadataAddStr(revertcopiedArgs, PS_LIST_TAIL, "-class", 0, "define class", NULL); 128 128 psMetadataAddStr(revertcopiedArgs, PS_LIST_TAIL, "-class_id", 0, "define class_id", NULL); 129 psMetadataAddS16(revertcopiedArgs, PS_LIST_TAIL, "- code", 0, "search by fault code", 0);129 psMetadataAddS16(revertcopiedArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 130 130 131 131 // -clearcommonfaults … … 134 134 // -toadvance 135 135 psMetadata *toadvanceArgs = psMetadataAlloc(); 136 psMetadataAddStr(toadvanceArgs, PS_LIST_TAIL, "-exp_name", 0, "define exposure ID", NULL); 137 psMetadataAddStr(toadvanceArgs, PS_LIST_TAIL, "-inst", 0, "define camera ID", NULL); 138 psMetadataAddStr(toadvanceArgs, PS_LIST_TAIL, "-telescope", 0, "define telescope ID", NULL); 136 psMetadataAddStr(toadvanceArgs, PS_LIST_TAIL, "-exp_name", 0, "define exposure ID", NULL); 137 psMetadataAddStr(toadvanceArgs, PS_LIST_TAIL, "-inst", 0, "define camera ID", NULL); 138 psMetadataAddStr(toadvanceArgs, PS_LIST_TAIL, "-telescope", 0, "define telescope ID", NULL); 139 139 psMetadataAddStr(toadvanceArgs, PS_LIST_TAIL, "-label", 0, "define the label for the chip stage", NULL); 140 140 psMetadataAddBool(toadvanceArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); … … 143 143 // -advance 144 144 psMetadata *advanceArgs = psMetadataAlloc(); 145 psMetadataAddStr(advanceArgs, PS_LIST_TAIL, "-exp_name", 0, "define exposure ID (required)", NULL); 146 psMetadataAddStr(advanceArgs, PS_LIST_TAIL, "-inst", 0, "define camera ID (required)", NULL); 147 psMetadataAddStr(advanceArgs, PS_LIST_TAIL, "-telescope", 0, "define telescope ID (required)", NULL); 145 psMetadataAddStr(advanceArgs, PS_LIST_TAIL, "-exp_name", 0, "define exposure ID (required)", NULL); 146 psMetadataAddStr(advanceArgs, PS_LIST_TAIL, "-inst", 0, "define camera ID (required)", NULL); 147 psMetadataAddStr(advanceArgs, PS_LIST_TAIL, "-telescope", 0, "define telescope ID (required)", NULL); 148 148 psMetadataAddStr(advanceArgs, PS_LIST_TAIL, "-workdir", 0, "define the \"default\" workdir for this exposure (required)", NULL); 149 149 psMetadataAddStr(advanceArgs, PS_LIST_TAIL, "-dvodb", 0, "define the dvodb for the next processing step", NULL); -
trunk/ippTools/src/regtool.c
r23544 r23688 238 238 PXOPT_LOOKUP_TIME(dateobs, config->args, "-dateobs", false, false); 239 239 PXOPT_LOOKUP_STR(hostname, config->args, "-hostname", false, false); 240 PXOPT_LOOKUP_S16(code, config->args, "-code", false, false); 240 241 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 242 PXOPT_LOOKUP_S16(quality, config->args, "-quality", false, false); 241 243 242 244 if (!rawImfileInsert( … … 302 304 ignored, 303 305 hostname, 304 code, 306 fault, 307 quality, 305 308 NULL, 306 309 0 … … 408 411 PXOPT_COPY_STR(config->args, where, "-tmp_class_id", "tmp_class_id", "=="); 409 412 PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "=="); 410 PXOPT_COPY_S16(config->args, where, "- code", "fault", "==");413 PXOPT_COPY_S16(config->args, where, "-fault", "fault", "=="); 411 414 PXOPT_COPY_S64(config->args, where, "-exp_id_begin", "exp_id", ">="); 412 415 PXOPT_COPY_S64(config->args, where, "-exp_id_end", "exp_id", "<="); … … 452 455 PXOPT_LOOKUP_STR(class_id, config->args, "-class_id", true, false); 453 456 454 PXOPT_LOOKUP_S16( code, config->args, "-code", false, false);457 PXOPT_LOOKUP_S16(fault, config->args, "-fault", true, false); 455 458 PXOPT_LOOKUP_F64(user_1, config->args, "-user_1", false, false); 456 459 457 if (( code== INT16_MAX) && !isfinite(user_1)) {458 psError(PS_ERR_UNKNOWN, false, "one of - codeor -user_1 must be selected");459 return false; 460 } 461 if (( code!= INT16_MAX) && isfinite(user_1)) {462 psError(PS_ERR_UNKNOWN, false, "only one of - codeor -user_1 must be selected");460 if ((fault == INT16_MAX) && !isfinite(user_1)) { 461 psError(PS_ERR_UNKNOWN, false, "one of -fault or -user_1 must be selected"); 462 return false; 463 } 464 if ((fault != INT16_MAX) && isfinite(user_1)) { 465 psError(PS_ERR_UNKNOWN, false, "only one of -fault or -user_1 must be selected"); 463 466 return false; 464 467 } … … 468 471 PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "=="); 469 472 470 if ( code!= INT16_MAX) {473 if (fault != INT16_MAX) { 471 474 // this is fairly dangerous : can set all if the where is not set... 472 if (!pxSetFaultCode(config->dbh, "rawImfile", where, code)) {475 if (!pxSetFaultCode(config->dbh, "rawImfile", where, fault)) { 473 476 psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag"); 474 477 psFree (where); … … 644 647 645 648 // default 646 PXOPT_LOOKUP_S16( code, config->args, "-code", false, false);649 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 647 650 648 651 psString query = pxDataGet("regtool_pendingexp.sql"); … … 801 804 moon_phase, 802 805 hostname, 803 code,806 fault, 804 807 NULL, 805 808 0 … … 995 998 psMetadata *where = psMetadataAlloc(); 996 999 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 997 PXOPT_COPY_S16(config->args, where, "- code", "fault", "==");1000 PXOPT_COPY_S16(config->args, where, "-fault", "fault", "=="); 998 1001 PXOPT_COPY_S64(config->args, where, "-exp_id_begin", "exp_id", ">="); 999 1002 PXOPT_COPY_S64(config->args, where, "-exp_id_end", "exp_id", "<="); … … 1039 1042 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 1040 1043 1041 PXOPT_LOOKUP_S16( code, config->args, "-code", true, false);1042 1043 if (!pxSetFaultCode(config->dbh, "rawExp", where, code)) {1044 PXOPT_LOOKUP_S16(fault, config->args, "-fault", true, false); 1045 1046 if (!pxSetFaultCode(config->dbh, "rawExp", where, fault)) { 1044 1047 psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag"); 1045 1048 psFree(where); … … 1161 1164 char sqlFilename[80]; 1162 1165 } ExportTable; 1163 1166 1164 1167 int numExportTables = 2; 1165 1168 … … 1241 1244 1242 1245 PS_ASSERT_PTR_NON_NULL(config, NULL); 1243 1246 1244 1247 PXOPT_LOOKUP_STR(infile, config->args, "-infile", true, false); 1245 1248 … … 1252 1255 psAssert (item, "entry not in input?"); 1253 1256 psAssert (item->type == PS_DATA_METADATA_MULTI, "entry not multi?"); 1254 1257 1255 1258 psMetadataItem *entry = psListGet (item->data.list, 0); 1256 1259 assert (entry); -
trunk/ippTools/src/regtoolConfig.c
r23545 r23688 122 122 ADD_OPT(Time, addprocessedimfileArgs, "-dateobs", "define observation time", NULL); 123 123 ADD_OPT(Str, addprocessedimfileArgs, "-hostname", "define host name", NULL); 124 ADD_OPT(S16, addprocessedimfileArgs, "-code", "set fault code", 0); 124 ADD_OPT(S16, addprocessedimfileArgs, "-fault", "set fault code", 0); 125 ADD_OPT(S16, addprocessedimfileArgs, "-quality", "set quality flag", 0); 125 126 126 127 // -processedimfile … … 140 141 ADD_OPT(Str, revertprocessedimfileArgs, "-tmp_class_id", "searcy by temp. class ID", NULL); 141 142 ADD_OPT(Str, revertprocessedimfileArgs, "-class_id", "search by class ID", NULL); 142 ADD_OPT(S16, revertprocessedimfileArgs, "- code", "search by fault code", 0);143 ADD_OPT(S16, revertprocessedimfileArgs, "-fault", "search by fault code", 0); 143 144 ADD_OPT(S64, revertprocessedimfileArgs, "-exp_id_begin", "search by exposure ID", 0); 144 145 ADD_OPT(S64, revertprocessedimfileArgs, "-exp_id_end", "search by exposure ID", 0); … … 149 150 ADD_OPT(Str, updateprocessedimfileArgs, "-class_id", "search by class ID", NULL); 150 151 ADD_OPT(F64, updateprocessedimfileArgs, "-user_1", "set user stat (1)", NAN); 151 ADD_OPT(S16, updateprocessedimfileArgs, "- code", "set fault code", INT16_MAX);152 ADD_OPT(S16, updateprocessedimfileArgs, "-fault", "set fault code (required)", INT16_MAX); 152 153 153 154 // -pendingexp … … 226 227 ADD_OPT(Str, addprocessedexpArgs, "-label", "define label for chip stage (non-detrend data only)", NULL); 227 228 ADD_OPT(Str, addprocessedexpArgs, "-hostname", "define host name", NULL); 228 ADD_OPT(S16, addprocessedexpArgs, "- code", "set fault code", 0);229 ADD_OPT(S16, addprocessedexpArgs, "-fault", "set fault code", 0); 229 230 230 231 // -processedexp … … 276 277 psMetadata *revertprocessedexpArgs = psMetadataAlloc(); 277 278 psMetadataAddS64(revertprocessedexpArgs, PS_LIST_TAIL, "-exp_id", 0, "search by exposure ID", 0); 278 psMetadataAddS16(revertprocessedexpArgs, PS_LIST_TAIL, "- code", 0, "search by fault code", 0);279 psMetadataAddS16(revertprocessedexpArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 279 280 psMetadataAddS64(revertprocessedexpArgs, PS_LIST_TAIL, "-exp_id_begin", 0, "search by exposure ID", 0); 280 281 psMetadataAddS64(revertprocessedexpArgs, PS_LIST_TAIL, "-exp_id_end", 0, "search by exposure ID", 0); … … 283 284 psMetadata *updatedprocessedexpArgs = psMetadataAlloc(); 284 285 psMetadataAddS64(updatedprocessedexpArgs, PS_LIST_TAIL, "-exp_id", 0, "search by exposure ID", 0); 285 psMetadataAddS16(updatedprocessedexpArgs, PS_LIST_TAIL, "- code", 0, "set fault code (required)", INT16_MAX);286 psMetadataAddS16(updatedprocessedexpArgs, PS_LIST_TAIL, "-fault", 0, "set fault code (required)", INT16_MAX); 286 287 287 288 // -exportrun -
trunk/ippTools/src/stacktool.c
r23310 r23688 718 718 719 719 // default values 720 PXOPT_LOOKUP_S16(code, config->args, "-code", false, false); 720 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 721 PXOPT_LOOKUP_S16(quality, config->args, "-quality", false, false); 721 722 722 723 if (!psDBTransaction(config->dbh)) { … … 754 755 hostname, 755 756 good_frac, 756 code 757 fault, 758 quality 757 759 )) { 758 760 if (!psDBRollback(config->dbh)) { … … 862 864 PXOPT_COPY_S64(config->args, where, "-stack_id", "stackSumSkyfile.stack_id", "=="); 863 865 PXOPT_COPY_STR(config->args, where, "-label", "stackRun.label", "=="); 864 PXOPT_COPY_S16(config->args, where, "- code", "stackSumSkyfile.fault", "==");866 PXOPT_COPY_S16(config->args, where, "-fault", "stackSumSkyfile.fault", "=="); 865 867 866 868 if (!psDBTransaction(config->dbh)) { … … 1169 1171 PS_ASSERT_PTR_NON_NULL(config, false); 1170 1172 1171 PXOPT_LOOKUP_S16( code, config->args, "-code", true, false);1173 PXOPT_LOOKUP_S16(fault, config->args, "-fault", true, false); 1172 1174 1173 1175 psMetadata *where = psMetadataAlloc(); 1174 1176 PXOPT_COPY_S64(config->args, where, "-stack_id", "stack_id", "=="); 1175 1177 1176 if (!pxSetFaultCode(config->dbh, "stackSumSkyfile", where, code)) {1178 if (!pxSetFaultCode(config->dbh, "stackSumSkyfile", where, fault)) { 1177 1179 psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag"); 1178 1180 psFree (where); … … 1192 1194 1193 1195 int numExportTables = 3; 1194 1196 1195 1197 PS_ASSERT_PTR_NON_NULL(config, NULL); 1196 1198 … … 1262 1264 { 1263 1265 unsigned int nFail; 1264 1266 1265 1267 int numImportTables = 2; 1266 1268 1267 1269 char tables[2] [80] = {"stackInputSkyfile", "stackSumSkyfile"}; 1268 1270 1269 1271 PS_ASSERT_PTR_NON_NULL(config, NULL); 1270 1272 1271 1273 PXOPT_LOOKUP_STR(infile, config->args, "-infile", true, false); 1272 1274 … … 1293 1295 psAssert (item, "entry not in input?"); 1294 1296 psAssert (item->type == PS_DATA_METADATA_MULTI, "entry not multi?"); 1295 1297 1296 1298 switch (i) { 1297 1299 case 0: … … 1307 1309 } 1308 1310 break; 1309 1311 1310 1312 case 1: 1311 1313 for (int i = 0; i < item->data.list->n; i++) { … … 1322 1324 } 1323 1325 } 1324 1326 1325 1327 return true; 1326 1328 } -
trunk/ippTools/src/stacktoolConfig.c
r23310 r23688 147 147 psMetadataAddStr(addsumskyfileArgs, PS_LIST_TAIL, "-hostname", 0, "define hostname", 0); 148 148 psMetadataAddF32(addsumskyfileArgs, PS_LIST_TAIL, "-good_frac", 0, "define %% of good pixels", NAN); 149 psMetadataAddS16(addsumskyfileArgs, PS_LIST_TAIL, "-code", 0, "set fault code", 0); 149 psMetadataAddS16(addsumskyfileArgs, PS_LIST_TAIL, "-fault", 0, "set fault code", 0); 150 psMetadataAddS16(addsumskyfileArgs, PS_LIST_TAIL, "-quality", 0, "set quality", 0); 150 151 151 152 // -sumskyfile … … 162 163 psMetadataAddS64(revertsumskyfileArgs, PS_LIST_TAIL, "-stack_id", 0, "search by stack ID", 0); 163 164 psMetadataAddStr(revertsumskyfileArgs, PS_LIST_TAIL, "-label", 0, "search by label", 0); 164 psMetadataAddS16(revertsumskyfileArgs, PS_LIST_TAIL, "- code", 0, "search by fault code", 0);165 psMetadataAddS16(revertsumskyfileArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 165 166 166 167 // -pendingcleanuprun … … 185 186 psMetadata *updatesumskyfileArgs = psMetadataAlloc(); 186 187 psMetadataAddS64(updatesumskyfileArgs, PS_LIST_TAIL, "-stack_id", 0, "define stack ID (required)", 0); 187 psMetadataAddS16(updatesumskyfileArgs, PS_LIST_TAIL, "- code", 0, "set fault code (required)", 0);188 psMetadataAddS16(updatesumskyfileArgs, PS_LIST_TAIL, "-fault", 0, "set fault code (required)", 0); 188 189 189 190 // -exportrun -
trunk/ippTools/src/warptool.c
r23613 r23688 609 609 PXOPT_LOOKUP_STR(mapfile, config->args, "-mapfile", false, false); 610 610 PXOPT_LOOKUP_S64(warp_id, config->args, "-warp_id", false, false); 611 PXOPT_LOOKUP_S16( code, config->args, "-code", false, false);611 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 612 612 613 613 if (!psDBTransaction(config->dbh)) { … … 616 616 } 617 617 618 if ( code== 0) {618 if (fault == 0) { 619 619 if (!parseAndInsertSkyCellMap(config, mapfile)) { 620 620 psError(PS_ERR_UNKNOWN, false, "failed to inject mapfile: %s into the database", mapfile); … … 631 631 NULL, // tess_id 632 632 NULL, // class_id 633 code// fault633 fault // fault 634 634 ); 635 635 } … … 896 896 PXOPT_LOOKUP_STR(hostname, config->args, "-hostname", false, false); 897 897 PXOPT_LOOKUP_F32(good_frac, config->args, "-good_frac", false, false); 898 PXOPT_LOOKUP_BOOL(accept, config->args, "-accept", false);899 898 PXOPT_LOOKUP_BOOL(magicked, config->args, "-magicked", false); 900 899 901 900 // default values 902 PXOPT_LOOKUP_S16(code, config->args, "-code", false, false); 901 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 902 PXOPT_LOOKUP_S16(quality, config->args, "-quality", false, false); 903 903 904 904 // we don't want to insert the last skyfile in a run but then not mark the … … 927 927 ymin, 928 928 ymax, 929 !accept,930 code,929 fault, 930 quality, 931 931 magicked 932 932 )) { … … 1112 1112 PXOPT_COPY_STR(config->args, where, "-reduction", "rawExp.reduction", "=="); 1113 1113 PXOPT_COPY_STR(config->args, where, "-label", "warpRun.label", "=="); 1114 PXOPT_COPY_S16(config->args, where, "- code", "warpSkyfile.fault", "==");1114 PXOPT_COPY_S16(config->args, where, "-fault", "warpSkyfile.fault", "=="); 1115 1115 1116 1116 if (!psListLength(where->list) … … 1560 1560 PS_ASSERT_PTR_NON_NULL(config, false); 1561 1561 1562 // warp_id, skycell_id, codeare required1562 // warp_id, skycell_id, fault are required 1563 1563 PXOPT_LOOKUP_S64(warp_id, config->args, "-warp_id", true, false); 1564 1564 PXOPT_LOOKUP_STR(skycell_id, config->args, "-skycell_id", true, false); 1565 PXOPT_LOOKUP_S16( code, config->args, "-code", false, false);1565 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 1566 1566 1567 1567 psString query = pxDataGet("warptool_updateskyfile.sql"); 1568 1568 1569 if (!p_psDBRunQueryF(config->dbh, query, code, warp_id, skycell_id)) {1569 if (!p_psDBRunQueryF(config->dbh, query, fault, warp_id, skycell_id)) { 1570 1570 psError(PS_ERR_UNKNOWN, false, "database error"); 1571 1571 return false; -
trunk/ippTools/src/warptoolConfig.c
r23613 r23688 155 155 psMetadataAddStr(addoverlapArgs, PS_LIST_TAIL, "-mapfile", 0, "path to skycell <-> imfile mapping file", NULL); 156 156 psMetadataAddS64(addoverlapArgs, PS_LIST_TAIL, "-warp_id", 0, "set warp ID", 0); 157 psMetadataAddS16(addoverlapArgs, PS_LIST_TAIL, "- code", 0, "set fault code", 0);157 psMetadataAddS16(addoverlapArgs, PS_LIST_TAIL, "-fault", 0, "set fault code", 0); 158 158 159 159 // -scmap … … 190 190 psMetadataAddStr(addwarpedArgs, PS_LIST_TAIL, "-hostname", 0, "define hostname", 0); 191 191 psMetadataAddF32(addwarpedArgs, PS_LIST_TAIL, "-good_frac", 0, "define %% of good pixels", NAN); 192 psMetadataAddBool(addwarpedArgs, PS_LIST_TAIL, "-accept", 0, "define if this skycell should be accepted", false);193 192 psMetadataAddBool(addwarpedArgs, PS_LIST_TAIL, "-magicked", 0, "define if this skycell has been magicked", false); 194 psMetadataAddS16(addwarpedArgs, PS_LIST_TAIL, "-code", 0, "set fault code", 0); 193 psMetadataAddS16(addwarpedArgs, PS_LIST_TAIL, "-fault", 0, "set fault code", 0); 194 psMetadataAddS16(addwarpedArgs, PS_LIST_TAIL, "-quality", 0, "set quality", 0); 195 195 196 196 // -warped … … 216 216 psMetadataAddStr(revertwarpedArgs, PS_LIST_TAIL, "-reduction", 0, "search by warpRun reduction class", NULL); 217 217 psMetadataAddStr(revertwarpedArgs, PS_LIST_TAIL, "-label", 0, "search by warpRun label", NULL); 218 psMetadataAddS16(revertwarpedArgs, PS_LIST_TAIL, "- code", 0, "search by fault code", 0);218 psMetadataAddS16(revertwarpedArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 219 219 psMetadataAddBool(revertwarpedArgs, PS_LIST_TAIL, "-all", 0, "allow everything to be queued without search terms", false); 220 220 … … 269 269 psMetadataAddS64(updateskyfileArgs, PS_LIST_TAIL, "-warp_id", 0, "warptool ID to update", 0); 270 270 psMetadataAddStr(updateskyfileArgs, PS_LIST_TAIL, "-skycell_id", 0, "skycell ID to update", NULL); 271 psMetadataAddS16(updateskyfileArgs, PS_LIST_TAIL, "- code", 0, "new fault code", 0);271 psMetadataAddS16(updateskyfileArgs, PS_LIST_TAIL, "-fault", 0, "new fault code", 0); 272 272 273 273 // -exportrun -
trunk/ippconfig/recipes/ppStatsFromMetadata.config
r20302 r23688 50 50 ENTRY VAL ROBUST_MEDIAN F32 ROBUST_STDEV -bg_mean_stdev 51 51 ENTRY VAL ROBUST_STDEV F32 RMS -bg_stdev 52 ENTRY VAL QUALITY S32 CONSTANT -quality # Bad quality flag 52 53 END 53 54 … … 168 169 ENTRY VAL IQ_M2S_L F32 SAMPLE_MEAN -iq_m2s_lq 169 170 ENTRY VAL IQ_M2S_U F32 SAMPLE_MEAN -iq_m2s_uq 171 ENTRY VAL QUALITY S32 CONSTANT -quality # Bad quality flag 170 172 END 171 173 … … 225 227 ENTRY VAL iq_m2s F32 UQ -iq_m2s_uq 226 228 ENTRY VAL iq_m2s F32 LQ -iq_m2s_lq 229 230 ENTRY VAL QUALITY S32 CONSTANT -quality # Bad quality flag 227 231 END 228 232 … … 253 257 ENTRY VAL RANGE.YMAX S32 CONSTANT -ymax 254 258 ENTRY VAL ACCEPT BOOL CONSTANT -accept 259 ENTRY VAL QUALITY S32 CONSTANT -quality # Bad quality flag 255 260 END 256 261 … … 279 284 ENTRY VAL NUM_SOURCES S32 SUM -sources 280 285 ENTRY VAL GOOD_PIXEL_FRAC F32 MEAN -good_frac 286 ENTRY VAL QUALITY S32 CONSTANT -quality # Bad quality flag 281 287 END 282 288 … … 301 307 ENTRY VAL NUM_SOURCES S32 SUM -sources 302 308 ENTRY VAL GOOD_PIXEL_FRAC F32 MEAN -good_frac 309 ENTRY VAL QUALITY S32 CONSTANT -quality # Bad quality flag 303 310 END 304 311 -
trunk/ppImage
- Property svn:mergeinfo changed
/branches/pap/ppImage (added) merged: 23580,23597,23607,23647
- Property svn:mergeinfo changed
-
trunk/ppImage/src/ppImage.h
r23411 r23688 40 40 bool doAstromMosaic; // full-mosaic Astrometry 41 41 bool doStats; // call ppStats on the image 42 bool checkCTE; // measure pixel-based variance42 bool checkCTE; // measure pixel-based variance 43 43 44 44 // output files requested … … 88 88 float remnanceThresh; // Threshold for remnance detection 89 89 90 char *normClass; // class to use for per-class normalization90 char *normClass; // class to use for per-class normalization 91 91 } ppImageOptions; 92 92 … … 146 146 bool ppImageRebinChip (pmConfig *config, pmFPAview *view, ppImageOptions *options, char *outName); 147 147 148 bool ppImagePhotom (pmConfig *config, pmFPAview *view);149 bool ppImageAstrom (pmConfig *config);150 bool ppImageAddstar (pmConfig *config);148 bool ppImagePhotom(psMetadata *stats, pmConfig *config, pmFPAview *view); 149 bool ppImageAstrom(pmConfig *config, psMetadata *stats); 150 bool ppImageAddstar(pmConfig *config); 151 151 152 152 // Subtract background from the chip-mosaicked image -
trunk/ppImage/src/ppImageAstrom.c
r16084 r23688 7 7 // this function is mostly equivalent to the top-level of psastro, with some 8 8 // modifications since the data has already been loaded. 9 bool ppImageAstrom (pmConfig *config ) {9 bool ppImageAstrom (pmConfig *config, psMetadata *stats) { 10 10 11 11 bool status; … … 27 27 } 28 28 29 if (!psastroAnalysis (config)) {29 if (!psastroAnalysis(config, stats)) { 30 30 psError (PSASTRO_ERR_UNKNOWN, false, "failure in psastro analysis\n"); 31 31 return false; -
trunk/ppImage/src/ppImageLoop.c
r23411 r23688 13 13 bool ppImageLoop(pmConfig *config, ppImageOptions *options) 14 14 { 15 psMetadata *stats = options->doStats ? psMetadataAlloc() : NULL;// Statistics to output15 psMetadata *stats = NULL; // Statistics to output 16 16 float timeDetrend = 0; // Amount of time spent in detrend 17 17 float timePhot = 0; // Amount of time spent in photometry 18 19 if (options->doStats) { 20 stats = psMetadataAlloc(); 21 psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", 0, "No problems", 0); 22 } 18 23 19 24 bool status; // Status of MD lookup … … 139 144 psTimerStart(TIMER_PHOT); 140 145 if (options->doPhotom) { 141 if (!ppImagePhotom( config, view)) {146 if (!ppImagePhotom(stats, config, view)) { 142 147 ESCAPE("error running photometry."); 143 148 } … … 200 205 // this also performs the psastro file IO 201 206 if (options->doAstromChip || options->doAstromMosaic) { 202 if (!ppImageAstrom(config )) {207 if (!ppImageAstrom(config, stats)) { 203 208 ESCAPE("error running astrometry."); 204 209 } -
trunk/ppImage/src/ppImagePhotom.c
r20410 r23688 6 6 7 7 // In this function, we perform the psphot analysis routine for the chip-mosaicked images 8 bool ppImagePhotom (pmConfig *config, pmFPAview *view) {8 bool ppImagePhotom(psMetadata *stats, pmConfig *config, pmFPAview *view) { 9 9 10 10 bool status; … … 12 12 pmReadout *readout; 13 13 14 psphotInit ();14 psphotInit(); 15 15 16 16 // find or define a pmFPAfile PSPHOT.INPUT … … 37 37 // run the actual photometry analysis 38 38 if (!psphotReadout (config, view)) { 39 psError(psErrorCodeLast(), false, "failure in psphotReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout); 40 return false; 39 // This is likely a data quality issue 40 // XXX Split into multiple cases using error codes? 41 psErrorStackPrint(stderr, "Unable to perform photometry on image"); 42 psWarning("Unable to perform photometry on image --- suspect bad data quality."); 43 if (stats && psMetadataLookupS32(NULL, stats, "QUALITY") == 0) { 44 psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE, 45 "Unable to perform photometry on image", psErrorCodeLast()); 46 } 47 psErrorClear(); 48 psphotFilesActivate(config, false); 41 49 } 42 50 43 // we want to save the MASK as modified by psphot, but not the data or weight44 // free the old mask and replace with a memory copy of the new mask45 pmReadout *oldReadout = pmFPAviewThisReadout(view, input->src);46 pmReadout *newReadout = pmFPAviewThisReadout(view, input->fpa);47 psFree (oldReadout->mask);48 oldReadout->mask = psMemIncrRefCounter(newReadout->mask);51 // we want to save the MASK as modified by psphot, but not the data or weight 52 // free the old mask and replace with a memory copy of the new mask 53 pmReadout *oldReadout = pmFPAviewThisReadout(view, input->src); 54 pmReadout *newReadout = pmFPAviewThisReadout(view, input->fpa); 55 psFree (oldReadout->mask); 56 oldReadout->mask = psMemIncrRefCounter(newReadout->mask); 49 57 } 50 58 } -
trunk/ppStack
- Property svn:mergeinfo changed
/branches/pap/ppStack (added) merged: 23580,23597-23598,23648
- Property svn:mergeinfo changed
-
trunk/ppStack/src/ppStackPhotometry.c
r23462 r23688 69 69 70 70 if (!psphotReadoutKnownSources(config, photView, inSources)) { 71 // Clear the error, so that the output files are written. 72 psError(PS_ERR_UNKNOWN, false, "Unable to perform photometry on stacked image."); 73 psFree(photView); 74 return false; 71 // This is likely a data quality issue 72 // XXX Split into multiple cases using error codes? 73 psErrorStackPrint(stderr, "Unable to perform photometry on image"); 74 psWarning("Unable to perform photometry on image --- suspect bad data quality."); 75 if (options->stats && psMetadataLookupS32(NULL, options->stats, "QUALITY") == 0) { 76 psMetadataAddS32(options->stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE, 77 "Unable to perform photometry on image", psErrorCodeLast()); 78 } 79 psErrorClear(); 80 psphotFilesActivate(config, false); 75 81 } 76 82 -
trunk/ppStack/src/ppStackSetup.c
r23602 r23688 43 43 psFree(resolved); 44 44 options->stats = psMetadataAlloc(); 45 psMetadataAddS32(options->stats, PS_LIST_TAIL, "QUALITY", 0, "No problems", 0); 45 46 } 46 47 -
trunk/ppSub
- Property svn:mergeinfo changed
/branches/pap/ppSub (added) merged: 23580,23597,23599,23672-23674,23684
- Property svn:mergeinfo changed
-
trunk/ppSub/src/Makefile.am
r23229 r23688 19 19 ppSubBackground.c \ 20 20 ppSubCamera.c \ 21 ppSubData.c \ 21 22 ppSubLoop.c \ 22 23 ppSubReadout.c \ -
trunk/ppSub/src/ppSub.h
r23195 r23688 22 22 #define PPSUB_RECIPE "PPSUB" /// Name of the recipe to use 23 23 24 // Output files, for activation/deactivation 25 typedef enum { 26 PPSUB_FILES_IMAGE = 0x01, // Image files 27 PPSUB_FILES_PHOT = 0x02, // Photometry files 28 PPSUB_FILES_ALL = 0xFF, // All files 29 } ppSubFiles; 30 31 /// Data for processing 32 typedef struct { 33 psErrorCode quality; /// Quality code; 0 for no problem 34 psMetadata *stats; /// Statistics 35 } ppSubData; 36 37 /// Constructor 38 ppSubData *ppSubDataAlloc(void); 39 24 40 /// Setup the arguments parsing 25 41 bool ppSubArgumentsSetup(int argc, char *argv[], ///< Command-line arguments … … 41 57 /// Perform PSF-matched image subtraction on the readout 42 58 bool ppSubReadout(pmConfig *config, ///< Configuration 43 p sMetadata *stats, ///< Statistics, for output59 ppSubData *data, ///< Processing data 44 60 const pmFPAview *view ///< View of readout to subtract 45 61 ); … … 53 69 /// looking up the parameters in the recipe and supplying them to the function pmSubtractionMatch() 54 70 bool ppSubMatchPSFs(pmConfig *config, ///< Configuration 71 ppSubData *data, ///< Processing data 55 72 const pmFPAview *view ///< View of active readout 56 73 ); … … 63 80 /// Photometry stage 1: measure the PSF from the minuend image 64 81 bool ppSubMakePSF(pmConfig *config, ///< Configuration 82 ppSubData *data, ///< Processing data 65 83 const pmFPAview *view ///< View of active readout 66 84 ); … … 74 92 /// Photometry stage 2: find and measure sources on the subtracted image 75 93 bool ppSubReadoutPhotometry(pmConfig *config, ///< Configuration 76 p sMetadata *stats, ///< Statistics, for output94 ppSubData *data, ///< Processing data 77 95 const pmFPAview *view ///< View of active readout 78 96 ); … … 80 98 /// Renormalize, update headers and generate JPEGs 81 99 bool ppSubReadoutUpdate(pmConfig *config, ///< Configuration 82 p sMetadata *stats, ///< Statistics for output, or NULL100 ppSubData *data, ///< Processing data 83 101 const pmFPAview *view ///< View of active readout 84 102 ); … … 96 114 void ppSubVersionPrint(void); 97 115 116 /// Mark the data quality as bad and prepare to suspend processing 117 void ppSubDataQuality(pmConfig *config, ///< Configuration 118 ppSubData *data, ///< Processing data 119 psErrorCode error,///< Error code 120 ppSubFiles files ///< Files to deactivate 121 ); 98 122 99 123 // Copy every instance of a single keyword from one metadata to another -
trunk/ppSub/src/ppSubCamera.c
r23449 r23688 285 285 return true; 286 286 } 287 288 -
trunk/ppSub/src/ppSubLoop.c
r23315 r23688 28 28 pmConfigRecipesCull(config, "PPSUB,PPSTATS,PSPHOT,MASKS,JPEG"); 29 29 30 ppSubData *data = ppSubDataAlloc(); // Processing data 31 30 32 bool mdok; // Status of MD lookup 31 33 const char *statsName = psMetadataLookupStr(&mdok, config->arguments, "STATS"); // Filename for statistics 32 psMetadata *stats = NULL; // Container for statistics33 34 FILE *statsFile = NULL; // File stream for statistics 34 35 if (statsName && strlen(statsName) > 0) { … … 38 39 psError(PS_ERR_IO, true, "Unable to open statistics file %s for writing.\n", resolved); 39 40 psFree(resolved); 40 return false; 41 } else { 42 stats = psMetadataAlloc(); 41 goto ERROR; 43 42 } 44 43 psFree(resolved); … … 48 47 if (!input) { 49 48 psError(PS_ERR_UNEXPECTED_NULL, false, "Can't find input data!\n"); 50 return false;49 goto ERROR; 51 50 } 52 51 … … 54 53 if (!reference) { 55 54 psError(PS_ERR_UNEXPECTED_NULL, false, "Can't find reference data!\n"); 56 return false;55 goto ERROR; 57 56 } 58 57 … … 60 59 if (!output) { 61 60 psError(PS_ERR_UNEXPECTED_NULL, false, "Can't find output data!\n"); 62 return false;61 goto ERROR; 63 62 } 64 63 … … 67 66 // Iterate over the FPA hierarchy 68 67 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 69 return false;68 goto ERROR; 70 69 } 71 70 … … 77 76 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "FPA format discrepency between input and reference"); 78 77 psFree(view); 79 return false;78 goto ERROR; 80 79 } 81 80 … … 85 84 86 85 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 87 return false;86 goto ERROR; 88 87 } 89 88 … … 96 95 "FPA format discrepency between input and reference"); 97 96 psFree(view); 98 return false;97 goto ERROR; 99 98 } 100 99 if (!inCell->file_exists) { … … 102 101 } 103 102 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 104 return false;103 goto ERROR; 105 104 } 106 105 … … 108 107 while ((inRO = pmFPAviewNextReadout(view, input->fpa, 1))) { 109 108 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 110 return false;109 goto ERROR; 111 110 } 112 111 pmReadout *refRO = pmFPAviewThisReadout(view, reference->fpa);// Reference readout of interest … … 116 115 "FPA format discrepency between input and reference"); 117 116 psFree(view); 118 return false;117 goto ERROR; 119 118 } 120 119 if (!inRO->data_exists) { … … 123 122 124 123 // Perform the analysis 125 if (!ppSubReadout(config, stats, view)) {124 if (!ppSubReadout(config, data, view)) { 126 125 psError(PS_ERR_UNKNOWN, false, "Unable to subtract images.\n"); 127 return false;126 goto ERROR; 128 127 } 129 128 130 129 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 131 return false;130 goto ERROR; 132 131 } 133 132 } 134 133 135 134 // Perform statistics on the cell 136 if (stats ) {135 if (statsFile) { 137 136 pmFPAfile *output = psMetadataLookupPtr(NULL, config->files, "PPSUB.OUTPUT"); // Output file 138 137 if (!output) { 139 138 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find file PPSUB.OUTPUT.\n"); 140 return false;139 goto ERROR; 141 140 } 142 141 psImageMaskType maskValue = pmConfigMaskGet("MASK.VALUE", config); 143 ppStatsFPA( stats, output->fpa, view, maskValue, config);142 ppStatsFPA(data->stats, output->fpa, view, maskValue, config); 144 143 } 145 144 146 145 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 147 return false;146 goto ERROR; 148 147 } 149 148 } 150 149 151 150 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 152 return false;151 goto ERROR; 153 152 } 154 153 } 155 154 156 155 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 157 return false;156 goto ERROR; 158 157 } 159 158 … … 161 160 162 161 // Write out summary statistics 163 if (stats ) {164 psMetadataAddF32( stats, PS_LIST_TAIL, "TIME_SUB", 0, "Time for subtraction completion",162 if (statsFile) { 163 psMetadataAddF32(data->stats, PS_LIST_TAIL, "TIME_SUB", 0, "Time for subtraction completion", 165 164 psTimerMark("ppSub")); 166 165 167 const char *statsMDC = psMetadataConfigFormat( stats);166 const char *statsMDC = psMetadataConfigFormat(data->stats); 168 167 if (!statsMDC || strlen(statsMDC) == 0) { 169 168 psWarning("Unable to generate statistics MDC file.\n"); … … 173 172 psFree((void *)statsMDC); 174 173 fclose(statsFile); 175 176 psFree(stats);177 174 } 178 175 179 176 psString dump_file = psMetadataLookupStr(&mdok, config->arguments, "-dumpconfig"); 180 177 if (dump_file) { 181 182 178 pmFPAfile *input = psMetadataLookupPtr(NULL, config->files, "PPSUB.INPUT"); // Input file 183 179 pmConfigDump(config, input->fpa, dump_file); 184 180 } 185 181 182 psFree(data); 186 183 return true; 184 185 ERROR: 186 psFree(data); 187 return false; 187 188 } -
trunk/ppSub/src/ppSubMakePSF.c
r23235 r23688 22 22 #include "ppSub.h" 23 23 24 bool ppSubMakePSF(pmConfig *config, const pmFPAview *view)24 bool ppSubMakePSF(pmConfig *config, ppSubData *data, const pmFPAview *view) 25 25 { 26 26 psAssert(config, "Require configuration"); … … 83 83 psArray *sources = psMetadataLookupPtr(&mdok, minuend->analysis, "PSPHOT.SOURCES"); 84 84 if (!psphotReadoutFindPSF(config, view, sources)) { 85 psError(PS_ERR_UNKNOWN, false, "Unable to perform photometry on subtracted image."); 86 return false; 85 // This is likely a data quality issue 86 // XXX Split into multiple cases using error codes? 87 psErrorStackPrint(stderr, "Unable to determine PSF"); 88 psWarning("Unable to determine PSF --- suspect bad data quality."); 89 ppSubDataQuality(config, data, PSPHOT_ERR_PSF, PPSUB_FILES_PHOT); 90 return true; 87 91 } 88 92 … … 98 102 return true; 99 103 } 100 101 // XXX we used to need this, is it still needed?102 103 // pmCell *photCell = pmFPAfileThisCell(config->files, view, "PSPHOT.INPUT");104 // pmCellFreeReadouts(photCell);105 106 // if (!pmFPAfileDropInternal(config->files, "PSPHOT.BACKMDL") ||107 // !pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL.STDEV") ||108 // !pmFPAfileDropInternal (config->files, "PSPHOT.BACKGND")) {109 // psError(PS_ERR_UNKNOWN, false, "Unable to drop PSPHOT internal files.");110 // return false;111 // }112 113 // Blow away the sources psphot found --- they're irrelevant for the subtraction114 // XXX is this still needed? These are now probably not being set115 // pmReadout *photRO = pmFPAviewThisReadout(view, photFile->fpa); // Readout with sources116 // psMetadataRemoveKey(photRO->analysis, "PSPHOT.SOURCES");117 // psMetadataRemoveKey(photRO->analysis, "PSPHOT.HEADER");118 -
trunk/ppSub/src/ppSubMatchPSFs.c
r23505 r23688 22 22 #include "ppSub.h" 23 23 24 bool ppSubMatchPSFs(pmConfig *config, const pmFPAview *view)24 bool ppSubMatchPSFs(pmConfig *config, ppSubData *data, const pmFPAview *view) 25 25 { 26 26 psAssert(config, "Require configuration"); … … 136 136 137 137 // Match the PSFs 138 bool success = false; // Operation was successful? 138 139 if (kernelRO) { 139 if (!pmSubtractionMatchPrecalc(inConv, refConv, inRO, refRO, kernelRO->analysis, 140 stride, sys, maskVal, maskBad, maskPoor, poorFrac, badFrac)) { 141 psError(PS_ERR_UNKNOWN, false, "Unable to convolve images."); 142 return false; 143 } 140 success = pmSubtractionMatchPrecalc(inConv, refConv, inRO, refRO, kernelRO->analysis, 141 stride, sys, maskVal, maskBad, maskPoor, poorFrac, badFrac); 144 142 } else { 145 if (!pmSubtractionMatch(inConv, refConv, inRO, refRO, footprint, stride, regionSize, spacing, 146 threshold, sources, stampsName, type, size, order, widths, orders, inner, 147 ringsOrder, binning, penalty, optimum, optWidths, optOrder, optThresh, iter, 148 rej, sys, maskVal, maskBad, maskPoor, poorFrac, badFrac, subMode)) { 143 success = pmSubtractionMatch(inConv, refConv, inRO, refRO, footprint, stride, regionSize, 144 spacing, threshold, sources, stampsName, type, size, order, 145 widths, orders, inner, ringsOrder, binning, penalty, optimum, 146 optWidths, optOrder, optThresh, iter, rej, sys, maskVal, 147 maskBad, maskPoor, poorFrac, badFrac, subMode); 148 } 149 150 psFree(optWidths); 151 pmSubtractionThreadsFinalize(inRO, refRO); 152 153 if (!success) { 154 psErrorCode error = psErrorCodeLast(); // Error code 155 if (error == PM_ERR_STAMPS) { 156 psErrorStackPrint(stderr, "Unable to find stamps"); 157 psWarning("Unable to find stamps --- suspect bad data quality."); 158 ppSubDataQuality(config, data, error, PPSUB_FILES_ALL); 159 return true; 160 } else { 149 161 psError(PS_ERR_UNKNOWN, false, "Unable to match images."); 150 162 return false; … … 152 164 } 153 165 154 psFree(optWidths);155 156 pmSubtractionThreadsFinalize(inRO, refRO);157 158 166 psImageCovarianceTransfer(inConv->variance, inConv->covariance); 159 167 psImageCovarianceTransfer(refConv->variance, refConv->covariance); 160 168 161 // XXX drop the pixels associated with inRO and refRO (now that we have inConv and refConf)162 #ifdef TESTING163 psphotSaveImage (NULL, inRO->image, "inRO.fits");164 psphotSaveImage (NULL, refRO->image, "refRO.fits");165 psphotSaveImage (NULL, inConv->image, "inConv.fits");166 psphotSaveImage (NULL, refConv->image, "refConv.fits");167 #endif168 169 169 return true; 170 170 } -
trunk/ppSub/src/ppSubReadout.c
r21524 r23688 21 21 #include "ppSub.h" 22 22 23 bool ppSubReadout(pmConfig *config, p sMetadata *stats, const pmFPAview *view)23 bool ppSubReadout(pmConfig *config, ppSubData *data, const pmFPAview *view) 24 24 { 25 25 psTimerStart("PPSUB_MATCH"); … … 30 30 } 31 31 32 if (!ppSubMatchPSFs(config, view)) {32 if (!ppSubMatchPSFs(config, data, view)) { 33 33 psError(PS_ERR_UNKNOWN, false, "Unable to match PSFs."); 34 34 return false; 35 } else if (data->quality) { 36 // Can't do anything at all 37 return true; 35 38 } 36 39 … … 40 43 } 41 44 42 if (! ppSubMakePSF(config, view)) {45 if (!data->quality && !ppSubMakePSF(config, data, view)) { 43 46 psError(PS_ERR_UNKNOWN, false, "Unable to generate PSF."); 44 47 return false; … … 56 59 } 57 60 58 if (! ppSubReadoutPhotometry(config, stats, view)) {61 if (!data->quality && !ppSubReadoutPhotometry(config, data, view)) { 59 62 psError(PS_ERR_UNKNOWN, false, "Unable to perform photometry."); 60 63 return false; 61 64 } 62 65 63 if (!ppSubReadoutUpdate(config, stats, view)) {66 if (!ppSubReadoutUpdate(config, data, view)) { 64 67 psError(PS_ERR_UNKNOWN, false, "Unable to update."); 65 68 return false; -
trunk/ppSub/src/ppSubReadoutPhotometry.c
r21524 r23688 22 22 #include "ppSub.h" 23 23 24 bool ppSubReadoutPhotometry (pmConfig *config, p sMetadata *stats, const pmFPAview *view)24 bool ppSubReadoutPhotometry (pmConfig *config, ppSubData *data, const pmFPAview *view) 25 25 { 26 26 psAssert(config, "Require configuration"); … … 45 45 pmPSF *psf = psMetadataLookupPtr(NULL, psfInputChip->analysis, "PSPHOT.PSF"); // PSF for photometry 46 46 if (!psf) { 47 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find PSF from psphot"); 48 return false; 47 psErrorStackPrint(stderr, "No PSF available"); 48 psWarning("No PSF available --- suspect bad data quality."); 49 ppSubDataQuality(config, data, psErrorCodeLast(), PPSUB_FILES_PHOT); 50 return true; 49 51 } 50 52 psMetadataAddPtr(psfLoadChip->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_DATA_UNKNOWN | PS_META_REPLACE, … … 80 82 } 81 83 82 #if 0 83 psMetadataAddPtr(config->files, PS_LIST_TAIL, "PSPHOT.INPUT", PS_DATA_UNKNOWN | PS_META_REPLACE, 84 "psphot input: view on another pmFPAfile", photFile); 85 #endif 84 if (!psphotReadoutMinimal(config, view)) { 85 // This is likely a data quality issue 86 // XXX Split into multiple cases using error codes? 87 psErrorStackPrint(stderr, "Unable to perform photometry on image"); 88 psWarning("Unable to perform photometry on image --- suspect bad data quality."); 89 ppSubDataQuality(config, data, psErrorCodeLast(), PPSUB_FILES_PHOT); 90 } 86 91 87 if (!psphotReadoutMinimal(config, view)) {88 psWarning("Unable to perform photometry on subtracted image.");89 psErrorStackPrint(stderr, "Error stack from photometry:");90 psErrorClear();91 }92 #if 193 92 photRO->data_exists = true; 94 93 photRO->parent->data_exists = true; 95 94 photRO->parent->parent->data_exists = true; 96 #endif97 95 98 if ( stats) {96 if (data->stats) { 99 97 psArray *sources = psMetadataLookupPtr(NULL, photRO->analysis, "PSPHOT.SOURCES"); // Sources 100 psMetadataAddS32( stats, PS_LIST_TAIL, "NUM_SOURCES", 0, "Number of sources detected",98 psMetadataAddS32(data->stats, PS_LIST_TAIL, "NUM_SOURCES", 0, "Number of sources detected", 101 99 sources ? sources->n : 0); 102 psMetadataAddF32( stats, PS_LIST_TAIL, "TIME_PHOT", 0, "Time to do photometry",100 psMetadataAddF32(data->stats, PS_LIST_TAIL, "TIME_PHOT", 0, "Time to do photometry", 103 101 psTimerClear("PPSUB_PHOT")); 104 102 } -
trunk/ppSub/src/ppSubReadoutUpdate.c
r23173 r23688 21 21 #include "ppSub.h" 22 22 23 bool ppSubReadoutUpdate(pmConfig *config, p sMetadata *stats, const pmFPAview *view)23 bool ppSubReadoutUpdate(pmConfig *config, ppSubData *data, const pmFPAview *view) 24 24 { 25 25 psAssert(config, "Require configuration"); … … 47 47 48 48 // Statistics on the matching 49 if ( stats) {50 psMetadataCopySingle( stats, outRO->analysis, PM_SUBTRACTION_ANALYSIS_MODE);51 psMetadataCopySingle( stats, outRO->analysis, PM_SUBTRACTION_ANALYSIS_STAMPS);52 psMetadataCopySingle( stats, outRO->analysis, PM_SUBTRACTION_ANALYSIS_DEV_MEAN);53 psMetadataCopySingle( stats, outRO->analysis, PM_SUBTRACTION_ANALYSIS_DEV_RMS);54 psMetadataCopySingle( stats, outRO->analysis, PM_SUBTRACTION_ANALYSIS_NORM);55 psMetadataCopySingle( stats, outRO->analysis, PM_SUBTRACTION_ANALYSIS_BGDIFF);56 psMetadataCopySingle( stats, outRO->analysis, PM_SUBTRACTION_ANALYSIS_MX);57 psMetadataCopySingle( stats, outRO->analysis, PM_SUBTRACTION_ANALYSIS_MY);58 psMetadataCopySingle( stats, outRO->analysis, PM_SUBTRACTION_ANALYSIS_MXX);59 psMetadataCopySingle( stats, outRO->analysis, PM_SUBTRACTION_ANALYSIS_MXY);60 psMetadataCopySingle( stats, outRO->analysis, PM_SUBTRACTION_ANALYSIS_MYY);49 if (data->stats) { 50 psMetadataCopySingle(data->stats, outRO->analysis, PM_SUBTRACTION_ANALYSIS_MODE); 51 psMetadataCopySingle(data->stats, outRO->analysis, PM_SUBTRACTION_ANALYSIS_STAMPS); 52 psMetadataCopySingle(data->stats, outRO->analysis, PM_SUBTRACTION_ANALYSIS_DEV_MEAN); 53 psMetadataCopySingle(data->stats, outRO->analysis, PM_SUBTRACTION_ANALYSIS_DEV_RMS); 54 psMetadataCopySingle(data->stats, outRO->analysis, PM_SUBTRACTION_ANALYSIS_NORM); 55 psMetadataCopySingle(data->stats, outRO->analysis, PM_SUBTRACTION_ANALYSIS_BGDIFF); 56 psMetadataCopySingle(data->stats, outRO->analysis, PM_SUBTRACTION_ANALYSIS_MX); 57 psMetadataCopySingle(data->stats, outRO->analysis, PM_SUBTRACTION_ANALYSIS_MY); 58 psMetadataCopySingle(data->stats, outRO->analysis, PM_SUBTRACTION_ANALYSIS_MXX); 59 psMetadataCopySingle(data->stats, outRO->analysis, PM_SUBTRACTION_ANALYSIS_MXY); 60 psMetadataCopySingle(data->stats, outRO->analysis, PM_SUBTRACTION_ANALYSIS_MYY); 61 61 62 psMetadataAddF32( stats, PS_LIST_TAIL, "TIME_MATCH", 0, "Time to match PSFs",62 psMetadataAddF32(data->stats, PS_LIST_TAIL, "TIME_MATCH", 0, "Time to match PSFs", 63 63 psTimerClear("PPSUB_MATCH")); 64 64 } -
trunk/psModules
- Property svn:mergeinfo changed
/branches/pap/psModules (added) merged: 23578-23579,23620,23656
- Property svn:mergeinfo changed
-
trunk/psModules/src/config/pmConfigRecipes.c
r23286 r23688 81 81 psTrace ("psModules.config", 3, "read recipes from camera config"); 82 82 } else { 83 ps LogMsg("psModules.config", PS_LOG_DETAIL, "no recipe supplied by camera config");83 psTrace ("psModules.config", PS_LOG_DETAIL, "no recipe supplied by camera config"); 84 84 } 85 85 } … … 97 97 psTrace ("psModules.config", 3, "read recipes from symbolic references"); 98 98 } else { 99 ps LogMsg("psModules.config", PS_LOG_DETAIL, "no recipe supplied by symbolic reference");99 psTrace ("psModules.config", PS_LOG_DETAIL, "no recipe supplied by symbolic reference"); 100 100 } 101 101 … … 105 105 return false; 106 106 } 107 ps LogMsg("psModules.config", PS_LOG_DETAIL, "merged camera recipes with system recipes");107 psTrace ("psModules.config", PS_LOG_DETAIL, "merged camera recipes with system recipes"); 108 108 109 109 // load recipe-files specified on the command line … … 115 115 psTrace ("psModules.config", 3, "read recipes from command-line arguments"); 116 116 } else { 117 ps LogMsg("psModules.config", PS_LOG_DETAIL, "no recipe supplied on command-line arguments");117 psTrace ("psModules.config", PS_LOG_DETAIL, "no recipe supplied on command-line arguments"); 118 118 } 119 119 … … 126 126 psTrace ("psModules.config", 3, "read recipes from symbolic references"); 127 127 } else { 128 ps LogMsg("psModules.config", PS_LOG_DETAIL, "no recipe supplied by symbolic reference");128 psTrace ("psModules.config", PS_LOG_DETAIL, "no recipe supplied by symbolic reference"); 129 129 } 130 130 … … 137 137 psTrace ("psModules.config", 3, "read recipes from command-line arguments"); 138 138 } else { 139 ps LogMsg("psModules.config", PS_LOG_DETAIL, "no recipe supplied on command-line arguments");139 psTrace ("psModules.config", PS_LOG_DETAIL, "no recipe supplied on command-line arguments"); 140 140 } 141 141 } … … 348 348 psFree(recipesIter); 349 349 return false; 350 }350 } 351 351 } 352 352 psFree(recipesIter); -
trunk/psModules/src/config/pmErrorCodes.dat
r13654 r23688 11 11 OBJECTS Problem in objects 12 12 SKY Problem in sky 13 STAMPS Unable to select stamps for PSF-matching 13 14 # these errors correspond to standard exit conditions 14 15 ARGUMENTS Incorrect arguments -
trunk/psModules/src/imcombine/pmSubtractionMatch.c
r23308 r23688 18 18 #include "pmSubtractionMask.h" 19 19 #include "pmSubtractionThreads.h" 20 #include "pmSubtractionVisual.h" 21 #include "pmErrorCodes.h" 22 20 23 #include "pmSubtractionMatch.h" 21 #include "pmSubtractionVisual.h"22 24 23 25 #define BG_STAT PS_STAT_ROBUST_MEDIAN // Statistic to use for background … … 73 75 stampSpacing, mode); 74 76 if (!*stamps) { 75 psError( PS_ERR_UNKNOWN, false, "Unable to find stamps.");77 psError(psErrorCodeLast(), false, "Unable to find stamps."); 76 78 return false; 77 79 } -
trunk/psModules/src/imcombine/pmSubtractionStamps.c
r21363 r23688 20 20 #include "pmModel.h" 21 21 #include "pmSource.h" 22 22 #include "pmErrorCodes.h" 23 23 24 24 #include "pmSubtraction.h" … … 355 355 if (numGood == 0 && numFound == 0) { 356 356 // No good stamps 357 psError(PM_ERR_STAMPS, true, "Unable to find suitable stamps"); 357 358 psFree(stamps); 358 359 return NULL; -
trunk/psastro
- Property svn:mergeinfo changed
/branches/pap/psastro (added) merged: 23638,23641
- Property svn:mergeinfo changed
-
trunk/psastro/src/psastro.c
r23195 r23688 13 13 # include "psastroStandAlone.h" 14 14 15 static void usage (void) {16 fprintf (stderr, "USAGE: psastro [-file image(s)] [-list imagelist] (output)\n");17 exit (2);15 static void usage(void) { 16 fprintf(stderr, "USAGE: psastro [-file image(s)] [-list imagelist] (output)\n"); 17 exit(PS_EXIT_CONFIG_ERROR); 18 18 } 19 19 20 int main (int argc, char **argv) { 21 22 pmConfig *config = NULL; 23 20 int main (int argc, char **argv) 21 { 24 22 psTimerStart ("complete"); 25 23 … … 28 26 // model inits are needed in pmSourceIO 29 27 // models defined in psphot/src/models are not available in psastro 30 pmModelClassInit ();28 pmModelClassInit(); 31 29 32 30 // load configuration information 33 config = psastroArguments (argc, argv); 34 if (!config) usage (); 31 pmConfig *config = config = psastroArguments(argc, argv); 32 if (!config) { 33 usage(); 34 } 35 35 36 36 psastroVersionPrint(); … … 39 39 if (!psastroParseCamera (config)) { 40 40 psErrorStackPrint(stderr, "error setting up the camera\n"); 41 exit (1); 41 psFree(config); 42 exit(PS_EXIT_CONFIG_ERROR); 42 43 } 43 44 … … 46 47 if (!psastroDataLoad (config)) { 47 48 psErrorStackPrint(stderr, "error loading input data\n"); 48 exit (1); 49 psFree(config); 50 exit(PS_EXIT_DATA_ERROR); 49 51 } 50 52 53 psMetadata *stats = psMetadataAlloc(); // Statistics, for output 54 psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", 0, "No problems", 0); 55 51 56 // run the full astrometry analysis (chip and/or mosaic) 52 if (!psastroAnalysis (config)) {57 if (!psastroAnalysis(config, stats)) { 53 58 psErrorStackPrint(stderr, "failure in psastro analysis\n"); 54 exit (1); 59 psFree(config); 60 psFree(stats); 61 exit(PS_EXIT_SYS_ERROR); 55 62 } 56 63 57 64 // write out the results 58 if (!psastroDataSave (config)) {65 if (!psastroDataSave(config, stats)) { 59 66 psErrorStackPrint(stderr, "failed to write out data\n"); 60 exit (1); 67 psFree(config); 68 psFree(stats); 69 exit(PS_EXIT_DATA_ERROR); 61 70 } 62 71 63 psLogMsg ("psastro", 3, "complete psastro run: %f sec\n", psTimerMark ("complete"));72 psLogMsg("psastro", 3, "complete psastro run: %f sec\n", psTimerMark ("complete")); 64 73 65 psastroCleanup (config);66 exit (EXIT_SUCCESS);74 psastroCleanup(config); 75 exit(PS_EXIT_SUCCESS); 67 76 } -
trunk/psastro/src/psastro.h
r23668 r23688 46 46 #endif 47 47 48 bool psastroDataSave (pmConfig *config );48 bool psastroDataSave (pmConfig *config, psMetadata *stats); 49 49 bool psastroDefineFiles (pmConfig *config, pmFPAfile *input); 50 50 bool psastroDefineFile (pmConfig *config, pmFPA *input, char *filerule, char *argname, pmFPAfileType fileType, pmDetrendType detrendType); 51 bool psastroAnalysis (pmConfig *config );51 bool psastroAnalysis (pmConfig *config, psMetadata *stats); 52 52 53 53 bool psastroConvertFPA (pmFPA *fpa, psMetadata *recipe); … … 125 125 bool psastroAstromGuessSetChip (pmFPA *fpa, pmChip *chip, const pmFPAview *view, double pixelScale, bool bilevelAstrometry); 126 126 bool psastroAstromGuessSetFPA (pmFPA *fpa, bool *bilevelAstrometry); 127 bool psastroMetadataStats (pmConfig *config );127 bool psastroMetadataStats (pmConfig *config, psMetadata *stats); 128 128 129 129 bool psastroZeroPoint (pmConfig *config); -
trunk/psastro/src/psastroAnalysis.c
r23412 r23688 1 1 /** @file psastroAnalysis.c 2 2 * 3 * @brief 3 * @brief 4 4 * 5 5 * @ingroup libpsastro … … 13 13 # include "psastroInternal.h" 14 14 15 bool psastroAnalysis (pmConfig *config) { 15 /// Turn save on/off for a file 16 static void fileSave(pmConfig *config, // Configuration 17 const char *name, // Name of file 18 bool save // Save file? 19 ) 20 { 21 pmFPAfile *file = pmFPAfileSelectSingle(config->files, name, 0); // File of interest 22 if (!file) { 23 psErrorClear(); 24 return; 25 } 26 file->save = save; 27 return; 28 } 29 30 31 bool psastroAnalysis (pmConfig *config, psMetadata *stats) { 16 32 17 33 bool status; … … 40 56 } 41 57 if (nStars == 0) { 42 psLogMsg ("psastro", 2, "skipping astrometry analysis : no stars\n"); 43 return false; 58 // This is likely a data quality issue 59 psWarning("No stars for astrometry analysis --- suspect bad data quality"); 60 if (stats && psMetadataLookupS32(NULL, stats, "QUALITY") == 0) { 61 psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE, 62 "No stars for astrometry", PSASTRO_ERR_DATA); 63 } 64 fileSave(config, "PSASTRO.OUTPUT", false); 65 fileSave(config, "PSASTRO.OUTPUT.MASK", false); 66 fileSave(config, "PSASTRO.OUT.REFSTARS", false); 67 psErrorClear(); 68 return true; 44 69 } 45 70 -
trunk/psastro/src/psastroDataSave.c
r23169 r23688 22 22 * this loop saves the photometry/astrometry data files 23 23 */ 24 bool psastroDataSave (pmConfig *config ) {24 bool psastroDataSave (pmConfig *config, psMetadata *stats) { 25 25 26 26 pmChip *chip; … … 84 84 85 85 // Write out summary statistics 86 if (!psastroMetadataStats (config )) ESCAPE;86 if (!psastroMetadataStats (config, stats)) ESCAPE; 87 87 88 88 // activate all files except PSASTRO.OUTPUT -
trunk/psastro/src/psastroMetadataStats.c
r21409 r23688 13 13 # include "psastroInternal.h" 14 14 15 bool psastroMetadataStats (pmConfig *config ) {15 bool psastroMetadataStats (pmConfig *config, psMetadata *stats) { 16 16 17 17 bool status; … … 24 24 25 25 if (!output) { 26 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find output file (PSASTRO.OUTPUT).");27 return false;26 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find output file (PSASTRO.OUTPUT)."); 27 return false; 28 28 } 29 29 30 // create output stats metadata 31 psMetadata *stats = psMetadataAlloc (); 32 33 // extract stats for the complete fpa 30 // extract stats for the complete fpa 34 31 pmFPAview *view = pmFPAviewAlloc(0); 35 32 36 33 if (!ppStatsMetadata(stats, output->fpa, view, 0, config)) { 37 psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to generate stats for image.");38 psFree(view);39 psFree(stats);40 return false;34 psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to generate stats for image."); 35 psFree(view); 36 psFree(stats); 37 return false; 41 38 } 42 39 43 40 // if we did not request any specific stats, the structure is empty 44 41 if (stats && stats->list->n == 0) { 45 psWarning ("stats output specified, but no requested stats entries in headers");46 psFree(view);47 psFree(stats);48 return true;42 psWarning ("stats output specified, but no requested stats entries in headers"); 43 psFree(view); 44 psFree(stats); 45 return true; 49 46 } 50 47 … … 52 49 char *statsMDC = psMetadataConfigFormat(stats); 53 50 if (!statsMDC || strlen(statsMDC) == 0) { 54 psError(PS_ERR_IO, false, "Unable to serialize stats metadata.\n");55 return false;56 } 51 psError(PS_ERR_IO, false, "Unable to serialize stats metadata.\n"); 52 return false; 53 } 57 54 58 55 // convert to a real UNIX filename … … 60 57 FILE *statsFile = fopen (resolved, "w"); 61 58 if (!statsFile) { 62 psError(PS_ERR_IO, true, "Unable to open statistics file %s for writing.\n", resolved);63 psFree(stats);64 psFree(view);65 psFree(statsMDC);66 psFree(resolved);67 return false;59 psError(PS_ERR_IO, true, "Unable to open statistics file %s for writing.\n", resolved); 60 psFree(stats); 61 psFree(view); 62 psFree(statsMDC); 63 psFree(resolved); 64 return false; 68 65 } 69 66 -
trunk/psconfig
- Property svn:mergeinfo changed (with no actual effect on merging)
-
trunk/psphot
- Property svn:mergeinfo changed
/branches/pap/psphot (added) merged: 23580,23596,23646
- Property svn:mergeinfo changed
-
trunk/psphot/src/psphot.h
r23492 r23688 31 31 bool psphotReadoutCleanup (pmConfig *config, pmReadout *readout, psMetadata *recipe, pmDetections *detections, pmPSF *psf, psArray *sources); 32 32 bool psphotDefineFiles (pmConfig *config, pmFPAfile *input); 33 void psphotFilesActivate(pmConfig *config, bool state); 34 33 35 bool psphotSetMaskBits (pmConfig *config); 34 36 bool psphotSetMaskRecipe (pmConfig *config, psImageMaskType maskValue, psImageMaskType markValue); -
trunk/psphot/src/psphotDefineFiles.c
r14892 r23688 1 1 # include "psphotInternal.h" 2 3 // List of output files 4 static const char *outputFiles[] = { "PSPHOT.OUTPUT", "PSPHOT.RESID", "PSPHOT.BACKMDL", 5 "PSPHOT.BACKMDL.STDEV", "PSPHOT.BACKGND", "PSPHOT.BACKSUB", 6 "PSPHOT.PSF.SAVE", "SOURCE.PLOT.MOMENTS", "SOURCE.PLOT.PSFMODEL", 7 "SOURCE.PLOT.APRESID", NULL }; 2 8 3 9 // XXX we need to be able to distinguish several cases: … … 133 139 return true; 134 140 } 141 142 void psphotFilesActivate(pmConfig *config, bool state) 143 { 144 for (int i = 0; outputFiles[i]; i++) { 145 if (!pmFPAfileActivate(config->files, state, outputFiles[i])) { 146 psErrorClear(); 147 } 148 } 149 150 return; 151 } -
trunk/psphot/src/psphotMaskReadout.c
r23535 r23688 39 39 psImage *mk = readout->mask; 40 40 for (int j = 0; j < im->numRows; j++) { 41 for (int i = 0; i < im->numCols; i++) {42 if (isfinite(im->data.F32[j][i]) && isfinite(wt->data.F32[j][i])) continue;43 mk->data.PS_TYPE_IMAGE_MASK_DATA[j][i] |= maskBad;44 }41 for (int i = 0; i < im->numCols; i++) { 42 if (isfinite(im->data.F32[j][i]) && isfinite(wt->data.F32[j][i])) continue; 43 mk->data.PS_TYPE_IMAGE_MASK_DATA[j][i] |= maskBad; 44 } 45 45 } 46 46 } -
trunk/pswarp/src/Makefile.am
r23170 r23688 24 24 pswarpMatchRange.c \ 25 25 pswarpParseCamera.c \ 26 pswarpPixel Fraction.c \26 pswarpPixelsLit.c \ 27 27 pswarpSetMaskBits.c \ 28 28 pswarpSetThreads.c \ -
trunk/pswarp/src/pswarp.h
r23487 r23688 102 102 const char *filename, const char *argname); 103 103 104 /// Check to see if the readout has a minimum fraction of "lit"pixels105 bool pswarpPixel Fraction(const pmReadout *readout, ///< Readout to inspect106 psMetadata *stats, ///< Statistics to update with the result107 const pmConfig *config ///< Configuration104 /// Get the range of lit pixels 105 bool pswarpPixelsLit(const pmReadout *readout, ///< Readout to inspect 106 psMetadata *stats, ///< Statistics to update with the result 107 const pmConfig *config ///< Configuration 108 108 ); 109 109 -
trunk/pswarp/src/pswarpArguments.c
r23314 r23688 163 163 } 164 164 165 float acceptFrac = psMetadataLookupF32(&status, recipe, "ACCEPT.FRAC"); ///< Min fraction of good pixels166 if (!status) {167 acceptFrac = 0.0;168 psWarning("ACCEPT.FRAC is not set in the %s recipe --- defaulting to %f.", PSWARP_RECIPE, poorFrac);169 }170 171 165 // Set recipe values in the recipe (since we've possibly altered some) 172 166 psMetadataAddS32(recipe, PS_LIST_TAIL, "GRID.NX", PS_META_REPLACE, … … 180 174 psMetadataAddF32(recipe, PS_LIST_TAIL, "POOR.FRAC", PS_META_REPLACE, 181 175 "Fraction of bad flux for a pixel to be marked as poor", poorFrac); 182 psMetadataAddF32(recipe, PS_LIST_TAIL, "ACCEPT.FRAC", PS_META_REPLACE,183 "Minimum fraction of good pixels for result to be accepted", acceptFrac);184 176 185 177 // Set recipe values in the arguments … … 194 186 psMetadataAddF32(config->arguments, PS_LIST_TAIL, "POOR.FRAC", 0, 195 187 "Fraction of bad flux for a pixel to be marked as poor", poorFrac); 196 psMetadataAddF32(config->arguments, PS_LIST_TAIL, "ACCEPT.FRAC", 0,197 "Minimum fraction of good pixels for result to be accepted", acceptFrac);198 188 199 189 psTrace("pswarp", 1, "Done with pswarpArguments...\n"); -
trunk/pswarp/src/pswarpErrorCodes.dat
r11268 r23688 9 9 IO Problem in FITS I/O 10 10 DATA Problem in data values 11 NO_OVERLAP No overlap between input and skycell -
trunk/pswarp/src/pswarpLoop.c
r23629 r23688 142 142 psFree(resolved); 143 143 stats = psMetadataAlloc(); 144 psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", 0, "No problems", 0); 144 145 } 145 146 … … 273 274 } 274 275 276 if (!output->data_exists) { 277 psWarning("No overlap between input and skycell."); 278 if (stats) { 279 psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE, 280 "No overlap between input and skycell", PSWARP_ERR_NO_OVERLAP); 281 } 282 psphotFilesActivate(config, false); 283 psFree(cells); 284 psFree(view); 285 return true; 286 } 287 275 288 pmCell *outCell = output->parent; ///< Output cell 276 289 pmChip *outChip = outCell->parent; ///< Output chip 277 290 pmFPA *outFPA = outChip->parent; ///< Output FP 278 291 279 if (!pswarpPixelFraction(output, stats, config)) { 280 // Don't write output images, and don't bother about anything else 281 output->data_exists = outCell->data_exists = outChip->data_exists = false; 292 if (!pswarpPixelsLit(output, stats, config)) { 293 psError(PS_ERR_UNKNOWN, false, "Unable to calculate pixel regions."); 282 294 psFree(cells); 283 295 psFree(view); 284 goto COMPLETED;296 return false; 285 297 } 286 298 … … 363 375 fileActivation(config, independentFiles, false); 364 376 365 // We need a new PSF model for the warped frame. It would be good to generate this analytically, but that's going to be tricky.366 // We have a list of sources, so we use those to redetermine the PSF model.377 // We need a new PSF model for the warped frame. It would be good to generate this analytically, but 378 // that's going to be tricky. We have a list of sources, so we use those to redetermine the PSF model. 367 379 368 380 if (psMetadataLookupBool(&mdok, config->arguments, "PSF")) { … … 393 405 // measure the PSF using these sources 394 406 if (!psphotReadoutFindPSF(config, view, sources)) { 395 psError(PS_ERR_UNKNOWN, false, "Unable to determine PSF for warped image."); 396 return false; 407 // This is likely a data quality issue 408 // XXX Split into multiple cases using error codes? 409 psErrorStackPrint(stderr, "Unable to determine PSF"); 410 psWarning("Unable to determine PSF --- suspect bad data quality."); 411 if (stats && psMetadataLookupS32(NULL, stats, "QUALITY") == 0) { 412 psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE, 413 "Unable to determine PSF", psErrorCodeLast()); 414 } 415 psErrorClear(); 416 psphotFilesActivate(config, false); 397 417 } 398 418 … … 447 467 // Now done with the skycell side of things 448 468 449 COMPLETED:450 469 // Write out summary statistics 451 470 if (stats) {
Note:
See TracChangeset
for help on using the changeset viewer.
