Changeset 14023
- Timestamp:
- Jul 5, 2007, 3:16:08 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 56 edited
-
dbconfig/chip.md (modified) (2 diffs)
-
dbconfig/det.md (modified) (5 diffs)
-
dbconfig/guide.md (modified) (1 diff)
-
dbconfig/magic.md (modified) (7 diffs)
-
dbconfig/skycell.md (modified) (2 diffs)
-
dbconfig/tasks.md (modified) (11 diffs)
-
dbconfig/warp.md (modified) (2 diffs)
-
ippTools/scripts/regtest.sh (modified) (1 diff)
-
ippTools/share/Makefile.am (modified) (1 diff)
-
ippTools/share/camtool_find_pendingexp.sql (modified) (2 diffs)
-
ippTools/share/camtool_find_pendingimfile.sql (modified) (3 diffs)
-
ippTools/share/camtool_find_processedexp.sql (modified) (2 diffs)
-
ippTools/share/chiptool_completely_processed_exp.sql (modified) (2 diffs)
-
ippTools/share/chiptool_find_rawexp.sql (modified) (1 diff)
-
ippTools/share/chiptool_pendingimfile.sql (modified) (3 diffs)
-
ippTools/share/chiptool_processedimfile.sql (modified) (2 diffs)
-
ippTools/share/chiptool_queuerawimfile.sql (modified) (1 diff)
-
ippTools/share/dettool_find_completed_runs.sql (modified) (3 diffs)
-
ippTools/share/difftool_inputskyfile.sql (modified) (1 diff)
-
ippTools/share/regtool_find_unprocessed_exp.sql (modified) (1 diff)
-
ippTools/share/regtool_find_unprocessed_imfile.sql (deleted)
-
ippTools/share/regtool_pendingexp.sql (modified) (1 diff)
-
ippTools/share/regtool_pendingimfile.sql (modified) (1 diff)
-
ippTools/share/regtool_processedexp.sql (modified) ( previous)
-
ippTools/share/regtool_processedimfile.sql (modified) (1 diff)
-
ippTools/share/stacktool_inputskyfile.sql (modified) (1 diff)
-
ippTools/share/warptool_imfile.sql (modified) (1 diff)
-
ippTools/share/warptool_tooverlap.sql (modified) (1 diff)
-
ippTools/share/warptool_towarped.sql (modified) (1 diff)
-
ippTools/src/camtool.c (modified) (1 diff)
-
ippTools/src/camtoolConfig.c (modified) (1 diff)
-
ippTools/src/chiptool.c (modified) (6 diffs)
-
ippTools/src/chiptoolConfig.c (modified) (7 diffs)
-
ippTools/src/detselectConfig.c (modified) (1 diff)
-
ippTools/src/dettool.c (modified) (101 diffs)
-
ippTools/src/dettoolConfig.c (modified) (15 diffs)
-
ippTools/src/guidetool.c (modified) (1 diff)
-
ippTools/src/guidetoolConfig.c (modified) (3 diffs)
-
ippTools/src/pxcam.c (modified) (1 diff)
-
ippTools/src/pxchip.c (modified) (3 diffs)
-
ippTools/src/pxchip.h (modified) (1 diff)
-
ippTools/src/pxinject.c (modified) (8 diffs)
-
ippTools/src/pxinjectConfig.c (modified) (4 diffs)
-
ippTools/src/pxregister.c (modified) (2 diffs)
-
ippTools/src/pxregister.h (modified) (1 diff)
-
ippTools/src/pxtables.c (modified) (3 diffs)
-
ippTools/src/pxtag.c (modified) (2 diffs)
-
ippTools/src/pxtag.h (modified) (1 diff)
-
ippTools/src/pzgetexp.c (modified) (8 diffs)
-
ippTools/src/pzgetimfiles.c (modified) (16 diffs)
-
ippTools/src/pztool.c (modified) (11 diffs)
-
ippTools/src/pztoolConfig.c (modified) (5 diffs)
-
ippTools/src/regtool.c (modified) (17 diffs)
-
ippTools/src/regtoolConfig.c (modified) (10 diffs)
-
ippTools/src/stacktool.c (modified) (1 diff)
-
ippTools/src/stacktoolConfig.c (modified) (1 diff)
-
ippTools/src/warptoolConfig.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/dbconfig/chip.md
r14017 r14023 1 1 # 2 # We are dependant on the assumption that there is only ever one exp_ tagin a2 # We are dependant on the assumption that there is only ever one exp_id in a 3 3 # chipRun although the database does not enforce this. 4 4 # … … 17 17 chipInputImfile METADATA 18 18 chip_id S64 0 # Primary Key fkey (chip_id) ref chipRun(chip_id) 19 exp_ tag STR 64 # Primary Key fkey (exp_tag, class_id) ref rawImfile (exp_tag, class_id)19 exp_id S64 64 # Primary Key fkey (exp_id, class_id) ref rawImfile (exp_id, class_id) 20 20 class_id STR 64 # Primary Key 21 21 END 22 22 23 23 chipProcessedImfile METADATA 24 chip_id S64 0 # Primary Key fkey (chip_id, exp_ tag, class_id) ref chipPendingImfile(chip_id, exp_tag, class_id)25 exp_ tag STR64 # Primary Key24 chip_id S64 0 # Primary Key fkey (chip_id, exp_id, class_id) ref chipInputImfile(chip_id, exp_id, class_id) 25 exp_id S64 64 # Primary Key 26 26 class_id STR 64 # Primary Key 27 27 uri STR 255 -
trunk/dbconfig/det.md
r13937 r14023 34 34 det_id S64 0 # Primary Key 35 35 iteration S32 0 # Primary Key 36 exp_ tag STR64 # Primary Key36 exp_id S64 64 # Primary Key 37 37 include BOOL f 38 38 END … … 40 40 detProcessedImfile METADATA 41 41 det_id S64 0 # Primary Key 42 exp_ tag STR64 # Primary Key42 exp_id S64 64 # Primary Key 43 43 class_id STR 64 # Primary Key 44 44 uri STR 255 … … 61 61 detProcessedExp METADATA 62 62 det_id S64 0 # Primary Key 63 exp_ tag STR64 # Primary Key63 exp_id S64 64 # Primary Key 64 64 recipe STR 64 65 65 bg F64 0.0 … … 153 153 det_id S64 0 # Primary Key 154 154 iteration S32 0 # Primary Key 155 exp_ tag STR64 # Primary Key155 exp_id S64 64 # Primary Key 156 156 class_id STR 64 # Primary Key 157 157 uri STR 255 … … 176 176 det_id S64 0 # Primary Key 177 177 iteration S32 0 # Primary Key 178 exp_ tag STR64 # Primary Key178 exp_id S64 64 # Primary Key 179 179 recipe STR 64 180 180 bg F64 0.0 -
trunk/dbconfig/guide.md
r12531 r14023 1 1 guidePendingExp METADATA 2 2 guide_id S64 0 # Primary Key AUTO_INCREMENT 3 exp_ tag STR64 # Key3 exp_id S64 64 # Key 4 4 recipe STR 64 5 5 END -
trunk/dbconfig/magic.md
r11813 r14023 1 # $Id: magic.md,v 1. 1 2007-02-15 02:12:42jhoblitt Exp $1 # $Id: magic.md,v 1.2 2007-07-06 01:16:08 jhoblitt Exp $ 2 2 3 3 # … … 10 10 p4MagicMaskImfile METADATA 11 11 p4_id S32 0 # Primary Key 12 exp_ tag STR64 # Primary Key12 exp_id S64 64 # Primary Key 13 13 p3_version S32 0 # Primary Key 14 14 # class is not yet consistently carried through pXtools … … 21 21 # p4MagicMaskImfile METADATA 22 22 # p4_id S32 0 # Primary Key 23 # exp_ tag STR64 # Primary Key23 # exp_id S64 64 # Primary Key 24 24 # p3_version S32 0 # Primary Key 25 25 # # class is not yet consistently carried through pXtools … … 34 34 # skycell_id STR 64 # Primary Key 35 35 # tess_id STR 64 # Primary Key 36 # exp_ tag STR64 # Primary Key36 # exp_id S64 64 # Primary Key 37 37 # p3_version S32 0 # Primary Key 38 38 # # class is not yet consistently carried through pXtools … … 50 50 # skycell_id STR 64 # Primary Key 51 51 # tess_id STR 64 # Primary Key 52 # exp_ tag STR64 # Primary Key52 # exp_id S64 64 # Primary Key 53 53 # p3_version S32 0 # Primary Key 54 54 # # class is not yet consistently carried through pXtools … … 64 64 # skycell_id STR 64 # Primary Key 65 65 # tess_id STR 64 # Primary Key 66 # exp_ tag STR64 # Primary Key66 # exp_id S64 64 # Primary Key 67 67 # p3_version S32 0 # Primary Key 68 68 # # class is not yet consistently carried through pXtools … … 77 77 # p4MagicMaskImfile METADATA 78 78 # p4_id S32 0 # Primary Key 79 # exp_ tag STR64 # Primary Key79 # exp_id S64 64 # Primary Key 80 80 # p3_version S32 0 # Primary Key 81 81 # # class is not yet consistently carried through pXtools -
trunk/dbconfig/skycell.md
r11779 r14023 1 # $Id: skycell.md,v 1. 3 2007-02-13 22:33:30jhoblitt Exp $1 # $Id: skycell.md,v 1.4 2007-07-06 01:16:08 jhoblitt Exp $ 2 2 3 3 skyCell METADATA … … 17 17 skycell_id STR 64 # Primary Key 18 18 tess_id STR 64 # Primary Key 19 exp_ tag STR64 # Primary Key19 exp_id S64 64 # Primary Key 20 20 p3_version S32 0 # Primary Key 21 21 # class is not yet consistently carried through pXtools -
trunk/dbconfig/tasks.md
r14017 r14023 1 # $Id: tasks.md,v 1.13 5 2007-07-05 20:13:45jhoblitt Exp $1 # $Id: tasks.md,v 1.136 2007-07-06 01:16:08 jhoblitt Exp $ 2 2 3 3 # this table records all exposure ID ever seen from the summit 4 # exp_ id== fileset4 # exp_name == fileset 5 5 6 6 # note that dec is a MySQL reserved word … … 8 8 # note that exp is a MySQL reserved word 9 9 10 # for use with this stored procedure to generate exp_ tags under Mysql 5+10 # for use with this stored procedure to generate exp_ids under Mysql 5+ 11 11 # 12 #CREATE FUNCTION genTag (exp_ idvarchar(64)) RETURNS VARCHAR(64)12 #CREATE FUNCTION genTag (exp_name varchar(64)) RETURNS VARCHAR(64) 13 13 #BEGIN 14 14 # UPDATE expTagCounter SET counter = LAST_INSERT_ID(counter + 1); 15 # RETURN CONCAT(exp_ id, '.', LAST_INSERT_ID());15 # RETURN CONCAT(exp_name, '.', LAST_INSERT_ID()); 16 16 #END 17 17 # 18 expTagCounter METADATA19 counter U64 020 END18 #expTagCounter METADATA 19 # counter U64 0 20 #END 21 21 22 22 # list of source exposures -- updated as exposures are seen … … 24 24 # -1 as NULL or 0 might be a valid value (empty fileset) 25 25 summitExp METADATA 26 exp_ idSTR 64 # Primary Key26 exp_name STR 64 # Primary Key 27 27 camera STR 64 # Primary Key 28 28 telescope STR 64 # Primary Key … … 37 37 # list of source images -- updated as exposures/filesets are queried 38 38 summitImfile METADATA 39 exp_ idSTR 64 # Primary Key39 exp_name STR 64 # Primary Key 40 40 camera STR 64 # Primary Key 41 41 telescope STR 64 # Primary Key … … 51 51 # downloaded) 52 52 pzPendingExp METADATA 53 exp_ idSTR 64 # Primary Key53 exp_name STR 64 # Primary Key 54 54 camera STR 64 # Primary Key 55 55 telescope STR 64 # Primary Key … … 57 57 58 58 pzPendingImfile METADATA 59 exp_ idSTR 64 # Primary Key59 exp_name STR 64 # Primary Key 60 60 camera STR 64 # Primary Key 61 61 telescope STR 64 # Primary Key 62 62 class STR 64 # Primary Key 63 63 class_id STR 64 # Primary Key 64 exp_ tag STR64 # Unique Key64 exp_id S64 64 # Unique Key 65 65 END 66 66 67 67 # list of exposures that have had all of their imfiles downloaded 68 68 pzDoneExp METADATA 69 exp_ idSTR 64 # Primary Key69 exp_name STR 64 # Primary Key 70 70 camera STR 64 # Primary Key 71 71 telescope STR 64 # Primary Key … … 73 73 74 74 pzDoneImfile METADATA 75 exp_ idSTR 64 # Primary Key75 exp_name STR 64 # Primary Key 76 76 camera STR 64 # Primary Key 77 77 telescope STR 64 # Primary Key 78 78 class STR 64 # Primary Key 79 79 class_id STR 64 # Primary Key 80 exp_ tag STR64 # Unique Key80 exp_id S64 64 # Unique Key 81 81 uri STR 255 82 82 END 83 83 84 84 newExp METADATA 85 exp_tag STR 64 # Primary Key 86 exp_id STR 64 # Key 85 exp_id S64 0 # Primary Key AUTO_INCREMENT 86 tmp_exp_name STR 64 # Key 87 tmp_camera STR 64 # Key 88 tmp_telescope STR 64 # Key 87 89 state STR 64 # Key 88 camera STR 64 # Key89 telescope STR 64 # Key90 90 imfiles S32 0 91 91 workdir STR 255 # destination for output files … … 96 96 # from there 97 97 newImfile METADATA 98 exp_ tag STR 64 # Primary Key fkey(exp_tag) ref newExp(exp_tag)99 class_id STR64 # Primary Key98 exp_id S64 64 # Primary Key fkey(exp_id) ref newExp(exp_id) 99 tmp_class_id STR 64 # Primary Key 100 100 uri STR 255 101 101 END … … 103 103 # paired with rawImfile 104 104 rawExp METADATA 105 exp_ tag STR 64 # Primary Key fkey(exp_tag) ref newExp(exp_tag)106 exp_ id STR 64 # Key105 exp_id S64 64 # Primary Key fkey(exp_id) ref newExp(exp_id) 106 exp_name STR 64 107 107 camera STR 64 108 108 telescope STR 64 109 109 dateobs UTC 0001-01-01T00:00:00Z 110 exp_tag STR 255 110 111 exp_type STR 64 111 112 imfiles S32 0 … … 136 137 137 138 rawImfile METADATA 138 exp_tag STR 64 # Primary Key fkey(exp_tag, class_id) ref newImfile(exp_tag, class_id) 139 exp_id S64 64 # Primary Key fkey(exp_id, tmp_class_id) ref newImfile(exp_id, tmp_class_id) 140 exp_name STR 64 141 camera STR 64 142 telescope STR 64 143 dateobs UTC 0001-01-01T00:00:00Z 144 tmp_class_id STR 64 # Key 139 145 class_id STR 64 # Primary Key 140 146 uri STR 255 … … 163 169 user_5 F64 0.0 164 170 object STR 64 165 dateobs UTC 0001-01-01T00:00:00Z166 171 fault S16 0 # Key NOT NULL 167 172 END 168 169 #170 # XXX - temporarily (???) stop carrying around class in imfiles after rawImfile171 # -
trunk/dbconfig/warp.md
r13690 r14023 1 # $Id: warp.md,v 1. 3 2007-06-07 01:10:31 priceExp $1 # $Id: warp.md,v 1.4 2007-07-06 01:16:08 jhoblitt Exp $ 2 2 3 3 # … … 23 23 24 24 # the list of imfiles in our skycell keyed against phase 3 25 # only allow one cam_version of an exp_ tagper warpRun25 # only allow one cam_version of an exp_id per warpRun 26 26 warpInputExp METADATA 27 27 warp_id S64 0 # Primary Key fkey(warp_id) ref warpRun(warp_id) 28 28 cam_id S64 0 # Primary Key fkey(cam_id) ref camProcessedExp(cam_id) 29 # if magic is T then look for the exp_ tagin the magic output tables29 # if magic is T then look for the exp_id in the magic output tables 30 30 magiced BOOL f # Key 31 31 END -
trunk/ippTools/scripts/regtest.sh
r14018 r14023 8 8 echo -e "YES\nipp\n\n" | pxadmin -recreate || exit 1 9 9 10 exp_ tag1=`$inject -newExp -exp_id t10 -inst gpc -telescope ps1 -imfiles 4 -workdir file::///some/path -simple` || exit 110 exp_id1=`$inject -newExp -tmp_exp_name t10 -tmp_inst gpc -tmp_telescope ps1 -imfiles 4 -workdir file::///some/path -simple` || exit 1 11 11 12 12 for ID in `seq 0 3`; do 13 $inject -newImfile -exp_ tag $exp_tag1 -class_id$ID -uri file://$ID || exit 113 $inject -newImfile -exp_id $exp_id1 -tmp_class_id tmp.$ID -uri file://$ID || exit 1 14 14 done; 15 15 16 $inject -updatenewExp -exp_ tag $exp_tag1 -state run16 $inject -updatenewExp -exp_id $exp_id1 -state run 17 17 18 exp_ tag2=`$inject -newExp -exp_id t11 -inst gpc -telescope ps1 -imfiles 4 -workdir file::///some/path -simple` || exit 118 exp_id2=`$inject -newExp -tmp_exp_name t11 -tmp_inst gpc -tmp_telescope ps1 -imfiles 4 -workdir file::///some/path -simple` || exit 1 19 19 20 20 for ID in `seq 0 3`; do 21 $inject -newImfile -exp_ tag $exp_tag2 -class_id$ID -uri file://$ID || exit 121 $inject -newImfile -exp_id $exp_id2 -tmp_class_id tmp.$ID -uri file://$ID || exit 1 22 22 done; 23 23 24 $inject -updatenewExp -exp_ tag $exp_tag2 -state run24 $inject -updatenewExp -exp_id $exp_id2 -state run 25 25 26 26 $regtool -pendingimfile || exit 1 27 27 28 28 for ID in `seq 0 3`; do 29 $regtool -addprocessedimfile -exp_ tag $exp_tag1-class_id $ID -filter r -airmass 10 -ra 1 -decl 2 -exp_time 0 -bg 1 -bg_stdev 1 -bg_mean_stdev 10 -alt 10 -az 10 -ccd_temp 10 -posang 10 -object dog -dateobs 2006-10-20T10:10:10Z || exit 129 $regtool -addprocessedimfile -exp_id $exp_id1 -exp_name t10 -inst gpc -telescope ps1 -tmp_class_id tmp.$ID -class_id $ID -filter r -airmass 10 -ra 1 -decl 2 -exp_time 0 -bg 1 -bg_stdev 1 -bg_mean_stdev 10 -alt 10 -az 10 -ccd_temp 10 -posang 10 -object dog -dateobs 2006-10-20T10:10:10Z || exit 1 30 30 done; 31 31 32 32 $regtool -pendingexp|| exit 1 33 33 34 $regtool -addprocessedexp -exp_ tag $exp_tag1-filelevel OTA -filter r -airmass 10 -ra 1 -decl 2 -exp_type bias -exp_time 0 -bg 10 -bg_stdev 1 -bg_mean_stdev 10 -alt 10 -az 10 -ccd_temp 45 -posang 10 -object dog -dateobs "2006-10-20T10:10:10Z" -label foobar $* || exit 134 $regtool -addprocessedexp -exp_id $exp_id1 -exp_name t10 -imfiles 4 -inst gpc -telescope ps1 -exp_tag batman.t10 -filelevel OTA -filter r -airmass 10 -ra 1 -decl 2 -exp_type bias -exp_time 0 -bg 10 -bg_stdev 1 -bg_mean_stdev 10 -alt 10 -az 10 -ccd_temp 45 -posang 10 -object dog -dateobs "2006-10-20T10:10:10Z" -label foobar $* || exit 1 35 35 36 36 $regtool -pendingimfile || exit 1 37 37 38 38 for ID in `seq 0 3`; do 39 $regtool -addprocessedimfile -exp_ tag $exp_tag2 -exp_type object-class_id $ID -filter r -airmass 10 -ra 1 -decl 2 -exp_time 0 -bg 1 -bg_stdev 1 -bg_mean_stdev 10 -alt 10 -az 10 -ccd_temp 10 -posang 10 -object dog -dateobs 2006-10-20T10:10:10Z || exit 139 $regtool -addprocessedimfile -exp_id $exp_id2 -exp_name t11 -inst gpc -telescope ps1 -tmp_class_id tmp.$ID -class_id $ID -filter r -airmass 10 -ra 1 -decl 2 -exp_time 0 -bg 1 -bg_stdev 1 -bg_mean_stdev 10 -alt 10 -az 10 -ccd_temp 10 -posang 10 -object dog -dateobs 2006-10-20T10:10:10Z || exit 1 40 40 done; 41 41 42 42 $regtool -pendingexp|| exit 1 43 43 44 $regtool -addprocessedexp -exp_ tag $exp_tag2-filelevel OTA -filter r -airmass 11 -ra 1 -decl 2 -exp_type bias -exp_time 0 -bg 11 -bg_stdev 1 -bg_mean_stdev 11 -alt 11 -az 11 -ccd_temp 45 -posang 11 -object dog -dateobs 2006-10-20T10:10:10Z -label foobar $* || exit 144 $regtool -addprocessedexp -exp_id $exp_id2 -exp_name t11 -imfiles 4 -inst gpc -telescope ps1 -exp_tag batman.t11 -filelevel OTA -filter r -airmass 11 -ra 1 -decl 2 -exp_type bias -exp_time 0 -bg 11 -bg_stdev 1 -bg_mean_stdev 11 -alt 11 -az 11 -ccd_temp 45 -posang 11 -object dog -dateobs 2006-10-20T10:10:10Z -label foobar $* || exit 1 -
trunk/ippTools/share/Makefile.am
r12581 r14023 9 9 chiptool_pendingimfile.sql \ 10 10 chiptool_processedimfile.sql \ 11 chiptool_queuerawexp.sql \12 11 chiptool_queuerawimfile.sql \ 13 12 detselect_search.sql \ -
trunk/ippTools/share/camtool_find_pendingexp.sql
r14018 r14023 4 4 SELECT 5 5 camRun.*, 6 rawExp.exp_tag,7 6 rawExp.exp_id, 7 rawExp.exp_name, 8 8 rawExp.camera, 9 9 rawExp.telescope, … … 15 15 USING(chip_id) 16 16 JOIN rawExp 17 ON chipProcessedImfile.exp_ tag = rawExp.exp_tag17 ON chipProcessedImfile.exp_id = rawExp.exp_id 18 18 LEFT JOIN camProcessedExp 19 19 ON camRun.cam_id = camProcessedExp.cam_id -
trunk/ippTools/share/camtool_find_pendingimfile.sql
r12259 r14023 4 4 (SELECT 5 5 camPendingExp.*, 6 chipProcessedExp.exp_ tag,6 chipProcessedExp.exp_id, 7 7 chipProcessedExp.guide_id, 8 8 chipProcessedImfile.class_id, … … 12 12 chipProcessedImfile.bg_mean_stdev, 13 13 chipProcessedImfile.path_base, 14 rawExp.exp_ id,14 rawExp.exp_name, 15 15 rawExp.camera, 16 16 rawExp.telescope, … … 22 22 USING(chip_id) 23 23 JOIN rawExp 24 ON chipProcessedExp.exp_ tag = rawExp.exp_tag24 ON chipProcessedExp.exp_id = rawExp.exp_id 25 25 LEFT JOIN camProcessedExp 26 26 ON camPendingExp.cam_id = camProcessedExp.cam_id -
trunk/ippTools/share/camtool_find_processedexp.sql
r12736 r14023 1 1 SELECT 2 2 camProcessedExp.*, 3 rawExp.exp_ id,3 rawExp.exp_name, 4 4 rawExp.camera, 5 5 rawExp.telescope, … … 9 9 USING(chip_id) 10 10 JOIN rawExp 11 ON chipProcessedExp.exp_ tag = rawExp.exp_tag11 ON chipProcessedExp.exp_id = rawExp.exp_id 12 12 WHERE -- bogus condition so there is a pre-existing where to append to 13 13 camProcessedExp.cam_id IS NOT NULL -
trunk/ippTools/share/chiptool_completely_processed_exp.sql
r14018 r14023 18 18 USING(chip_id) 19 19 JOIN rawExp 20 ON chipInputImfile.exp_ tag = rawExp.exp_tag20 ON chipInputImfile.exp_id = rawExp.exp_id 21 21 JOIN chipProcessedImfile 22 22 ON chipInputImfile.chip_id = chipProcessedImfile.chip_id 23 AND chipInputImfile.exp_ tag = chipProcessedImfile.exp_tag23 AND chipInputImfile.exp_id = chipProcessedImfile.exp_id 24 24 AND chipInputImfile.class_id = chipProcessedImfile.class_id 25 25 WHERE … … 28 28 GROUP BY 29 29 chipInputImfile.chip_id, 30 chipInputImfile.exp_ tag30 chipInputImfile.exp_id 31 31 HAVING rawExp.imfiles = COUNT(chipProcessedImfile.class_id)) as Foo -
trunk/ippTools/share/chiptool_find_rawexp.sql
r12184 r14023 2 2 -- processeing 3 3 SELECT 4 exp_ tag4 exp_id 5 5 FROM rawExp 6 6 WHERE -
trunk/ippTools/share/chiptool_pendingimfile.sql
r14018 r14023 1 1 SELECT 2 2 chipRun.*, 3 chipInputImfile.exp_ tag,3 chipInputImfile.exp_id, 4 4 chipInputImfile.class_id, 5 5 rawImfile.uri, 6 rawExp.exp_ id,6 rawExp.exp_name, 7 7 rawExp.camera, 8 8 rawExp.telescope, … … 13 13 LEFT JOIN chipProcessedImfile 14 14 ON chipInputImfile.chip_id = chipProcessedImfile.chip_id 15 AND chipInputImfile.exp_ tag = chipProcessedImfile.exp_tag15 AND chipInputImfile.exp_id = chipProcessedImfile.exp_id 16 16 AND chipInputImfile.class_id = chipProcessedImfile.class_id 17 17 JOIN rawImfile 18 ON chipInputImfile.exp_ tag = rawImfile.exp_tag18 ON chipInputImfile.exp_id = rawImfile.exp_id 19 19 AND chipInputImfile.class_id = rawImfile.class_id 20 20 JOIN rawExp 21 ON rawImfile.exp_ tag = rawExp.exp_tag21 ON rawImfile.exp_id = rawExp.exp_id 22 22 LEFT JOIN chipMask 23 23 ON chipRun.label = chipMask.label … … 25 25 chipRun.state = 'run' 26 26 AND chipProcessedImfile.chip_id IS NULL 27 AND chipProcessedImfile.exp_ tagIS NULL27 AND chipProcessedImfile.exp_id IS NULL 28 28 AND chipProcessedImfile.class_id IS NULL 29 29 AND chipMask.label IS NULL -
trunk/ippTools/share/chiptool_processedimfile.sql
r12259 r14023 7 7 chipProcessedImfile.bg_mean_stdev, 8 8 chipProcessedImfile.path_base, 9 rawExp.exp_ id,9 rawExp.exp_name, 10 10 rawExp.camera, 11 11 rawExp.telescope, … … 15 15 USING(chip_id) 16 16 JOIN rawExp 17 ON chipProcessedExp.exp_ tag = rawExp.exp_tag17 ON chipProcessedExp.exp_id = rawExp.exp_id 18 18 WHERE 19 19 -- bogus test; just here so there there is a 'WHERE' stmt to append conditionals too 20 chipProcessedImfile.exp_ tagis NOT NULL20 chipProcessedImfile.exp_id is NOT NULL 21 21 -
trunk/ippTools/share/chiptool_queuerawimfile.sql
r14018 r14023 2 2 SELECT 3 3 LAST_INSERT_ID(), 4 rawImfile.exp_ tag,4 rawImfile.exp_id, 5 5 rawImfile.class_id 6 6 FROM rawImfile 7 7 JOIN newExp 8 USING(exp_ tag)8 USING(exp_id) 9 9 WHERE 10 10 rawImfile.fault = 0 11 11 AND newExp.state = 'stop' 12 AND rawImfile.exp_ tag= '%s'12 AND rawImfile.exp_id = '%s' 13 13 -
trunk/ippTools/share/dettool_find_completed_runs.sql
r12424 r14023 6 6 detRun.det_id, 7 7 detRun.iteration, 8 detInputExp.exp_ tag8 detInputExp.exp_id 9 9 FROM detRun 10 10 LEFT JOIN detInputExp … … 12 12 AND detRun.iteration = detInputExp.iteration 13 13 LEFT JOIN rawExp 14 ON detInputExp.exp_ tag = rawExp.exp_tag14 ON detInputExp.exp_id = rawExp.exp_id 15 15 LEFT JOIN detResidExp 16 16 ON detRun.det_id = detResidExp.det_id 17 17 AND detRun.iteration = detResidExp.iteration 18 AND detInputExp.exp_ tag = detResidExp.exp_tag18 AND detInputExp.exp_id = detResidExp.exp_id 19 19 WHERE 20 20 detRun.state = 'run' … … 23 23 detRun.iteration 24 24 HAVING 25 COUNT(detResidExp.exp_ tag) = COUNT(detInputExp.exp_tag)25 COUNT(detResidExp.exp_id) = COUNT(detInputExp.exp_id) 26 26 ) AS residdetrun -
trunk/ippTools/share/difftool_inputskyfile.sql
r12312 r14023 17 17 ON camProcessedExp.chip_id = chipProcessedExp.chip_id 18 18 JOIN rawExp 19 ON chipProcessedExp.exp_ tag = rawExp.exp_tag19 ON chipProcessedExp.exp_id = rawExp.exp_id 20 20 WHERE 21 21 diffRun.state = 'run' -
trunk/ippTools/share/regtool_find_unprocessed_exp.sql
r14018 r14023 4 4 FROM newExp 5 5 JOIN newImfile 6 USING(exp_ tag)6 USING(exp_id) 7 7 LEFT JOIN rawExp 8 USING(exp_ tag)8 USING(exp_id) 9 9 WHERE 10 10 newExp.state = 'run' 11 AND rawExp.exp_ tagIS NULL11 AND rawExp.exp_id IS NULL 12 12 AND newExp.imfiles = 13 (SELECT COUNT(exp_ tag) FROM rawImfile14 WHERE rawImfile.exp_ tag = newExp.exp_tag)) as Foo13 (SELECT COUNT(exp_id) FROM rawImfile 14 WHERE rawImfile.exp_id = newExp.exp_id)) as Foo 15 15 WHERE 16 exp_ tag= '%s'16 exp_id = '%s' -
trunk/ippTools/share/regtool_pendingexp.sql
r14018 r14023 3 3 FROM newExp 4 4 JOIN newImfile 5 USING(exp_ tag)5 USING(exp_id) 6 6 LEFT JOIN rawExp 7 USING(exp_ tag)7 USING(exp_id) 8 8 WHERE 9 9 newExp.state = 'run' 10 AND rawExp.exp_ tagIS NULL10 AND rawExp.exp_id IS NULL 11 11 AND newExp.imfiles = 12 (SELECT COUNT(exp_ tag) FROM rawImfile12 (SELECT COUNT(exp_id) FROM rawImfile 13 13 WHERE 14 rawImfile.exp_ tag = newExp.exp_tag14 rawImfile.exp_id = newExp.exp_id 15 15 AND rawImfile.fault = 0) -
trunk/ippTools/share/regtool_pendingimfile.sql
r12086 r14023 1 SELECT 2 newImfile.*, 3 newExp.workdir 4 FROM newImfile 5 LEFT JOIN newExp 6 USING(exp_tag) 7 LEFT JOIN rawExp 8 USING(exp_tag) 9 WHERE 10 newExp.exp_tag is NOT NULL 11 AND rawExp.exp_tag IS NULL 1 SELECT DISTINCT * FROM 2 (SELECT 3 newExp.exp_id, 4 newExp.tmp_exp_name, 5 newExp.tmp_camera, 6 newExp.tmp_telescope, 7 newExp.workdir, 8 newImfile.tmp_class_id, 9 newImfile.uri 10 FROM newImfile 11 JOIN newExp 12 USING(exp_id) 13 LEFT JOIN rawImfile 14 ON newExp.exp_id = rawImfile.exp_id 15 AND newImfile.tmp_class_id = rawImfile.tmp_class_id 16 WHERE 17 newExp.state = 'run' 18 AND rawImfile.tmp_class_id IS NULL) as Foo -
trunk/ippTools/share/regtool_processedimfile.sql
r12347 r14023 1 1 SELECT 2 2 rawImfile.*, 3 newExp.exp_ id,3 newExp.exp_name, 4 4 newExp.camera, 5 5 newExp.telescope 6 6 FROM rawImfile 7 7 JOIN newExp 8 USING(exp_ tag)8 USING(exp_id) 9 9 -- bogus conditional so there is a where clause to append to 10 WHERE rawImfile.exp_ tagis NOT NULL10 WHERE rawImfile.exp_id is NOT NULL -
trunk/ippTools/share/stacktool_inputskyfile.sql
r12419 r14023 16 16 ON camProcessedExp.chip_id = chipProcessedExp.chip_id 17 17 JOIN rawExp 18 ON chipProcessedExp.exp_ tag = rawExp.exp_tag18 ON chipProcessedExp.exp_id = rawExp.exp_id 19 19 WHERE 20 20 stackRun.state = 'run' -
trunk/ippTools/share/warptool_imfile.sql
r13827 r14023 14 14 ON camProcessedExp.chip_id = chipProcessedImfile.chip_id 15 15 JOIN rawImfile -- is there any reason not to refer back to rawimfiles? 16 ON chipProcessedExp.exp_ tag = rawImfile.exp_tag16 ON chipProcessedExp.exp_id = rawImfile.exp_id 17 17 WHERE 18 18 warpRun.state = 'run' -
trunk/ippTools/share/warptool_tooverlap.sql
r12237 r14023 12 12 ON camProcessedExp.chip_id = chipProcessedExp.chip_id 13 13 JOIN rawExp 14 ON chipProcessedExp.exp_ tag = rawExp.exp_tag14 ON chipProcessedExp.exp_id = rawExp.exp_id 15 15 LEFT JOIN warpSkyCellMap 16 16 ON warpInputExp.warp_id = warpSkyCellMap.warp_id -
trunk/ippTools/share/warptool_towarped.sql
r13088 r14023 14 14 ON camProcessedExp.chip_id = chipProcessedExp.chip_id 15 15 JOIN rawExp 16 ON chipProcessedExp.exp_ tag = rawExp.exp_tag16 ON chipProcessedExp.exp_id = rawExp.exp_id 17 17 LEFT JOIN warpSkyfile 18 18 ON warpRun.warp_id = warpSkyfile.warp_id -
trunk/ippTools/src/camtool.c
r14018 r14023 144 144 } 145 145 146 ADDPARAMSTR(config->args, where, "exp_tag");147 146 ADDPARAMSTR(config->args, where, "exp_id"); 147 ADDPARAMSTR(config->args, where, "exp_name"); 148 148 ADDPARAMSTR(config->args, where, "inst"); 149 149 ADDPARAMSTR(config->args, where, "telescope"); -
trunk/ippTools/src/camtoolConfig.c
r13937 r14023 50 50 psMetadataAddStr(queueArgs, PS_LIST_TAIL, "-chip_id", 0, 51 51 "search by chip_id", NULL); 52 psMetadataAddStr(queueArgs, PS_LIST_TAIL, "-exp_tag", 0,53 "search by exp_tag", NULL);54 52 psMetadataAddStr(queueArgs, PS_LIST_TAIL, "-exp_id", 0, 55 53 "search by exp_id", NULL); 54 psMetadataAddStr(queueArgs, PS_LIST_TAIL, "-exp_name", 0, 55 "search by exp_name", NULL); 56 56 psMetadataAddStr(queueArgs, PS_LIST_TAIL, "-inst", 0, 57 57 "search by camera", NULL); -
trunk/ippTools/src/chiptool.c
r14018 r14023 132 132 133 133 psMetadata *where = psMetadataAlloc(); 134 ADDPARAMSTR(config->args, where, "exp_tag");135 134 ADDPARAMSTR(config->args, where, "exp_id"); 135 ADDPARAMSTR(config->args, where, "exp_name"); 136 136 ADDRENAMEPARAMSTR(config->args, where, "inst", "camera"); 137 137 ADDPARAMSTR(config->args, where, "telescope"); … … 190 190 } 191 191 192 // find the exp_ tagof all the exposures that we want to queue up.192 // find the exp_id of all the exposures that we want to queue up. 193 193 psString query = pxDataGet("chiptool_find_rawexp.sql"); 194 194 if (!query) { … … 230 230 } 231 231 232 // loop over our list of exp_ tags232 // loop over our list of exp_ids 233 233 for (long i = 0; i < psArrayLength(output); i++) { 234 234 psMetadata *md = output->data[i]; 235 235 236 psString exp_ tag = psMetadataLookupStr(&status, md, "exp_tag");236 psString exp_id = psMetadataLookupStr(&status, md, "exp_id"); 237 237 if (!status) { 238 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for exp_ tag");238 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for exp_id"); 239 239 psFree(output); 240 240 return false; … … 242 242 243 243 // queue the exp 244 if (!pxchipQueueByExpTag(config, exp_ tag, workdir, label, reduction, expgroup, dvodb)) {244 if (!pxchipQueueByExpTag(config, exp_id, workdir, label, reduction, expgroup, dvodb)) { 245 245 if (!psDBRollback(config->dbh)) { 246 246 psError(PS_ERR_UNKNOWN, false, "database error"); 247 247 } 248 248 psError(PS_ERR_UNKNOWN, false, 249 "failed to trying to queue exp_ tag: %s", exp_tag);249 "failed to trying to queue exp_id: %s", exp_id); 250 250 psFree(output); 251 251 return false; … … 357 357 } 358 358 359 psString exp_ tag = psMetadataLookupStr(&status, config->args, "-exp_tag");360 if (!status) { 361 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_ tag");362 return false; 363 } 364 if (!exp_ tag) {365 psError(PS_ERR_UNKNOWN, true, "-exp_ tagis required");359 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id"); 360 if (!status) { 361 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id"); 362 return false; 363 } 364 if (!exp_id) { 365 psError(PS_ERR_UNKNOWN, true, "-exp_id is required"); 366 366 return false; 367 367 } … … 511 511 512 512 chipProcessedImfileRow *imfile = chipProcessedImfileRowAlloc( 513 (ps U64)atoll(chip_id),514 exp_tag,513 (psS64)atoll(chip_id), 514 (psS64)atoll(exp_id), 515 515 class_id, 516 516 uri, -
trunk/ippTools/src/chiptoolConfig.c
r14018 r14023 46 46 // -queue 47 47 psMetadata *queueArgs = psMetadataAlloc(); 48 psMetadataAddStr(queueArgs, PS_LIST_TAIL, "-exp_tag", 0,49 "search by exp_tag", NULL);50 48 psMetadataAddStr(queueArgs, PS_LIST_TAIL, "-exp_id", 0, 51 49 "search by exp_id", NULL); 50 psMetadataAddStr(queueArgs, PS_LIST_TAIL, "-exp_name", 0, 51 "search by exp_name", NULL); 52 52 psMetadataAddStr(queueArgs, PS_LIST_TAIL, "-inst", 0, 53 53 "search by camera", NULL); … … 106 106 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-chip_id", 0, 107 107 "search by chip ID", NULL); 108 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_ tag", 0,108 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_id", 0, 109 109 "search by exposure ID", NULL); 110 110 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-class", 0, … … 127 127 psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-chip_id", 0, 128 128 "define chip ID (required)", NULL); 129 psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-exp_ tag", 0,129 psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-exp_id", 0, 130 130 "define exposure ID", NULL); 131 131 psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-class_id", 0, … … 181 181 psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-chip_id", 0, 182 182 "define chip ID", NULL); 183 psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-exp_ tag", 0,183 psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-exp_id", 0, 184 184 "define exposure ID", NULL); 185 185 psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-class", 0, … … 204 204 psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-chip_id", 0, 205 205 "define chip ID", NULL); 206 psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-exp_ tag", 0,206 psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-exp_id", 0, 207 207 "search by exposure ID", NULL); 208 208 psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-class", 0, … … 217 217 psMetadataAddStr(retryprocessedimfileArgs, PS_LIST_TAIL, "-chip_id", 0, 218 218 "define chip ID (required)", NULL); 219 psMetadataAddStr(retryprocessedimfileArgs, PS_LIST_TAIL, "-exp_ tag", 0,219 psMetadataAddStr(retryprocessedimfileArgs, PS_LIST_TAIL, "-exp_id", 0, 220 220 "search by exposure ID", NULL); 221 221 psMetadataAddStr(retryprocessedimfileArgs, PS_LIST_TAIL, "-class", 0, … … 294 294 } 295 295 296 addWhereStr(exp_ tag);296 addWhereStr(exp_id); 297 297 // convert '-inst' to 'camera' 298 298 { -
trunk/ippTools/src/detselectConfig.c
r13578 r14023 183 183 addWhereStr(det_id); 184 184 addWhereS32(iteration); 185 addWhereStr(exp_ tag);185 addWhereStr(exp_id); 186 186 // convert '-inst' to 'camera' 187 187 { -
trunk/ippTools/src/dettool.c
r13977 r14023 173 173 " FROM rawExp" 174 174 " LEFT JOIN detInputExp" 175 " ON rawExp.exp_ tag = detInputExp.exp_tag"175 " ON rawExp.exp_id = detInputExp.exp_id" 176 176 " WHERE" 177 " detInputExp.exp_ tagIS NULL"177 " detInputExp.exp_id IS NULL" 178 178 " AND rawExp.obstype != 'object'" 179 179 ); … … 461 461 } 462 462 463 // we have to support multipe exp_ tags464 psMetadataItem *item = psMetadataLookup(config->args, "-exp_ tag");463 // we have to support multipe exp_ids 464 psMetadataItem *item = psMetadataLookup(config->args, "-exp_id"); 465 465 if (!item) { 466 466 // this shouldn't actually happen when using psArgs 467 psError(PS_ERR_UNKNOWN, true, "-exp_ tagis required");467 psError(PS_ERR_UNKNOWN, true, "-exp_id is required"); 468 468 return false; 469 469 } 470 470 psMetadata *where = psMetadataAlloc(); 471 471 472 // make sure that -exp_ tagwas parsed correctly472 // make sure that -exp_id was parsed correctly 473 473 // XXX this can be removed someday 474 474 if (item->type == PS_DATA_METADATA_MULTI) { … … 476 476 psMetadataItem *mItem = NULL; 477 477 while ((mItem = psListGetAndIncrement(iter))) { 478 psString exp_ tag= mItem->data.V;479 // if exp_ tag is NULL then it means that -exp_taghas not been478 psString exp_id = mItem->data.V; 479 // if exp_id is NULL then it means that -exp_id has not been 480 480 // specified 481 if (!exp_ tag) {481 if (!exp_id) { 482 482 psError(PS_ERR_UNKNOWN, true, 483 "at least one -exp_ tagis required");483 "at least one -exp_id is required"); 484 484 psFree(where); 485 485 return false; 486 486 } 487 487 488 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_ tag",489 PS_META_DUPLICATE_OK, "==", exp_ tag)) {490 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_ tag");488 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 489 PS_META_DUPLICATE_OK, "==", exp_id)) { 490 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 491 491 psFree(iter); 492 492 psFree(where); … … 496 496 psFree(iter); 497 497 } else { 498 psAbort( "-exp_ tagwas not parsed correctly (this should not happen");498 psAbort( "-exp_id was not parsed correctly (this should not happen"); 499 499 } 500 500 … … 504 504 } 505 505 506 // check that the specified exp_ tags actually exist506 // check that the specified exp_ids actually exist 507 507 psArray *detrendExps = rawExpSelectRowObjects(config->dbh, where, 0); 508 508 psFree(where); … … 512 512 } 513 513 514 // we should have one rawExp row per exp_ tagspecified514 // we should have one rawExp row per exp_id specified 515 515 if (psListLength(item->data.list) != psArrayLength(detrendExps)) { 516 psAbort( "an -exp_ tagmatched more then one rawExp (this should not happen");516 psAbort( "an -exp_id matched more then one rawExp (this should not happen"); 517 517 518 518 } … … 1768 1768 " %d," 1769 1769 " 0," 1770 " detResidExp.exp_ tag,"1770 " detResidExp.exp_id," 1771 1771 " detResidExp.accept" 1772 1772 " FROM detResidExp" 1773 1773 " JOIN rawExp" 1774 " USING(exp_ tag)"1774 " USING(exp_id)" 1775 1775 " WHERE det_id = %d" 1776 1776 ); … … 1979 1979 det_id, 1980 1980 iteration, 1981 rawExp->exp_ tag,1981 rawExp->exp_id, 1982 1982 true // use 1983 1983 ); … … 1991 1991 // select rawExp.* 1992 1992 // by: 1993 // exp_ tag1993 // exp_id 1994 1994 1995 1995 psString query = psStringCopy( … … 1997 1997 " FROM detInputExp" 1998 1998 " JOIN rawExp" 1999 " USING(exp_ tag)"1999 " USING(exp_id)" 2000 2000 ); 2001 2001 … … 2058 2058 " FROM rawImfile" 2059 2059 " JOIN detInputExp" 2060 " USING(exp_ tag) "2060 " USING(exp_id) " 2061 2061 " JOIN rawExp" 2062 " USING(exp_ tag) "2062 " USING(exp_id) " 2063 2063 " JOIN detRun" 2064 2064 " ON detInputExp.det_id = detRun.det_id" … … 2130 2130 // 2131 2131 // det_id is in detInputExp 2132 // exp_ tagis in detInputExp2132 // exp_id is in detInputExp 2133 2133 // det_id is not in detProccessedImfile 2134 // exp_ tagis not in detProccessedImfile2134 // exp_id is not in detProccessedImfile 2135 2135 // class_is is not in detProccessedImfile 2136 2136 psString query = psStringCopy( … … 2146 2146 " USING(det_id, iteration)" 2147 2147 " JOIN rawExp" 2148 " ON detInputExp.exp_ tag = rawExp.exp_tag"2148 " ON detInputExp.exp_id = rawExp.exp_id" 2149 2149 " JOIN rawImfile" 2150 " ON detInputExp.exp_ tag = rawImfile.exp_tag"2150 " ON detInputExp.exp_id = rawImfile.exp_id" 2151 2151 " LEFT JOIN detProcessedImfile" 2152 2152 " ON detInputExp.det_id = detProcessedImfile.det_id" 2153 " AND rawImfile.exp_ tag = detProcessedImfile.exp_tag"2153 " AND rawImfile.exp_id = detProcessedImfile.exp_id" 2154 2154 " AND rawImfile.class_id = detProcessedImfile.class_id" 2155 2155 " WHERE" … … 2157 2157 " AND detRun.mode = 'master'" 2158 2158 " AND detProcessedImfile.det_id IS NULL" 2159 " AND detProcessedImfile.exp_ tagIS NULL"2159 " AND detProcessedImfile.exp_id IS NULL" 2160 2160 " AND detProcessedImfile.class_id IS NULL" 2161 2161 ); … … 2223 2223 } 2224 2224 2225 // select exp_ tags from detInputExp matching det_idp2225 // select exp_ids from detInputExp matching det_idp 2226 2226 // where query should be pre-generated 2227 2227 psArray *detInputExp = … … 2232 2232 } 2233 2233 2234 // generate where query with just the exp_ tags2235 psMetadata *where_exp_ tags = psMetadataAlloc();2234 // generate where query with just the exp_ids 2235 psMetadata *where_exp_ids = psMetadataAlloc(); 2236 2236 for (long i = 0; i < psArrayLength(detInputExp); i++) { 2237 2237 detInputExpRow *row = detInputExp->data[i]; 2238 if (!psMetadataAddS tr(where_exp_tags, PS_LIST_TAIL, "exp_tag",2239 PS_META_DUPLICATE_OK, "==", row->exp_ tag)2238 if (!psMetadataAddS64(where_exp_ids, PS_LIST_TAIL, "exp_id", 2239 PS_META_DUPLICATE_OK, "==", row->exp_id) 2240 2240 ) { 2241 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_ tag");2241 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 2242 2242 psFree(detInputExp); 2243 psFree(where_exp_ tags);2243 psFree(where_exp_ids); 2244 2244 return NULL; 2245 2245 } … … 2247 2247 psFree(detInputExp); 2248 2248 2249 // select rawImfiles with matching exp_ tags2249 // select rawImfiles with matching exp_ids 2250 2250 psArray *rawImfiles = 2251 rawImfileSelectRowObjects(config->dbh, where_exp_ tags, 0);2252 psFree(where_exp_ tags);2251 rawImfileSelectRowObjects(config->dbh, where_exp_ids, 0); 2252 psFree(where_exp_ids); 2253 2253 if (!rawImfiles) { 2254 2254 psError(PS_ERR_UNKNOWN, false, "no rawImfile rows found"); … … 2263 2263 PS_ASSERT_PTR_NON_NULL(config, false); 2264 2264 2265 // det_id, exp_ tag, class_id, uri, recipe, -bg, -bg_stdev2265 // det_id, exp_id, class_id, uri, recipe, -bg, -bg_stdev 2266 2266 // are required 2267 2267 bool status = false; … … 2275 2275 return false; 2276 2276 } 2277 psString exp_ tag = psMetadataLookupStr(&status, config->args, "-exp_tag");2278 if (!status) { 2279 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_ tag");2280 return false; 2281 } 2282 if (!exp_ tag) {2283 psError(PS_ERR_UNKNOWN, true, "-exp_ tagis required");2277 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id"); 2278 if (!status) { 2279 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id"); 2280 return false; 2281 } 2282 if (!exp_id) { 2283 psError(PS_ERR_UNKNOWN, true, "-exp_id is required"); 2284 2284 return false; 2285 2285 } … … 2384 2384 } 2385 2385 2386 // find the matching rawImfile by exp_ tag/class_id2386 // find the matching rawImfile by exp_id/class_id 2387 2387 psMetadata *where = psMetadataAlloc(); 2388 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_ tag", 0, "==", exp_tag)) {2389 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_ tag");2388 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==", exp_id)) { 2389 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 2390 2390 psFree(where); 2391 2391 return false; … … 2415 2415 detProcessedImfileRow *detRow = detProcessedImfileRowAlloc( 2416 2416 (psS32)atol(det_id), 2417 exp_tag,2417 (psS64)atoll(exp_id), 2418 2418 class_id, 2419 2419 uri, … … 2461 2461 // select detRun.iteration 2462 2462 // select detRun.det_type 2463 // select detProcessedImfile.exp_ tag2463 // select detProcessedImfile.exp_id 2464 2464 // by: 2465 2465 // find the current iteration bassed on det_id 2466 // find all exp_ tags in the current det_id/iteration from detInputExp2467 // find all rawImfiles in the current exp_ tags2468 // compare to detProcessedImfiles by det_id/exp_ tag2466 // find all exp_ids in the current det_id/iteration from detInputExp 2467 // find all rawImfiles in the current exp_ids 2468 // compare to detProcessedImfiles by det_id/exp_id 2469 2469 // found how many imfile there are in each class_id 2470 2470 // and: … … 2477 2477 " iteration," 2478 2478 " det_type," 2479 " exp_ tag,"2479 " exp_id," 2480 2480 " camera," 2481 2481 " workdir" … … 2486 2486 " detRun.det_type," 2487 2487 " detRun.workdir," 2488 " detProcessedImfile.exp_ tag,"2488 " detProcessedImfile.exp_id," 2489 2489 " rawExp.camera," 2490 2490 " detProcessedImfile.class_id," … … 2494 2494 " USING(det_id, iteration)" 2495 2495 " JOIN rawExp" 2496 " ON detInputExp.exp_ tag = rawExp.exp_tag"2496 " ON detInputExp.exp_id = rawExp.exp_id" 2497 2497 " JOIN rawImfile" 2498 " ON rawExp.exp_ tag = rawImfile.exp_tag"2498 " ON rawExp.exp_id = rawImfile.exp_id" 2499 2499 " LEFT JOIN detProcessedImfile" 2500 2500 " ON detRun.det_id = detProcessedImfile.det_id" 2501 " AND detInputExp.exp_ tag = detProcessedImfile.exp_tag"2501 " AND detInputExp.exp_id = detProcessedImfile.exp_id" 2502 2502 " AND rawImfile.class_id = detProcessedImfile.class_id" 2503 2503 " LEFT JOIN detProcessedExp" 2504 2504 " ON detProcessedImfile.det_id = detProcessedExp.det_id" 2505 " AND detProcessedImfile.exp_ tag = detProcessedExp.exp_tag"2505 " AND detProcessedImfile.exp_id = detProcessedExp.exp_id" 2506 2506 " WHERE" 2507 2507 " detRun.state = 'run'" … … 2509 2509 " AND detProcessedImfile.fault = 0" 2510 2510 " AND detProcessedExp.det_id IS NULL" 2511 " AND detProcessedExp.exp_ tagIS NULL"2511 " AND detProcessedExp.exp_id IS NULL" 2512 2512 " AND detInputExp.include = 1" 2513 2513 " GROUP BY" 2514 " rawExp.exp_ tag,"2514 " rawExp.exp_id," 2515 2515 " detRun.det_id" 2516 2516 " HAVING" … … 2579 2579 PS_ASSERT_PTR_NON_NULL(config, false); 2580 2580 2581 // det_id, exp_ tag, recip, -bg, -bg_stdev2581 // det_id, exp_id, recip, -bg, -bg_stdev 2582 2582 // are required 2583 2583 bool status = false; … … 2591 2591 return false; 2592 2592 } 2593 psString exp_ tag = psMetadataLookupStr(&status, config->args, "-exp_tag");2594 if (!status) { 2595 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_ tag");2596 return false; 2597 } 2598 if (!exp_ tag) {2599 psError(PS_ERR_UNKNOWN, true, "-exp_ tagis required");2593 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id"); 2594 if (!status) { 2595 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id"); 2596 return false; 2597 } 2598 if (!exp_id) { 2599 psError(PS_ERR_UNKNOWN, true, "-exp_id is required"); 2600 2600 return false; 2601 2601 } … … 2693 2693 " detRun.iteration," 2694 2694 " detRun.det_type," 2695 " detProcessedImfile.exp_ tag"2695 " detProcessedImfile.exp_id" 2696 2696 " FROM detRun" 2697 2697 " JOIN detInputExp" … … 2699 2699 " AND detRun.iteration = detInputExp.iteration" 2700 2700 " JOIN rawExp" 2701 " ON detInputExp.exp_ tag = rawExp.exp_tag"2701 " ON detInputExp.exp_id = rawExp.exp_id" 2702 2702 " JOIN detProcessedImfile" 2703 2703 " ON detInputExp.det_id = detProcessedImfile.det_id" 2704 " AND detInputExp.exp_ tag = detProcessedImfile.exp_tag"2704 " AND detInputExp.exp_id = detProcessedImfile.exp_id" 2705 2705 " LEFT JOIN detProcessedExp" 2706 2706 " ON detInputExp.det_id = detProcessedExp.det_id" 2707 " AND detProcessedImfile.exp_ tag= detProcessedExp.exp_tag"2707 " AND detProcessedImfile.exp_id= detProcessedExp.exp_id" 2708 2708 " LEFT JOIN rawImfile" 2709 " ON detInputExp.exp_ tag = rawImfile.exp_tag"2709 " ON detInputExp.exp_id = rawImfile.exp_id" 2710 2710 " AND detProcessedImfile.class_id = rawImfile.class_id" 2711 2711 " WHERE" … … 2713 2713 " AND detRun.mode = 'master'" 2714 2714 " AND detProcessedExp.det_id IS NULL" 2715 " AND detProcessedExp.exp_ tagIS NULL"2715 " AND detProcessedExp.exp_id IS NULL" 2716 2716 " AND detInputExp.include = 1" 2717 2717 " AND detRun.det_id = %s" 2718 " AND detProcessedImfile.exp_ tag= '%s'"2718 " AND detProcessedImfile.exp_id = '%s'" 2719 2719 " GROUP BY" 2720 2720 " detProcessedImfile.class_id," … … 2725 2725 ); 2726 2726 2727 if (!p_psDBRunQuery(config->dbh, query, det_id, exp_ tag)) {2727 if (!p_psDBRunQuery(config->dbh, query, det_id, exp_id)) { 2728 2728 psError(PS_ERR_UNKNOWN, false, "database error"); 2729 2729 psFree(query); … … 2747 2747 detProcessedExpRow *detRow = detProcessedExpRowAlloc( 2748 2748 (psS32)atol(det_id), 2749 exp_tag,2749 (psS64)atoll(exp_id), 2750 2750 recipe, 2751 2751 bg, … … 2872 2872 // by: 2873 2873 // find the current iteration bassed on det_id 2874 // find all exp_ tags in the current det_id/iteration from detInputExp2875 // find all rawImfiles in the current exp_ tags2876 // compare to detProcessedImfiles by det_id/exp_ tag2874 // find all exp_ids in the current det_id/iteration from detInputExp 2875 // find all rawImfiles in the current exp_ids 2876 // compare to detProcessedImfiles by det_id/exp_id 2877 2877 // found how many imfile there are in each class_id 2878 2878 // and: … … 2895 2895 " AND detRun.iteration = detInputExp.iteration\n" 2896 2896 " JOIN rawExp\n" 2897 " ON detInputExp.exp_ tag = rawExp.exp_tag\n"2897 " ON detInputExp.exp_id = rawExp.exp_id\n" 2898 2898 " JOIN rawImfile\n" 2899 " ON detInputExp.exp_ tag = rawImfile.exp_tag\n"2899 " ON detInputExp.exp_id = rawImfile.exp_id\n" 2900 2900 " LEFT JOIN detProcessedImfile\n" 2901 2901 " ON detInputExp.det_id = detProcessedImfile.det_id\n" 2902 " AND detInputExp.exp_ tag = detProcessedImfile.exp_tag\n"2902 " AND detInputExp.exp_id = detProcessedImfile.exp_id\n" 2903 2903 " AND rawImfile.class_id = detProcessedImfile.class_id\n" 2904 2904 " LEFT JOIN detStackedImfile\n" … … 3007 3007 " ON detRun.det_id = detInputExp.det_id" 3008 3008 " AND detRun.iteration = detInputExp.iteration" 3009 " AND detProcessedImfile.exp_ tag = detInputExp.exp_tag"3009 " AND detProcessedImfile.exp_id = detInputExp.exp_id" 3010 3010 " JOIN rawExp" 3011 " ON rawExp.exp_ tag = detProcessedImfile.exp_tag"3011 " ON rawExp.exp_id = detProcessedImfile.exp_id" 3012 3012 " WHERE" 3013 3013 ); … … 3213 3213 if (!psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==", 3214 3214 (psS64)atoll(det_id))) { 3215 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_ tag");3215 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 3216 3216 psFree(where); 3217 3217 return false; … … 3377 3377 // by: 3378 3378 // find the current iteration bassed on det_id 3379 // find all exp_ tags in the current det_id/iteration from detInputExp3379 // find all exp_ids in the current det_id/iteration from detInputExp 3380 3380 // sort to detInputExp.imfiles to find the largest value per det_id/iter 3381 3381 // compare imfiles to the number of detStackedImfiles by class_id … … 3407 3407 " AND detRun.iteration = detInputExp.iteration" 3408 3408 " JOIN rawExp" 3409 " ON detInputExp.exp_ tag = rawExp.exp_tag"3409 " ON detInputExp.exp_id = rawExp.exp_id" 3410 3410 " JOIN detStackedImfile" 3411 3411 " ON detInputExp.det_id = detStackedImfile.det_id" … … 3423 3423 " AND detNormalizedStatImfile.class_id IS NULL" 3424 3424 " GROUP BY" 3425 " rawExp.exp_ tag,"3425 " rawExp.exp_id," 3426 3426 " detRun.iteration," 3427 3427 " detRun.det_id" … … 3633 3633 " USING(det_id, iteration)" 3634 3634 " JOIN rawExp" 3635 " ON detInputExp.exp_ tag = rawExp.exp_tag"3635 " ON detInputExp.exp_id = rawExp.exp_id" 3636 3636 " JOIN detNormalizedStatImfile" 3637 3637 " ON detStackedImfile.det_id = detNormalizedStatImfile.det_id" … … 3774 3774 psMetadata *where = psMetadataAlloc(); 3775 3775 for (long i = 0; i < psArrayLength(inputExps); i++) { 3776 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_ tag",3776 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 3777 3777 PS_META_DUPLICATE_OK, "==", 3778 ((detInputExpRow *)inputExps->data[i])->exp_ tag)) {3779 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_ tag");3778 ((detInputExpRow *)inputExps->data[i])->exp_id)) { 3779 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 3780 3780 psFree(inputExps); 3781 3781 psFree(where); … … 3963 3963 " AND detRun.iteration = detInputExp.iteration" 3964 3964 " JOIN rawExp" 3965 " ON detInputExp.exp_ tag = rawExp.exp_tag"3965 " ON detInputExp.exp_id = rawExp.exp_id" 3966 3966 " JOIN detNormalizedImfile" 3967 3967 " ON detInputExp.det_id = detNormalizedImfile.det_id" 3968 3968 " AND detInputExp.iteration = detNormalizedImfile.iteration" 3969 3969 " LEFT JOIN rawImfile" 3970 " ON detInputExp.exp_ tag = rawImfile.exp_tag"3970 " ON detInputExp.exp_id = rawImfile.exp_id" 3971 3971 " AND detNormalizedImfile.class_id = rawImfile.class_id" 3972 3972 " LEFT JOIN detNormalizedExp" … … 4152 4152 " AND detRun.iteration = detInputExp.iteration" 4153 4153 " JOIN rawExp" 4154 " ON detInputExp.exp_ tag = rawExp.exp_tag"4154 " ON detInputExp.exp_id = rawExp.exp_id" 4155 4155 " JOIN detNormalizedImfile" 4156 4156 " ON detInputExp.det_id = detNormalizedImfile.det_id" 4157 4157 " AND detInputExp.iteration = detNormalizedImfile.iteration" 4158 4158 " LEFT JOIN rawImfile" 4159 " ON detInputExp.exp_ tag = rawImfile.exp_tag"4159 " ON detInputExp.exp_id = rawImfile.exp_id" 4160 4160 " AND detNormalizedImfile.class_id = rawImfile.class_id" 4161 4161 " LEFT JOIN detNormalizedExp" … … 4437 4437 " detRun.workdir,\n" 4438 4438 " detRun.reduction,\n" 4439 " detProcessedImfile.exp_ tag,\n"4439 " detProcessedImfile.exp_id,\n" 4440 4440 " detProcessedImfile.class_id,\n" 4441 4441 " detProcessedImfile.uri,\n" … … 4446 4446 " USING(det_id, iteration)\n" 4447 4447 " JOIN rawExp\n" 4448 " ON detInputExp.exp_ tag = rawExp.exp_tag\n"4448 " ON detInputExp.exp_id = rawExp.exp_id\n" 4449 4449 " JOIN detProcessedImfile\n" 4450 4450 " ON detRun.det_id = detProcessedImfile.det_id\n" 4451 " AND detInputExp.exp_ tag = detProcessedImfile.exp_tag\n"4451 " AND detInputExp.exp_id = detProcessedImfile.exp_id\n" 4452 4452 " JOIN detNormalizedImfile\n" 4453 4453 " ON detRun.det_id = detNormalizedImfile.det_id\n" … … 4457 4457 " ON detRun.det_id = detResidImfile.det_id\n" 4458 4458 " AND detRun.iteration = detResidImfile.iteration\n" 4459 " AND detProcessedImfile.exp_ tag = detResidImfile.exp_tag\n"4459 " AND detProcessedImfile.exp_id = detResidImfile.exp_id\n" 4460 4460 " AND detProcessedImfile.class_id = detResidImfile.class_id\n" 4461 4461 " WHERE\n" … … 4465 4465 " AND detResidImfile.det_id IS NULL\n" 4466 4466 " AND detResidImfile.iteration IS NULL\n" 4467 " AND detResidImfile.exp_ tagIS NULL\n"4467 " AND detResidImfile.exp_id IS NULL\n" 4468 4468 " AND detResidImfile.class_id IS NULL\n" 4469 4469 " UNION" … … 4475 4475 " detRun.workdir,\n" 4476 4476 " detRun.reduction,\n" 4477 " rawImfile.exp_ tag,\n"4477 " rawImfile.exp_id,\n" 4478 4478 " rawImfile.class_id,\n" 4479 4479 " rawImfile.uri,\n" … … 4484 4484 " USING(det_id, iteration)\n" 4485 4485 " JOIN rawExp\n" 4486 " ON detInputExp.exp_ tag = rawExp.exp_tag\n"4486 " ON detInputExp.exp_id = rawExp.exp_id\n" 4487 4487 " JOIN rawImfile\n" 4488 " ON detInputExp.exp_ tag = rawImfile.exp_tag\n"4488 " ON detInputExp.exp_id = rawImfile.exp_id\n" 4489 4489 " LEFT JOIN detResidImfile\n" 4490 4490 " ON detRun.det_id = detResidImfile.det_id\n" 4491 4491 " AND detRun.iteration = detResidImfile.iteration\n" 4492 " AND rawImfile.exp_ tag = detResidImfile.exp_tag\n"4492 " AND rawImfile.exp_id = detResidImfile.exp_id\n" 4493 4493 " AND rawImfile.class_id = detResidImfile.class_id\n" 4494 4494 " WHERE\n" … … 4497 4497 " AND detResidImfile.det_id IS NULL\n" 4498 4498 " AND detResidImfile.iteration IS NULL\n" 4499 " AND detResidImfile.exp_ tagIS NULL\n"4499 " AND detResidImfile.exp_id IS NULL\n" 4500 4500 " AND detResidImfile.class_id IS NULL\n" 4501 4501 ); … … 4658 4658 4659 4659 // make sure that there is a coresponding entry in detNormalizedImfile 4660 // and the exp_ tagspecified is valid4660 // and the exp_id specified is valid 4661 4661 // select * from detNormalizedImfile 4662 4662 // by det_id, iteration, class_id … … 4674 4674 " ON detRun.det_id = detResidImfile.det_id\n" 4675 4675 " AND detRun.iteration = detResidImfile.iteration\n" 4676 " AND detInputExp.exp_ tag = detResidImfile.exp_tag\n"4676 " AND detInputExp.exp_id = detResidImfile.exp_id\n" 4677 4677 " AND detNormalizedImfile.class_id = detResidImfile.class_id\n" 4678 4678 " WHERE\n" … … 4681 4681 " AND detResidImfile.det_id IS NULL\n" 4682 4682 " AND detResidImfile.iteration IS NULL\n" 4683 " AND detResidImfile.exp_ tagIS NULL\n"4683 " AND detResidImfile.exp_id IS NULL\n" 4684 4684 " AND detResidImfile.class_id IS NULL\n" 4685 4685 " UNION\n" … … 4703 4703 " USING(det_id, iteration)\n" 4704 4704 " JOIN rawExp\n" 4705 " ON detInputExp.exp_ tag = rawExp.exp_tag\n"4705 " ON detInputExp.exp_id = rawExp.exp_id\n" 4706 4706 " JOIN rawImfile\n" 4707 " ON detInputExp.exp_ tag = rawImfile.exp_tag\n"4707 " ON detInputExp.exp_id = rawImfile.exp_id\n" 4708 4708 " LEFT JOIN detResidImfile\n" 4709 4709 " ON detRun.det_id = detResidImfile.det_id\n" 4710 4710 " AND detRun.iteration = detResidImfile.iteration\n" 4711 " AND rawImfile.exp_ tag = detResidImfile.exp_tag\n"4711 " AND rawImfile.exp_id = detResidImfile.exp_id\n" 4712 4712 " AND rawImfile.class_id = detResidImfile.class_id\n" 4713 4713 " WHERE\n" … … 4716 4716 " AND detResidImfile.det_id IS NULL\n" 4717 4717 " AND detResidImfile.iteration IS NULL\n" 4718 " AND detResidImfile.exp_ tagIS NULL\n"4718 " AND detResidImfile.exp_id IS NULL\n" 4719 4719 " AND detResidImfile.class_id IS NULL\n" 4720 " AND detInputExp.exp_ tag= '%1$s'\n"4720 " AND detInputExp.exp_id = '%1$s'\n" 4721 4721 ") AS foo\n" 4722 4722 " %2$s" … … 4776 4776 psFree(where); 4777 4777 4778 // exp_ tag is manadatory to cross check that this is a exp_tagfor this4778 // exp_id is manadatory to cross check that this is a exp_id for this 4779 4779 // detRun 4780 psString exp_ tag = psMetadataLookupStr(&status, config->args, "-exp_tag");4781 if (!status) { 4782 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_ tag");4780 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id"); 4781 if (!status) { 4782 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id"); 4783 4783 psFree(whereClause); 4784 4784 psFree(query); 4785 4785 return false; 4786 4786 } 4787 if (!exp_ tag) {4788 psError(PS_ERR_UNKNOWN, true, "-exp_ tagis required");4787 if (!exp_id) { 4788 psError(PS_ERR_UNKNOWN, true, "-exp_id is required"); 4789 4789 psFree(whereClause); 4790 4790 psFree(query); … … 4792 4792 } 4793 4793 4794 if (!p_psDBRunQuery(config->dbh, query, exp_ tag, whereClause)) {4794 if (!p_psDBRunQuery(config->dbh, query, exp_id, whereClause)) { 4795 4795 psError(PS_ERR_UNKNOWN, false, "database error"); 4796 4796 psFree(whereClause); … … 4862 4862 4863 4863 bool status = false; 4864 psString exp_ tag = psMetadataLookupStr(&status, config->args, "-exp_tag");4865 if (!status) { 4866 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_ tag");4867 return false; 4868 } 4869 if (!exp_ tag) {4870 psError(PS_ERR_UNKNOWN, true, "-exp_ tagis required");4864 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id"); 4865 if (!status) { 4866 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id"); 4867 return false; 4868 } 4869 if (!exp_id) { 4870 psError(PS_ERR_UNKNOWN, true, "-exp_id is required"); 4871 4871 return false; 4872 4872 } … … 4979 4979 normalizedImfile->det_id, 4980 4980 normalizedImfile->iteration, 4981 exp_tag,4981 (psS64)atoll(exp_id), 4982 4982 normalizedImfile->class_id, 4983 4983 uri, … … 5020 5020 // select detResidImfile.* 5021 5021 // by: 5022 // where det_id, iteration, exp_ tagis not in detResidExp;5022 // where det_id, iteration, exp_id is not in detResidExp; 5023 5023 5024 5024 psString query = psStringCopy( … … 5032 5032 " USING(det_id, iteration)" 5033 5033 " JOIN rawExp" 5034 " USING(exp_ tag)"5034 " USING(exp_id)" 5035 5035 " WHERE" 5036 5036 ); … … 5128 5128 // select detRun.iteration 5129 5129 // select detRun.det_type 5130 // select detInputExp.exp_ tag5130 // select detInputExp.exp_id 5131 5131 // select detInputExp.include 5132 5132 // by: 5133 5133 // find the current iteration bassed on det_id 5134 // find all exp_ tags in the current det_id/iteration from detInputExp5134 // find all exp_ids in the current det_id/iteration from detInputExp 5135 5135 // compare to detInputExp.imfiles to derResidImfile by class_id 5136 5136 // and: 5137 // detResidImfile.{det_id, iteration, exp_ tag} is not in detResidExp5137 // detResidImfile.{det_id, iteration, exp_id} is not in detResidExp 5138 5138 5139 5139 psString query = psStringCopy( … … 5143 5143 " det_type,\n" 5144 5144 " mode,\n" 5145 " exp_ tag,\n"5145 " exp_id,\n" 5146 5146 " include,\n" 5147 5147 " camera,\n" … … 5154 5154 " detRun.mode,\n" 5155 5155 " detRun.workdir,\n" 5156 " detInputExp.exp_ tag,\n"5156 " detInputExp.exp_id,\n" 5157 5157 " detInputExp.include,\n" 5158 5158 " rawExp.imfiles,\n" … … 5163 5163 " USING(det_id, iteration)\n" 5164 5164 " JOIN rawExp\n" 5165 " ON detInputExp.exp_ tag = rawExp.exp_tag\n"5165 " ON detInputExp.exp_id = rawExp.exp_id\n" 5166 5166 " JOIN detResidImfile\n" 5167 5167 " ON detRun.det_id = detResidImfile.det_id\n" 5168 5168 " AND detRun.iteration = detResidImfile.iteration\n" 5169 " AND detInputExp.exp_ tag = detResidImfile.exp_tag\n"5169 " AND detInputExp.exp_id = detResidImfile.exp_id\n" 5170 5170 " LEFT JOIN detResidExp\n" 5171 5171 " ON detResidImfile.det_id = detResidExp.det_id\n" 5172 5172 " AND detResidImfile.iteration = detResidExp.iteration\n" 5173 " AND detResidImfile.exp_ tag = detResidExp.exp_tag\n"5173 " AND detResidImfile.exp_id = detResidExp.exp_id\n" 5174 5174 " WHERE\n" 5175 5175 " detRun.state = 'run'\n" … … 5177 5177 " AND detResidExp.det_id IS NULL\n" 5178 5178 " AND detResidExp.iteration IS NULL\n" 5179 " AND detResidExp.exp_ tagIS NULL\n"5179 " AND detResidExp.exp_id IS NULL\n" 5180 5180 " GROUP BY\n" 5181 " detInputExp.exp_ tag,\n"5181 " detInputExp.exp_id,\n" 5182 5182 " detRun.iteration,\n" 5183 5183 " detRun.det_id\n" … … 5258 5258 // select detRun.iteration 5259 5259 // select detRun.det_type 5260 // select detInputExp.exp_ tag5260 // select detInputExp.exp_id 5261 5261 // select detInputExp.include 5262 5262 // by: 5263 5263 // find the current iteration bassed on det_id 5264 // find all exp_ tags in the current det_id/iteration from detInputExp5264 // find all exp_ids in the current det_id/iteration from detInputExp 5265 5265 // compare to detInputExp.imfiles to derResidImfile by class_id 5266 5266 // and: 5267 // detResidImfile.{det_id, iteration, exp_ tag} is not in detResidExp5267 // detResidImfile.{det_id, iteration, exp_id} is not in detResidExp 5268 5268 5269 5269 psString query = psStringCopy( … … 5271 5271 " det_id," 5272 5272 " iteration," 5273 " exp_ tag,"5273 " exp_id," 5274 5274 " include" 5275 5275 " FROM" … … 5278 5278 " detRun.iteration," 5279 5279 " detRun.det_type," 5280 " detInputExp.exp_ tag,"5280 " detInputExp.exp_id," 5281 5281 " detInputExp.include," 5282 5282 " rawExp.imfiles" … … 5285 5285 " USING(det_id, iteration)" 5286 5286 " JOIN rawExp" 5287 " ON detInputExp.exp_ tag = rawExp.exp_tag"5287 " ON detInputExp.exp_id = rawExp.exp_id" 5288 5288 " JOIN detResidImfile" 5289 5289 " ON detRun.det_id = detResidImfile.det_id" 5290 5290 " AND detRun.iteration = detResidImfile.iteration" 5291 " AND detInputExp.exp_ tag = detResidImfile.exp_tag"5291 " AND detInputExp.exp_id = detResidImfile.exp_id" 5292 5292 " LEFT JOIN detResidExp" 5293 5293 " ON detResidImfile.det_id = detResidExp.det_id" 5294 5294 " AND detResidImfile.iteration = detResidExp.iteration" 5295 " AND detResidImfile.exp_ tag = detResidExp.exp_tag"5295 " AND detResidImfile.exp_id = detResidExp.exp_id" 5296 5296 " WHERE" 5297 5297 " detRun.state = 'run'" 5298 5298 " AND detResidExp.det_id IS NULL" 5299 5299 " AND detResidExp.iteration IS NULL" 5300 " AND detResidExp.exp_ tagIS NULL"5300 " AND detResidExp.exp_id IS NULL" 5301 5301 " GROUP BY" 5302 " detInputExp.exp_ tag,"5302 " detInputExp.exp_id," 5303 5303 " detRun.iteration," 5304 5304 " detRun.det_id" … … 5309 5309 5310 5310 { 5311 // build a query to search by det_id, iteration, exp_ tag5311 // build a query to search by det_id, iteration, exp_id 5312 5312 psMetadata *where = psMetadataAlloc(); 5313 5313 bool status = false; … … 5342 5342 return false; 5343 5343 } 5344 psString exp_ tag = psMetadataLookupStr(&status, config->args, "-exp_tag");5345 if (!status) { 5346 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_ tag");5344 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id"); 5345 if (!status) { 5346 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id"); 5347 5347 psFree(where); 5348 5348 psFree(query); 5349 5349 return false; 5350 5350 } 5351 if (exp_ tag) {5352 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_ tag", 0, "==", exp_tag)) {5353 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_ tag");5351 if (exp_id) { 5352 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==", exp_id)) { 5353 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 5354 5354 psFree(where); 5355 5355 psFree(query); … … 5448 5448 return false; 5449 5449 } 5450 psString exp_ tag = psMetadataLookupStr(&status, row, "exp_tag");5451 if (!status) { 5452 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for exp_ tag");5453 return false; 5454 } 5455 if (!exp_ tag) {5456 psError(PS_ERR_UNKNOWN, true, "exp_ tagis required");5450 psString exp_id = psMetadataLookupStr(&status, row, "exp_id"); 5451 if (!status) { 5452 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for exp_id"); 5453 return false; 5454 } 5455 if (!exp_id) { 5456 psError(PS_ERR_UNKNOWN, true, "exp_id is required"); 5457 5457 return false; 5458 5458 } … … 5565 5565 det_id, 5566 5566 iteration, 5567 exp_tag,5567 (psS64)atoll(exp_id), 5568 5568 recipe, 5569 5569 bg, … … 5611 5611 " USING(det_id, iteration)" 5612 5612 " JOIN detResidExp" 5613 " USING(det_id, iteration, exp_ tag)"5613 " USING(det_id, iteration, exp_id)" 5614 5614 " WHERE" 5615 5615 " detRun.state = 'run'" … … 5697 5697 // by: 5698 5698 // find the current iteration bassed on det_id 5699 // find all exp_ tags in the current det_id/iteration from detInputExp5700 // find all exp_ tags in the current det_id/iteration from detResidExp5701 // compare the counts of exp_ tags5699 // find all exp_ids in the current det_id/iteration from detInputExp 5700 // find all exp_ids in the current det_id/iteration from detResidExp 5701 // compare the counts of exp_ids 5702 5702 5703 5703 psString query = psStringCopy( … … 5716 5716 " detRun.mode,\n" 5717 5717 " detRun.workdir,\n" 5718 " detInputExp.exp_ tag,\n"5718 " detInputExp.exp_id,\n" 5719 5719 " rawExp.camera\n" 5720 5720 " FROM detRun\n" … … 5722 5722 " USING(det_id, iteration)\n" 5723 5723 " JOIN rawExp\n" 5724 " ON detInputExp.exp_ tag = rawExp.exp_tag\n"5724 " ON detInputExp.exp_id = rawExp.exp_id\n" 5725 5725 " LEFT JOIN detResidExp\n" 5726 5726 " ON detRun.det_id = detResidExp.det_id\n" 5727 5727 " AND detRun.iteration = detResidExp.iteration\n" 5728 " AND detInputExp.exp_ tag = detResidExp.exp_tag\n"5728 " AND detInputExp.exp_id = detResidExp.exp_id\n" 5729 5729 " WHERE\n" 5730 5730 " detRun.state = 'run'\n" … … 5733 5733 " detRun.iteration\n" 5734 5734 " HAVING\n" 5735 " COUNT(detResidExp.exp_ tag) = COUNT(detInputExp.exp_tag)\n"5735 " COUNT(detResidExp.exp_id) = COUNT(detInputExp.exp_id)\n" 5736 5736 " ) AS residdetrun\n" 5737 5737 ); … … 5797 5797 PS_ASSERT_PTR_NON_NULL(config, false); 5798 5798 5799 // build a query to search by det_id, iteration, exp_ tag5799 // build a query to search by det_id, iteration, exp_id 5800 5800 psMetadata *where = psMetadataAlloc(); 5801 5801 bool status = false; … … 5825 5825 return false; 5826 5826 } 5827 psString exp_ tag = psMetadataLookupStr(&status, config->args, "-exp_tag");5828 if (!status) { 5829 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_ tag");5827 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id"); 5828 if (!status) { 5829 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id"); 5830 5830 psFree(where); 5831 5831 return false; 5832 5832 } 5833 if (exp_ tag) {5834 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_ tag", 0, "==", exp_tag)) {5835 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_ tag");5833 if (exp_id) { 5834 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==", exp_id)) { 5835 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 5836 5836 psFree(where); 5837 5837 return false; … … 5840 5840 5841 5841 // find the values we're going to set 5842 // copy everything but det_id, iteration, & exp_ tagfrom the args and5842 // copy everything but det_id, iteration, & exp_id from the args and 5843 5843 // remove the '-' prefix 5844 5844 psMetadata *set = psMetadataAlloc(); … … 5957 5957 // by: 5958 5958 // find the current iteration bassed on det_id 5959 // find all exp_ tags in the current det_id/iteration from detInputExp5960 // find all exp_ tags in the current det_id/iteration from detResidExp5961 // compare the counts of exp_ tags5959 // find all exp_ids in the current det_id/iteration from detInputExp 5960 // find all exp_ids in the current det_id/iteration from detResidExp 5961 // compare the counts of exp_ids 5962 5962 5963 5963 psString query = pxDataGet("dettool_find_completed_runs.sql"); … … 5968 5968 5969 5969 { 5970 // build a query to search by det_id, iteration, exp_ tag5970 // build a query to search by det_id, iteration, exp_id 5971 5971 psMetadata *where = psMetadataAlloc(); 5972 5972 bool status = false; … … 6271 6271 // select detRun.det_id 6272 6272 // select detRun.iteration 6273 // select detInputExp.exp_ tag6273 // select detInputExp.exp_id 6274 6274 // select detResidExp.accept 6275 6275 // by: 6276 6276 // find the current iteration bassed on det_id 6277 // find all exp_ tags in the current det_id/iteration from detInputExp6278 // find all exp_ tags in the current det_id/iteration from detResidExp6279 // compare the counts of exp_ tags6277 // find all exp_ids in the current det_id/iteration from detInputExp 6278 // find all exp_ids in the current det_id/iteration from detResidExp 6279 // compare the counts of exp_ids 6280 6280 6281 6281 psString query = psStringCopy( … … 6283 6283 " detRun.det_id AS det_id," 6284 6284 " detRun.iteration," 6285 " detInputExp.exp_ tag,"6285 " detInputExp.exp_id," 6286 6286 " detResidExp.accept" 6287 6287 " FROM detRun" … … 6292 6292 " ON detRun.det_id = detResidExp.det_id" 6293 6293 " AND detRun.iteration = detResidExp.iteration" 6294 " AND detInputExp.exp_ tag = detResidExp.exp_tag"6294 " AND detInputExp.exp_id = detResidExp.exp_id" 6295 6295 " WHERE" 6296 6296 " detRun.state = 'run'" … … 6310 6310 " detRun.det_id," 6311 6311 " detRun.iteration," 6312 " detInputExp.exp_ tag"6312 " detInputExp.exp_id" 6313 6313 " HAVING" 6314 " COUNT(detResidExp.exp_ tag) = COUNT(detInputExp.exp_tag)"6314 " COUNT(detResidExp.exp_id) = COUNT(detInputExp.exp_id)" 6315 6315 ); 6316 6316 … … 6357 6357 for (long i = 0; i < psArrayLength(output); i++) { 6358 6358 psMetadata *row = output->data[i]; 6359 psString exp_ tag = psMetadataLookupStr(&status, row, "exp_tag");6359 psString exp_id = psMetadataLookupStr(&status, row, "exp_id"); 6360 6360 if (!status) { 6361 6361 // rollback … … 6363 6363 psError(PS_ERR_UNKNOWN, false, "database error"); 6364 6364 } 6365 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for exp_ tag");6365 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for exp_id"); 6366 6366 psFree(output); 6367 6367 return false; … … 6383 6383 (psS32)atol(det_id), 6384 6384 newIteration, 6385 exp_tag,6385 (psS64)atoll(exp_id), 6386 6386 accept 6387 6387 ) … … 6424 6424 } 6425 6425 6426 // we have to support multipe exp_ tags6427 psMetadataItem *item = psMetadataLookup(config->args, "-exp_ tag");6426 // we have to support multipe exp_ids 6427 psMetadataItem *item = psMetadataLookup(config->args, "-exp_id"); 6428 6428 if (!item) { 6429 6429 // this shouldn't actually happen when using psArgs 6430 psError(PS_ERR_UNKNOWN, true, "-exp_ tagis required");6431 return false; 6432 } 6433 6434 psList *exp_ tag_list = item->data.list;6430 psError(PS_ERR_UNKNOWN, true, "-exp_id is required"); 6431 return false; 6432 } 6433 6434 psList *exp_id_list = item->data.list; 6435 6435 psMetadata *where = psMetadataAlloc(); 6436 // make sure that -exp_ tagwas parsed correctly6436 // make sure that -exp_id was parsed correctly 6437 6437 // XXX this can be removed someday 6438 6438 if (item->type == PS_DATA_METADATA_MULTI) { … … 6440 6440 psMetadataItem *mItem = NULL; 6441 6441 while ((mItem = psListGetAndIncrement(iter))) { 6442 psString exp_ tag= mItem->data.V;6443 // if exp_ tag is NULL then it means that -exp_taghas not been6442 psString exp_id = mItem->data.V; 6443 // if exp_id is NULL then it means that -exp_id has not been 6444 6444 // specified 6445 if (!exp_ tag) {6445 if (!exp_id) { 6446 6446 psError(PS_ERR_UNKNOWN, true, 6447 "at least one -exp_ tagis required");6447 "at least one -exp_id is required"); 6448 6448 psFree(where); 6449 6449 return false; 6450 6450 } 6451 6451 6452 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_ tag",6453 PS_META_DUPLICATE_OK, "==", exp_ tag)) {6454 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_ tag");6452 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 6453 PS_META_DUPLICATE_OK, "==", exp_id)) { 6454 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 6455 6455 psFree(iter); 6456 6456 psFree(where); … … 6460 6460 psFree(iter); 6461 6461 } else { 6462 psAbort( "-exp_ tagwas not parsed correctly (this should not happen");6463 } 6464 6465 // check that the specified exp_ tags actually exist in the iteration zero6462 psAbort( "-exp_id was not parsed correctly (this should not happen"); 6463 } 6464 6465 // check that the specified exp_ids actually exist in the iteration zero 6466 6466 // detInputExp set 6467 6467 … … 6487 6487 } 6488 6488 6489 // build a hash for the valid exp_tags 6490 psHash *valid_exp_tags = psHashAlloc(psArrayLength(detrendExps)); 6489 // build a hash for the valid exp_ids 6490 psHash *valid_exp_ids = psHashAlloc(psArrayLength(detrendExps)); 6491 // XXX: FIXME! 6492 #if 0 6491 6493 for (long i = 0; i < psArrayLength(detrendExps); i++) { 6492 psHashAdd(valid_exp_ tags,6493 ((detInputExpRow *)detrendExps->data[i])->exp_ tag,6494 psHashAdd(valid_exp_ids, 6495 ((detInputExpRow *)detrendExps->data[i])->exp_id, 6494 6496 detrendExps->data[i] 6495 6497 ); 6496 6498 } 6499 #endif 6497 6500 psFree(detrendExps); 6498 6501 … … 6501 6504 if (!psDBTransaction(config->dbh)) { 6502 6505 psError(PS_ERR_UNKNOWN, false, "database error"); 6503 psFree(valid_exp_ tags);6506 psFree(valid_exp_ids); 6504 6507 return false; 6505 6508 } … … 6512 6515 psError(PS_ERR_UNKNOWN, false, "database error"); 6513 6516 } 6514 psFree(valid_exp_ tags);6515 return false; 6516 } 6517 6518 // check exp_ tags and build up an array of new detInputExp rows at the same6517 psFree(valid_exp_ids); 6518 return false; 6519 } 6520 6521 // check exp_ids and build up an array of new detInputExp rows at the same 6519 6522 // time 6520 psListIterator *iter = psListIteratorAlloc(exp_ tag_list, 0, false);6523 psListIterator *iter = psListIteratorAlloc(exp_id_list, 0, false); 6521 6524 psMetadataItem *mItem = NULL; 6522 psArray *newInputExps = psArrayAllocEmpty(psListLength(exp_ tag_list));6525 psArray *newInputExps = psArrayAllocEmpty(psListLength(exp_id_list)); 6523 6526 while ((mItem = psListGetAndIncrement(iter))) { 6524 detInputExpRow *inputExp = psHashLookup(valid_exp_ tags,6527 detInputExpRow *inputExp = psHashLookup(valid_exp_ids, 6525 6528 (char *)mItem->data.V); 6526 6529 if (!inputExp) { … … 6529 6532 psError(PS_ERR_UNKNOWN, false, "database error"); 6530 6533 } 6531 // invalid exp_ tag6532 psError(PS_ERR_UNKNOWN, false, "exp_ tag%s is invalid for det_id %s",6534 // invalid exp_id 6535 psError(PS_ERR_UNKNOWN, false, "exp_id %s is invalid for det_id %s", 6533 6536 (char *)mItem->data.V, det_id); 6534 6537 psFree(iter); 6535 psFree(valid_exp_ tags);6538 psFree(valid_exp_ids); 6536 6539 return false; 6537 6540 } … … 6539 6542 (psS32)atol(det_id), 6540 6543 newIteration, 6541 inputExp->exp_ tag,6544 inputExp->exp_id, 6542 6545 true // use 6543 6546 ); … … 6546 6549 } 6547 6550 psFree(iter); 6548 psFree(valid_exp_ tags);6551 psFree(valid_exp_ids); 6549 6552 6550 6553 for (long i = 0; i < psArrayLength(newInputExps); i++) { -
trunk/ippTools/src/dettoolConfig.c
r13974 r14023 49 49 // -pending 50 50 psMetadata *pendingArgs = psMetadataAlloc(); 51 psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-exp_ tag", 0,51 psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-exp_id", 0, 52 52 "search by exposure ID", NULL); 53 53 psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-exp_type", 0, … … 66 66 // -definebytag 67 67 psMetadata *definebytagArgs = psMetadataAlloc(); 68 psMetadataAddStr(definebytagArgs, PS_LIST_TAIL, "-exp_ tag",68 psMetadataAddStr(definebytagArgs, PS_LIST_TAIL, "-exp_id", 69 69 PS_META_DUPLICATE_OK, 70 70 "include this exposure (multiple OK, required)", NULL); … … 292 292 psMetadataAddS32(inputArgs, PS_LIST_TAIL, "-iteration", 0, 293 293 "define iteration number", 0); 294 psMetadataAddStr(inputArgs, PS_LIST_TAIL, "-exp_ tag", 0,294 psMetadataAddStr(inputArgs, PS_LIST_TAIL, "-exp_id", 0, 295 295 "search for exp ID", NULL); 296 296 psMetadataAddBool(inputArgs, PS_LIST_TAIL, "-simple", 0, … … 306 306 psMetadataAddStr(toprocessedimfileArgs, PS_LIST_TAIL, "-det_id", 0, 307 307 "search for detrend ID", NULL); 308 psMetadataAddStr(toprocessedimfileArgs, PS_LIST_TAIL, "-exp_ tag", 0,308 psMetadataAddStr(toprocessedimfileArgs, PS_LIST_TAIL, "-exp_id", 0, 309 309 "search for exp ID", NULL); 310 310 psMetadataAddStr(toprocessedimfileArgs, PS_LIST_TAIL, "-class_id", 0, … … 319 319 psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-det_id", 0, 320 320 "define detrend ID (required)", NULL); 321 psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-exp_ tag", 0,321 psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-exp_id", 0, 322 322 "define exp ID (required)", NULL); 323 323 psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-class_id", 0, … … 358 358 psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-det_id", 0, 359 359 "search for detrend ID", NULL); 360 psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-exp_ tag", 0,360 psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-exp_id", 0, 361 361 "search for exp ID", NULL); 362 362 psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-class_id", 0, … … 390 390 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-det_id", 0, 391 391 "define detrend ID (required)", NULL); 392 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-exp_ tag", 0,392 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-exp_id", 0, 393 393 "define detrend ID (required)", NULL); 394 394 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-recip", 0, … … 425 425 psMetadataAddStr(processedexpArgs, PS_LIST_TAIL, "-det_id", 0, 426 426 "define detrend ID", NULL); 427 psMetadataAddStr(processedexpArgs, PS_LIST_TAIL, "-exp_ tag", 0,427 psMetadataAddStr(processedexpArgs, PS_LIST_TAIL, "-exp_id", 0, 428 428 "define detrend ID", NULL); 429 429 psMetadataAddU64(processedexpArgs, PS_LIST_TAIL, "-limit", 0, … … 645 645 psMetadataAddS32(addresidimfileArgs, PS_LIST_TAIL, "-iteration", 0, 646 646 "define iteration number", 0); 647 psMetadataAddStr(addresidimfileArgs, PS_LIST_TAIL, "-exp_ tag", 0,647 psMetadataAddStr(addresidimfileArgs, PS_LIST_TAIL, "-exp_id", 0, 648 648 "define detrend ID (required)", NULL); 649 649 psMetadataAddStr(addresidimfileArgs, PS_LIST_TAIL, "-class_id", 0, … … 688 688 psMetadataAddS32(residimfileArgs, PS_LIST_TAIL, "-iteration", 0, 689 689 "search for iteration number", 0); 690 psMetadataAddStr(residimfileArgs, PS_LIST_TAIL, "-exp_ tag", 0,690 psMetadataAddStr(residimfileArgs, PS_LIST_TAIL, "-exp_id", 0, 691 691 "define detrend ID", NULL); 692 692 psMetadataAddStr(residimfileArgs, PS_LIST_TAIL, "-class_id", 0, … … 709 709 psMetadataAddS32(addresidexpArgs, PS_LIST_TAIL, "-iteration", 0, 710 710 "define iteration number", 0); 711 psMetadataAddStr(addresidexpArgs, PS_LIST_TAIL, "-exp_ tag", 0,711 psMetadataAddStr(addresidexpArgs, PS_LIST_TAIL, "-exp_id", 0, 712 712 "define detrend ID (required)", NULL); 713 713 psMetadataAddStr(addresidexpArgs, PS_LIST_TAIL, "-recip", 0, … … 750 750 psMetadataAddS32(residexpArgs, PS_LIST_TAIL, "-iteration", 0, 751 751 "search for iteration number", 0); 752 psMetadataAddStr(residexpArgs, PS_LIST_TAIL, "-exp_ tag", 0,752 psMetadataAddStr(residexpArgs, PS_LIST_TAIL, "-exp_id", 0, 753 753 "search for exp ID", NULL); 754 754 psMetadataAddStr(residexpArgs, PS_LIST_TAIL, "-recip", 0, … … 776 776 psMetadataAddS32(updateresidexpArgs, PS_LIST_TAIL, "-iteration", 0, 777 777 "define iteration number", 0); 778 psMetadataAddStr(updateresidexpArgs, PS_LIST_TAIL, "-exp_ tag", 0,778 psMetadataAddStr(updateresidexpArgs, PS_LIST_TAIL, "-exp_id", 0, 779 779 "define exp ID", NULL); 780 780 psMetadataAddStr(updateresidexpArgs, PS_LIST_TAIL, "-recip", 0, … … 834 834 psMetadataAddStr(rerunArgs, PS_LIST_TAIL, "-det_id", 0, 835 835 "search for detrend master for detrend ID (required)", NULL); 836 psMetadataAddStr(rerunArgs, PS_LIST_TAIL, "-exp_ tag", PS_META_DUPLICATE_OK,836 psMetadataAddStr(rerunArgs, PS_LIST_TAIL, "-exp_id", PS_META_DUPLICATE_OK, 837 837 "include this exposure (multiple OK, required)", NULL); 838 838 … … 999 999 } 1000 1000 addWhereStr(det_type); 1001 addWhereStr(exp_ tag);1001 addWhereStr(exp_id); 1002 1002 addWhereStr(class_id); 1003 1003 // convert '-inst' to 'camera' -
trunk/ippTools/src/guidetool.c
r12025 r14023 185 185 186 186 return guidePendingExpRowAlloc( 187 exp->exp_ tag,187 exp->exp_id, 188 188 exp->camera, 189 189 exp->telescope, -
trunk/ippTools/src/guidetoolConfig.c
r12025 r14023 52 52 // -pending search 53 53 psMetadata *pendingArgs = psMetadataAlloc(); 54 psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-exp_ tag", 0,54 psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-exp_id", 0, 55 55 "define exposure ID", NULL); 56 56 psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-inst", 0, … … 71 71 // -define inputs 72 72 psMetadata *defineArgs = psMetadataAlloc(); 73 psMetadataAddStr(defineArgs, PS_LIST_TAIL, "-exp_ tag", 0,73 psMetadataAddStr(defineArgs, PS_LIST_TAIL, "-exp_id", 0, 74 74 "define class", NULL); 75 75 psMetadataAddStr(defineArgs, PS_LIST_TAIL, "-inst", 0, … … 163 163 bool status = false; 164 164 165 addWhereStr(exp_ tag);165 addWhereStr(exp_id); 166 166 // convert '-inst' to 'camera' 167 167 if ((str = psMetadataLookupStr(&status, config->args, "-inst"))) { -
trunk/ippTools/src/pxcam.c
r14018 r14023 66 66 PS_ASSERT_PTR_NON_NULL(config, false); 67 67 68 // load the SQL to enqueue our exp_ tags from disk once68 // load the SQL to enqueue our exp_ids from disk once 69 69 static psString query = NULL; 70 70 if (!query) { -
trunk/ippTools/src/pxchip.c
r14018 r14023 57 57 58 58 bool pxchipQueueByExpTag(pxConfig *config, 59 psString exp_ tag,59 psString exp_id, 60 60 psString workdir, 61 61 psString label, … … 96 96 #endif 97 97 98 // populate the chipInputImfile table from rawImfile based on exp_ tag,98 // populate the chipInputImfile table from rawImfile based on exp_id, 99 99 // where the coresponding newExp.state entry is set to stop 100 100 psString query = pxDataGetCached("chiptool_queuerawimfile.sql"); … … 104 104 } 105 105 106 // queue the imfiles for the exp_ tag107 if (!p_psDBRunQuery(config->dbh, query, exp_ tag)) {106 // queue the imfiles for the exp_id 107 if (!p_psDBRunQuery(config->dbh, query, exp_id)) { 108 108 psError(PS_ERR_UNKNOWN, false, "database error"); 109 109 return false; -
trunk/ippTools/src/pxchip.h
r14018 r14023 28 28 29 29 bool pxchipQueueByExpTag(pxConfig *config, 30 psString exp_ tag,30 psString exp_id, 31 31 psString workdir, 32 32 psString label, -
trunk/ippTools/src/pxinject.c
r14018 r14023 80 80 81 81 bool status = false; 82 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");83 if (!status) { 84 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for - exp_id");85 return false; 86 } 87 if (! exp_id) {88 psError(PS_ERR_UNKNOWN, true, "- exp_idis required");89 return false; 90 } 91 psString camera = psMetadataLookupStr(&status, config->args, "-inst");92 if (!status) { 93 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for - inst");94 return false; 95 } 96 if (! camera) {97 psError(PS_ERR_UNKNOWN, true, "- inst is required");98 return false; 99 } 100 psString t elescope = psMetadataLookupStr(&status, config->args, "-telescope");101 if (!status) { 102 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -t elescope");103 return false; 104 } 105 if (!t elescope) {106 psError(PS_ERR_UNKNOWN, true, "-t elescope is required");82 psString tmp_exp_name = psMetadataLookupStr(&status, config->args, "-tmp_exp_name"); 83 if (!status) { 84 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -tmp_exp_name"); 85 return false; 86 } 87 if (!tmp_exp_name) { 88 psError(PS_ERR_UNKNOWN, true, "-tmp_exp_name is required"); 89 return false; 90 } 91 psString tmp_camera = psMetadataLookupStr(&status, config->args, "-tmp_inst"); 92 if (!status) { 93 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -tmp_inst"); 94 return false; 95 } 96 if (!tmp_camera) { 97 psError(PS_ERR_UNKNOWN, true, "-tmp_inst is required"); 98 return false; 99 } 100 psString tmp_telescope = psMetadataLookupStr(&status, config->args, "-tmp_telescope"); 101 if (!status) { 102 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -tmp_telescope"); 103 return false; 104 } 105 if (!tmp_telescope) { 106 psError(PS_ERR_UNKNOWN, true, "-tmp_telescope is required"); 107 107 return false; 108 108 } … … 127 127 } 128 128 129 psString exp_tag = pxGenExpTag(config, exp_id);130 if (!exp_tag) {131 psError(PS_ERR_UNKNOWN, false, "database error");132 return false;133 }134 135 129 if (!newExpInsert(config->dbh, 136 exp_tag,137 exp_id,130 0x0, // exp_id 131 tmp_exp_name, 138 132 "reg", // state 139 camera,140 t elescope,133 tmp_camera, 134 tmp_telescope, 141 135 imfiles, 142 136 workdir, … … 145 139 ) { 146 140 psError(PS_ERR_UNKNOWN, false, "database error"); 147 psFree(exp_tag); 148 return false; 149 } 141 return false; 142 } 143 144 psS64 lastInsertID = psDBLastInsertID(config->dbh); 145 psString exp_id = psDBIntToString(lastInsertID); 150 146 151 147 psMetadata *md = psMetadataAlloc(); 152 if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_ tag", 0, NULL, exp_tag)) {153 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_ tag");148 if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_id", 0, NULL, exp_id)) { 149 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 154 150 psFree(md); 155 psFree(exp_tag); 156 psFree(md); 157 } 158 psFree(exp_tag); 151 psFree(exp_id); 152 } 153 psFree(exp_id); 159 154 160 155 bool simple = false; … … 186 181 187 182 bool status = false; 188 psString exp_ tag = psMetadataLookupStr(&status, config->args, "-exp_tag");189 if (!status) { 190 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_ tag");191 return false; 192 } 193 if (!exp_ tag) {194 psError(PS_ERR_UNKNOWN, true, "-exp_ tagis required");183 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id"); 184 if (!status) { 185 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id"); 186 return false; 187 } 188 if (!exp_id) { 189 psError(PS_ERR_UNKNOWN, true, "-exp_id is required"); 195 190 return false; 196 191 } … … 206 201 } 207 202 #endif 208 psString class_id = psMetadataLookupStr(&status, config->args, "-class_id");209 if (!status) { 210 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for - class_id");211 return false; 212 } 213 if (! class_id) {214 psError(PS_ERR_UNKNOWN, true, "- class_id is required");203 psString tmp_class_id = psMetadataLookupStr(&status, config->args, "-tmp_class_id"); 204 if (!status) { 205 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -tmp_class_id"); 206 return false; 207 } 208 if (!tmp_class_id) { 209 psError(PS_ERR_UNKNOWN, true, "-tmp_class_id is required"); 215 210 return false; 216 211 } … … 226 221 227 222 // insert with error flag state set to 0 (no errors) 228 if (!newImfileInsert(config->dbh, exp_tag,class_id, uri)) {223 if (!newImfileInsert(config->dbh, (psS64)atoll(exp_id), tmp_class_id, uri)) { 229 224 psError(PS_ERR_UNKNOWN, false, "database error"); 230 225 return false; … … 240 235 241 236 bool status = false; 242 psString exp_ tag = psMetadataLookupStr(&status, config->args, "-exp_tag");243 if (!status) { 244 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_ tag");245 return false; 246 } 247 if (!exp_ tag) {248 psError(PS_ERR_UNKNOWN, true, "-exp_ tagis required");237 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id"); 238 if (!status) { 239 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id"); 240 return false; 241 } 242 if (!exp_id) { 243 psError(PS_ERR_UNKNOWN, true, "-exp_id is required"); 249 244 return false; 250 245 } … … 262 257 if (state) { 263 258 // set detRun.state to state 264 return pxnewExpSetState(config, exp_ tag, state);259 return pxnewExpSetState(config, exp_id, state); 265 260 } 266 261 -
trunk/ippTools/src/pxinjectConfig.c
r14018 r14023 45 45 // -newExp 46 46 psMetadata *newExpArgs = psMetadataAlloc(); 47 psMetadataAddStr(newExpArgs, PS_LIST_TAIL, "- exp_id", 0,48 "define the exp_ id(required)", NULL);49 psMetadataAddStr(newExpArgs, PS_LIST_TAIL, "- inst", 0,47 psMetadataAddStr(newExpArgs, PS_LIST_TAIL, "-tmp_exp_name", 0, 48 "define the exp_name (required)", NULL); 49 psMetadataAddStr(newExpArgs, PS_LIST_TAIL, "-tmp_inst", 0, 50 50 "define the camera name (required)", NULL); 51 psMetadataAddStr(newExpArgs, PS_LIST_TAIL, "-t elescope", 0,51 psMetadataAddStr(newExpArgs, PS_LIST_TAIL, "-tmp_telescope", 0, 52 52 "define the telescope name (required)", NULL); 53 53 psMetadataAddS32(newExpArgs, PS_LIST_TAIL, "-imfiles", 0, … … 60 60 // -newImfile 61 61 psMetadata *newImfileArgs = psMetadataAlloc(); 62 psMetadataAddStr(newImfileArgs, PS_LIST_TAIL, "-exp_ tag", 0,63 "define the exp_ tag(required)", NULL);62 psMetadataAddStr(newImfileArgs, PS_LIST_TAIL, "-exp_id", 0, 63 "define the exp_id (required)", NULL); 64 64 #if 0 65 65 psMetadataAddStr(newImfileArgs, PS_LIST_TAIL, "-class", 0, 66 66 "define the class (required)", NULL); 67 67 #endif 68 psMetadataAddStr(newImfileArgs, PS_LIST_TAIL, "- class_id", 0,68 psMetadataAddStr(newImfileArgs, PS_LIST_TAIL, "-tmp_class_id", 0, 69 69 "define the class ID (required)", NULL); 70 70 psMetadataAddStr(newImfileArgs, PS_LIST_TAIL, "-uri", 0, … … 73 73 // -updatenewExp 74 74 psMetadata *updatenewExpArgs = psMetadataAlloc(); 75 psMetadataAddStr(updatenewExpArgs, PS_LIST_TAIL, "-exp_ tag", 0,76 "define the exp_ tag(required)", NULL);75 psMetadataAddStr(updatenewExpArgs, PS_LIST_TAIL, "-exp_id", 0, 76 "define the exp_id (required)", NULL); 77 77 psMetadataAddStr(updatenewExpArgs, PS_LIST_TAIL, "-state", 0, 78 78 "set state (required)", NULL); … … 127 127 } 128 128 addWhereStr(det_type); 129 addWhereStr(exp_ tag);129 addWhereStr(exp_id); 130 130 addWhereStr(class_id); 131 131 // convert '-inst' to 'camera' -
trunk/ippTools/src/pxregister.c
r14018 r14023 29 29 #include "pxregister.h" 30 30 31 bool pxnewExpSetState(pxConfig *config, const char *exp_ tag, const char *state)31 bool pxnewExpSetState(pxConfig *config, const char *exp_id, const char *state) 32 32 { 33 PS_ASSERT_PTR_NON_NULL(exp_ tag, false);33 PS_ASSERT_PTR_NON_NULL(exp_id, false); 34 34 PS_ASSERT_PTR_NON_NULL(state, false); 35 35 … … 46 46 } 47 47 48 char *query = "UPDATE newExp SET state = '%s' WHERE exp_ tag= '%s'";49 if (!p_psDBRunQuery(config->dbh, query, state, exp_ tag)) {48 char *query = "UPDATE newExp SET state = '%s' WHERE exp_id = '%s'"; 49 if (!p_psDBRunQuery(config->dbh, query, state, exp_id)) { 50 50 psError(PS_ERR_UNKNOWN, false, 51 "failed to change state for exp_ tag %s", exp_tag);51 "failed to change state for exp_id %s", exp_id); 52 52 return false; 53 53 } -
trunk/ippTools/src/pxregister.h
r14018 r14023 25 25 #include "pxtools.h" 26 26 27 bool pxnewExpSetState(pxConfig *config, const char *exp_ tag, const char *state);27 bool pxnewExpSetState(pxConfig *config, const char *exp_id, const char *state); 28 28 29 29 #endif // PXREGISTER_H -
trunk/ippTools/src/pxtables.c
r14018 r14023 43 43 44 44 bool status = true; 45 #if 0 45 46 CREATE_TABLE(expTagCounterCreateTable); 46 47 // the counter must be initialized to 0 … … 49 50 status = false; 50 51 } 52 #endif 51 53 CREATE_TABLE(summitExpCreateTable); 52 54 CREATE_TABLE(summitImfileCreateTable); … … 129 131 } 130 132 131 DROP_TABLE(expTagCounterDropTable);133 // DROP_TABLE(expTagCounterDropTable); 132 134 DROP_TABLE(summitExpDropTable); 133 135 DROP_TABLE(summitImfileDropTable); -
trunk/ippTools/src/pxtag.c
r10709 r14023 27 27 #include "pxtag.h" 28 28 29 psString pxGenExpTag(pxConfig *config, const char *exp_ id)29 psString pxGenExpTag(pxConfig *config, const char *exp_name) 30 30 { 31 31 PS_ASSERT_PTR_NON_NULL(config, NULL); … … 95 95 return NULL; 96 96 } 97 psString exp_ tag= NULL;98 psStringAppend(&exp_ tag, "%s.%" PRIu64, exp_id, counter);97 psString exp_id = NULL; 98 psStringAppend(&exp_id, "%s.%" PRIu64, exp_name, counter); 99 99 psFree(output); 100 100 101 return exp_ tag;101 return exp_id; 102 102 } -
trunk/ippTools/src/pxtag.h
r14018 r14023 25 25 #include "pxconfig.h" 26 26 27 psString pxGenExpTag(pxConfig *config, const char *exp_ id);27 psString pxGenExpTag(pxConfig *config, const char *exp_name); 28 28 29 29 #endif // PXTAG_H -
trunk/ippTools/src/pzgetexp.c
r12093 r14023 68 68 { 69 69 PS_ASSERT_PTR_NON_NULL(config, NULL); 70 // find last fileset/exp_ id(if we have one)70 // find last fileset/exp_name (if we have one) 71 71 bool haveLastFileSet = false; 72 72 psString lastFileSet = NULL; … … 90 90 haveLastFileSet = true; 91 91 bool status = false; 92 lastFileSet = psStringCopy(psMetadataLookupStr(&status, output->data[0], "exp_ id"));92 lastFileSet = psStringCopy(psMetadataLookupStr(&status, output->data[0], "exp_name")); 93 93 psFree(output); 94 94 } … … 142 142 { 143 143 char *query = "CREATE TEMPORARY TABLE incoming" 144 " (exp_ id VARCHAR(64), camera VARCHAR(64), telescope VARCHAR(64), dateobs DATETIME, exp_type VARCHAR(64), uri VARCHAR(255), PRIMARY KEY(exp_id, camera, telescope))"144 " (exp_name VARCHAR(64), camera VARCHAR(64), telescope VARCHAR(64), dateobs DATETIME, exp_type VARCHAR(64), uri VARCHAR(255), PRIMARY KEY(exp_name, camera, telescope))" 145 145 " ENGINE=MEMORY"; 146 146 if (!p_psDBRunQuery(config->dbh, query)) { … … 156 156 157 157 { 158 char *query = "INSERT INTO incoming (exp_ id, camera, telescope, dateobs, exp_type, uri) VALUES (?, ?, ?, ?, ?, ?)";158 char *query = "INSERT INTO incoming (exp_name, camera, telescope, dateobs, exp_type, uri) VALUES (?, ?, ?, ?, ?, ?)"; 159 159 160 160 long inserted = p_psDBRunQueryPrepared(config->dbh, newSummitExps, query); … … 188 188 "INSERT INTO pzPendingExp" 189 189 " SElECT" 190 " incoming.exp_ id,"190 " incoming.exp_name," 191 191 " incoming.camera," 192 192 " incoming.telescope" 193 193 " FROM incoming" 194 194 " LEFT JOIN summitExp" 195 " USING(exp_ id, camera, telescope)"195 " USING(exp_name, camera, telescope)" 196 196 " WHERE" 197 " summitExp.exp_ idis NULL"197 " summitExp.exp_name is NULL" 198 198 " AND summitExp.camera is NULL" 199 199 " AND summitExp.telescope is NULL"; … … 218 218 " FROM incoming" 219 219 " LEFT JOIN summitExp" 220 " USING(exp_ id, camera, telescope)"220 " USING(exp_name, camera, telescope)" 221 221 " WHERE" 222 " summitExp.exp_ idis NULL"222 " summitExp.exp_name is NULL" 223 223 " AND summitExp.camera is NULL" 224 224 " AND summitExp.telescope is NULL"; … … 296 296 psListIterator *tokenCursor = psListIteratorAlloc(tokens, 0, false); 297 297 char *uri = psListGetAndIncrement(tokenCursor); 298 char *exp_ id= psListGetAndIncrement(tokenCursor); // fileset298 char *exp_name = psListGetAndIncrement(tokenCursor); // fileset 299 299 char *dateobsStr= psListGetAndIncrement(tokenCursor); // datetime 300 300 char *exp_type = psListGetAndIncrement(tokenCursor); // type … … 302 302 // create a new metadata to represent this line and it's values 303 303 psMetadata *md = psMetadataAlloc(); 304 if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_ id", 0, NULL, exp_id)) {305 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_ id");304 if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_name", 0, NULL, exp_name)) { 305 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_name"); 306 306 psFree(md); 307 307 psFree(tokenCursor); -
trunk/ippTools/src/pzgetimfiles.c
r12131 r14023 161 161 "UPDATE summitExp" 162 162 " SET imfiles = %d" 163 " WHERE exp_ id= '%s'"163 " WHERE exp_name = '%s'" 164 164 " AND camera = '%s'" 165 165 " AND telescope = '%s'"; … … 178 178 "DELETE FROM pzPendingExp" 179 179 " WHERE" 180 " exp_ id= '%s'"180 " exp_name = '%s'" 181 181 " AND camera = '%s'" 182 182 " AND telescope = '%s'"; … … 220 220 { 221 221 char *query = 222 "CREATE TEMPORARY TABLE incoming (exp_ id VARCHAR(64), camera VARCHAR(64), telescope VARCHAR(64), file_id VARCHAR(64), bytes INT, md5sum VARCHAR(32), class VARCHAR(64), class_id VARCHAR(64), uri VARCHAR(255), PRIMARY KEY(exp_id, camera, telescope, class, class_id)) ENGINE=MEMORY";222 "CREATE TEMPORARY TABLE incoming (exp_name VARCHAR(64), camera VARCHAR(64), telescope VARCHAR(64), file_id VARCHAR(64), bytes INT, md5sum VARCHAR(32), class VARCHAR(64), class_id VARCHAR(64), uri VARCHAR(255), PRIMARY KEY(exp_name, camera, telescope, class, class_id)) ENGINE=MEMORY"; 223 223 224 224 if (!p_psDBRunQuery(config->dbh, query)) { … … 235 235 // load the imfiles (files) into the temp table 236 236 { 237 char *query = "INSERT INTO incoming (exp_ id, camera, telescope, file_id, bytes, md5sum, class, class_id, uri) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)";237 char *query = "INSERT INTO incoming (exp_name, camera, telescope, file_id, bytes, md5sum, class, class_id, uri) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"; 238 238 239 239 long inserted = p_psDBRunQueryPrepared(config->dbh, newImfiles, query); … … 270 270 "INSERT INTO pzPendingImfile" 271 271 " SElECT" 272 " incoming.exp_ id,"272 " incoming.exp_name," 273 273 " incoming.camera," 274 274 " incoming.telescope," 275 275 " incoming.class," 276 276 " incoming.class_id," 277 " NULL" // exp_ tag, will be assigned later277 " NULL" // exp_id, will be assigned later 278 278 " FROM incoming" 279 279 " JOIN pzPendingExp" 280 " USING(exp_ id, camera, telescope)"280 " USING(exp_name, camera, telescope)" 281 281 " LEFT JOIN summitImfile" 282 " USING(exp_ id, camera, telescope, class, class_id)"282 " USING(exp_name, camera, telescope, class, class_id)" 283 283 " WHERE" 284 " summitImfile.exp_ idis NULL"284 " summitImfile.exp_name is NULL" 285 285 " AND summitImfile.camera is NULL" 286 286 " AND summitImfile.telescope is NULL" … … 303 303 "INSERT INTO summitImfile" 304 304 " SElECT" 305 " incoming.exp_ id,"305 " incoming.exp_name," 306 306 " incoming.camera," 307 307 " incoming.telescope," … … 314 314 " FROM incoming" 315 315 " LEFT JOIN summitImfile" 316 " USING(exp_ id, camera, telescope, class, class_id)"316 " USING(exp_name, camera, telescope, class, class_id)" 317 317 " WHERE" 318 " summitImfile.exp_ idis NULL"318 " summitImfile.exp_name is NULL" 319 319 " AND summitImfile.camera is NULL" 320 320 " AND summitImfile.telescope is NULL" … … 338 338 " SET imfiles = (SELECT COUNT(*) FROM summitImfile" 339 339 " WHERE" 340 " exp_ id= '%s'"340 " exp_name = '%s'" 341 341 " AND camera = '%s'" 342 342 " AND telescope = '%s'" 343 343 ")" 344 344 " WHERE" 345 " exp_ id= '%s'"345 " exp_name = '%s'" 346 346 " AND camera = '%s'" 347 347 " AND telescope = '%s'"; … … 367 367 } 368 368 369 // copy the summitExp row into newExp in order to create a new exp_ tag370 { 371 psString exp_ tag= pxGenExpTag(config, filesetid);372 if (!exp_ tag) {369 // copy the summitExp row into newExp in order to create a new exp_id 370 { 371 psString exp_id = pxGenExpTag(config, filesetid); 372 if (!exp_id) { 373 373 // rollback 374 374 if (!psDBRollback(config->dbh)) { … … 382 382 "INSERT INTO newExp" 383 383 " SElECT" 384 " '%s'," // exp_ tag385 " summitExp.exp_ id,"384 " '%s'," // exp_id 385 " summitExp.exp_name," 386 386 " summitExp.camera," 387 387 " summitExp.telescope," … … 392 392 " FROM summitExp" 393 393 " WHERE" 394 " summitExp.exp_ id= '%s'"394 " summitExp.exp_name = '%s'" 395 395 " AND summitExp.camera = '%s'" 396 396 " AND summitExp.telescope = '%s'"; 397 397 398 if (!p_psDBRunQuery(config->dbh, query, exp_ tag, filesetid, camera, telescope)) {399 // rollback 400 if (!psDBRollback(config->dbh)) { 401 psError(PS_ERR_UNKNOWN, false, "database error"); 402 } 403 psError(PS_ERR_UNKNOWN, false, "database error"); 404 psFree(exp_ tag);405 return false; 406 } 407 psFree(exp_ tag);398 if (!p_psDBRunQuery(config->dbh, query, exp_id, filesetid, camera, telescope)) { 399 // rollback 400 if (!psDBRollback(config->dbh)) { 401 psError(PS_ERR_UNKNOWN, false, "database error"); 402 } 403 psError(PS_ERR_UNKNOWN, false, "database error"); 404 psFree(exp_id); 405 return false; 406 } 407 psFree(exp_id); 408 408 409 409 // sanity check: we should have inserted only one row … … 419 419 } 420 420 421 // set the exp_ tagfor the imfiles (files) in the exposure (fileset) that421 // set the exp_id for the imfiles (files) in the exposure (fileset) that 422 422 // we are investigating 423 423 { 424 424 char *query = 425 425 "UPDATE pzPendingImfile" 426 " SET exp_ tag = (SELECT exp_tagfrom newExp"427 " WHERE exp_ id= '%s'"426 " SET exp_id = (SELECT exp_id from newExp" 427 " WHERE exp_name = '%s'" 428 428 " AND camera = '%s'" 429 429 " AND telescope = '%s')" 430 430 " WHERE" 431 " exp_ id= '%s'"431 " exp_name = '%s'" 432 432 " AND camera = '%s'" 433 433 " AND telescope = '%s'"; … … 450 450 " FROM pzPendingExp" 451 451 " WHERE" 452 " pzPendingExp.exp_ id= '%s'"452 " pzPendingExp.exp_name = '%s'" 453 453 " AND pzPendingExp.camera = '%s'" 454 454 " AND pzPendingExp.telescope = '%s'"; … … 479 479 "DELETE FROM pzPendingExp" 480 480 " WHERE" 481 " exp_ id= '%s'"481 " exp_name = '%s'" 482 482 " AND camera = '%s'" 483 483 " AND telescope = '%s'"; … … 524 524 // any work 525 525 bool status = false; 526 psString exp_ id= psMetadataLookupStr(&status, config->args, "-filesetid");526 psString exp_name = psMetadataLookupStr(&status, config->args, "-filesetid"); 527 527 if (!status) { 528 528 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for '-filesetid'"); 529 529 return NULL; 530 530 } 531 if (!exp_ id) {531 if (!exp_name) { 532 532 psError(PS_ERR_UNKNOWN, true, "-filesetid is required"); 533 533 return NULL; … … 596 596 // create a new metadata to represent this line and it's values 597 597 psMetadata *md = psMetadataAlloc(); 598 if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_ id", 0, NULL, exp_id)) {599 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_ id");598 if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_name", 0, NULL, exp_name)) { 599 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_name"); 600 600 psFree(md); 601 601 psFree(tokenCursor); -
trunk/ippTools/src/pztool.c
r12093 r14023 140 140 " FROM pzPendingExp" 141 141 " JOIN summitExp" 142 " USING(exp_ id, camera, telescope)"142 " USING(exp_name, camera, telescope)" 143 143 ); 144 144 … … 197 197 "SELECT" 198 198 " summitImfile.*," 199 " pzPendingImfile.exp_ tag"199 " pzPendingImfile.exp_id" 200 200 " FROM pzPendingImfile" 201 201 " JOIN summitImfile" 202 " USING(exp_ id, camera, telescope, class, class_id)"202 " USING(exp_name, camera, telescope, class, class_id)" 203 203 ); 204 204 … … 255 255 256 256 bool status = false; 257 psString exp_ id = psMetadataLookupStr(&status, config->args, "-exp_id");258 if (!status) { 259 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_ id");260 return false; 261 } 262 if (!exp_ id) {263 psError(PS_ERR_UNKNOWN, true, "-exp_ idis required");257 psString exp_name = psMetadataLookupStr(&status, config->args, "-exp_name"); 258 if (!status) { 259 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_name"); 260 return false; 261 } 262 if (!exp_name) { 263 psError(PS_ERR_UNKNOWN, true, "-exp_name is required"); 264 264 return false; 265 265 } … … 315 315 } 316 316 317 // need to know exp_ id, camera, telescope, class, class_id (to find the317 // need to know exp_name, camera, telescope, class, class_id (to find the 318 318 // pzPendingImfile entry and the URI for the newImfile entry. 319 319 … … 329 329 "INSERT INTO newImfile" 330 330 " SElECT" 331 " pzPendingImfile.exp_ tag,"331 " pzPendingImfile.exp_id," 332 332 " pzPendingImfile.class," 333 333 " pzPendingImfile.class_id," … … 336 336 " FROM pzPendingImfile" 337 337 " WHERE" 338 " pzPendingImfile.exp_ id= '%s'"338 " pzPendingImfile.exp_name = '%s'" 339 339 " AND pzPendingImfile.camera = '%s'" 340 340 " AND pzPendingImfile.telescope = '%s'" … … 342 342 " AND pzPendingImfile.class_id = '%s'"; 343 343 344 if (!p_psDBRunQuery(config->dbh, query, uri, exp_ id, camera, telescope, class, class_id)) {344 if (!p_psDBRunQuery(config->dbh, query, uri, exp_name, camera, telescope, class, class_id)) { 345 345 // rollback 346 346 if (!psDBRollback(config->dbh)) { … … 372 372 " FROM pzPendingImfile" 373 373 " WHERE" 374 " pzPendingImfile.exp_ id= '%s'"374 " pzPendingImfile.exp_name = '%s'" 375 375 " AND pzPendingImfile.camera = '%s'" 376 376 " AND pzPendingImfile.telescope = '%s'" … … 378 378 " AND pzPendingImfile.class_id = '%s'"; 379 379 380 if (!p_psDBRunQuery(config->dbh, query, uri, exp_ id, camera, telescope, class, class_id)) {380 if (!p_psDBRunQuery(config->dbh, query, uri, exp_name, camera, telescope, class, class_id)) { 381 381 // rollback 382 382 if (!psDBRollback(config->dbh)) { … … 404 404 "DELETE FROM pzPendingImfile" 405 405 " WHERE" 406 " pzPendingImfile.exp_ id= '%s'"406 " pzPendingImfile.exp_name = '%s'" 407 407 " AND pzPendingImfile.camera = '%s'" 408 408 " AND pzPendingImfile.telescope = '%s'" … … 410 410 " AND pzPendingImfile.class_id = '%s'"; 411 411 412 if (!p_psDBRunQuery(config->dbh, query, exp_ id, camera, telescope, class, class_id)) {412 if (!p_psDBRunQuery(config->dbh, query, exp_name, camera, telescope, class, class_id)) { 413 413 // rollback 414 414 if (!psDBRollback(config->dbh)) { -
trunk/ippTools/src/pztoolConfig.c
r11860 r14023 45 45 // -seen 46 46 psMetadata *seenArgs = psMetadataAlloc(); 47 psMetadataAddStr(seenArgs, PS_LIST_TAIL, "-exp_ tag", 0,47 psMetadataAddStr(seenArgs, PS_LIST_TAIL, "-exp_id", 0, 48 48 "define exposure ID", NULL); 49 49 psMetadataAddStr(seenArgs, PS_LIST_TAIL, "-inst", 0, … … 58 58 // -pendingexp 59 59 psMetadata *pendingexpArgs = psMetadataAlloc(); 60 psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-exp_ tag", 0,60 psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-exp_id", 0, 61 61 "define exposure ID", NULL); 62 62 psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-inst", 0, … … 71 71 // -pendingimfile 72 72 psMetadata *pendingimfileArgs = psMetadataAlloc(); 73 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_ tag", 0,73 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_id", 0, 74 74 "define exposure ID", NULL); 75 75 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-inst", 0, … … 84 84 // -copydone 85 85 psMetadata *copydoneArgs = psMetadataAlloc(); 86 psMetadataAddStr(copydoneArgs, PS_LIST_TAIL, "-exp_ id", 0,86 psMetadataAddStr(copydoneArgs, PS_LIST_TAIL, "-exp_name", 0, 87 87 "define exposure ID", NULL); 88 88 psMetadataAddStr(copydoneArgs, PS_LIST_TAIL, "-inst", 0, … … 173 173 config->where = psMetadataAlloc(); 174 174 175 addWhereStr(exp_ tag);175 addWhereStr(exp_id); 176 176 addWhereStr(telescope); 177 177 // convert '-inst' to 'camera' -
trunk/ippTools/src/regtool.c
r14018 r14023 111 111 112 112 // select newImfiles that: 113 // exp_ tagis in newExp114 // don't have their exp_ tagin rawExp115 // XXX having the same exp_ tagin newExp and raw*Exp is probably an error113 // exp_id is in newExp 114 // don't have their exp_id in rawExp 115 // XXX having the same exp_id in newExp and raw*Exp is probably an error 116 116 // that should be checked for 117 117 … … 181 181 PS_ASSERT_PTR_NON_NULL(config, false); 182 182 183 psString query = pxDataGet("regtool_ find_unprocessed_imfile.sql");183 psString query = pxDataGet("regtool_pendingimfile.sql"); 184 184 if (!query) { 185 185 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); … … 188 188 189 189 { 190 // build a query to search by exp_ tag, class, class_id190 // build a query to search by exp_id, class, class_id 191 191 psMetadata *where = psMetadataAlloc(); 192 192 bool status = false; 193 psString exp_ tag = psMetadataLookupStr(&status, config->args, "-exp_tag");193 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id"); 194 194 if (!status) { 195 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_ tag");195 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id"); 196 196 psFree(query); 197 197 return false; 198 198 } 199 if (exp_ tag) {200 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_ tag", 0, "==", exp_tag)) {201 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_ tag");199 if (exp_id) { 200 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==", exp_id)) { 201 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 202 202 psFree(where); 203 203 psFree(query); … … 206 206 } 207 207 208 psString class_id = psMetadataLookupStr(&status, config->args, "-class_id");208 psString tmp_class_id = psMetadataLookupStr(&status, config->args, "-tmp_class_id"); 209 209 if (!status) { 210 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for - class_id");210 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -tmp_class_id"); 211 211 psFree(query); 212 212 return false; 213 213 } 214 if ( class_id) {215 if (!psMetadataAddStr(where, PS_LIST_TAIL, " class_id", 0, "==",class_id)) {216 psError(PS_ERR_UNKNOWN, false, "failed to add item class_id");214 if (tmp_class_id) { 215 if (!psMetadataAddStr(where, PS_LIST_TAIL, "tmp_class_id", 0, "==", tmp_class_id)) { 216 psError(PS_ERR_UNKNOWN, false, "failed to add item tmp_class_id"); 217 217 psFree(where); 218 218 psFree(query); … … 511 511 PS_ASSERT_PTR_NON_NULL(config, false); 512 512 513 // make sure that the exp_ tag(s) are ready to be updated based on:514 // exp_ tagis not in rawExp515 // exp_ tagis not in newImfile513 // make sure that the exp_id(s) are ready to be updated based on: 514 // exp_id is not in rawExp 515 // exp_id is not in newImfile 516 516 // that the correct count of imfiles is in rawImfile 517 517 518 518 bool status = false; 519 psString exp_ tag = psMetadataLookupStr(&status, config->args, "-exp_tag");520 if (!status) { 521 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_ tag");522 return false; 523 } 524 if (!exp_ tag) {525 psError(PS_ERR_UNKNOWN, true, "-exp_ tagis required");519 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id"); 520 if (!status) { 521 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id"); 522 return false; 523 } 524 if (!exp_id) { 525 psError(PS_ERR_UNKNOWN, true, "-exp_id is required"); 526 526 return false; 527 527 } … … 539 539 } 540 540 541 if (!p_psDBRunQuery(config->dbh, query, exp_ tag)) {541 if (!p_psDBRunQuery(config->dbh, query, exp_id)) { 542 542 psError(PS_ERR_UNKNOWN, false, "database error"); 543 543 psFree(query); … … 608 608 if (detrend) { 609 609 // set the state for the newExp to stop 610 if (!pxnewExpSetState(config, exp_ tag, "stop")) {610 if (!pxnewExpSetState(config, exp_id, "stop")) { 611 611 // rollback 612 612 if (!psDBRollback(config->dbh)) { 613 613 psError(PS_ERR_UNKNOWN, false, "database error"); 614 614 } 615 psError(PS_ERR_UNKNOWN, false, "failed to change newExp.state for exp_ tag: %s", exp_tag);615 psError(PS_ERR_UNKNOWN, false, "failed to change newExp.state for exp_id: %s", exp_id); 616 616 psFree(output); 617 617 return false; … … 622 622 623 623 // set the state for the newExp to stop 624 if (!pxnewExpSetState(config, exp_ tag, "stop")) {624 if (!pxnewExpSetState(config, exp_id, "stop")) { 625 625 // rollback 626 626 if (!psDBRollback(config->dbh)) { 627 627 psError(PS_ERR_UNKNOWN, false, "database error"); 628 628 } 629 psError(PS_ERR_UNKNOWN, false, "failed to change newExp.state for exp_ tag: %s", exp_tag);629 psError(PS_ERR_UNKNOWN, false, "failed to change newExp.state for exp_id: %s", exp_id); 630 630 psFree(output); 631 631 return false; … … 634 634 // insert an entry into the chipPendingExp table 635 635 // this can only be run as the newExp's state has been set to stop 636 if (!pxchipQueueByExpTag(config, exp_ tag, NULL, NULL, NULL, NULL, NULL)) {636 if (!pxchipQueueByExpTag(config, exp_id, NULL, NULL, NULL, NULL, NULL)) { 637 637 // rollback 638 638 if (!psDBRollback(config->dbh)) { … … 776 776 { 777 777 return guidePendingExpRowAlloc( 778 newExp->exp_ tag,778 newExp->exp_id, 779 779 newExp->camera, 780 780 newExp->telescope, … … 810 810 chipPendingExpRow *chipExp = chipPendingExpRowAlloc( 811 811 0, // chip ID, assigned by db 812 exp->exp_ tag,812 exp->exp_id, 813 813 0xdeadbeef, // guide version 814 814 label, … … 839 839 840 840 bool status = false; 841 // required 842 psString exp_name = psMetadataLookupStr(&status, config->args, "-exp_name"); 843 if (!status) { 844 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_name"); 845 return false; 846 } 847 if (!exp_name) { 848 psError(PS_ERR_UNKNOWN, true, "-exp_name is required"); 849 return false; 850 } 851 852 psString camera = psMetadataLookupStr(&status, config->args, "-inst"); 853 if (!status) { 854 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -inst"); 855 return false; 856 } 857 if (!camera) { 858 psError(PS_ERR_UNKNOWN, true, "-inst is required"); 859 return false; 860 } 861 862 psString telescope = psMetadataLookupStr(&status, config->args, "-telescope"); 863 if (!status) { 864 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -telescope"); 865 return false; 866 } 867 if (!telescope) { 868 psError(PS_ERR_UNKNOWN, true, "-telescope is required"); 869 return false; 870 } 871 872 psS32 imfiles = psMetadataLookupS32(&status, config->args, "-imfiles"); 873 if (!status) { 874 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -imfiles"); 875 return false; 876 } 877 if (!imfiles) { 878 psError(PS_ERR_UNKNOWN, true, "-imfiles is required"); 879 return false; 880 } 881 882 psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag"); 883 if (!status) { 884 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_tag"); 885 return false; 886 } 887 if (!exp_tag) { 888 psError(PS_ERR_UNKNOWN, true, "-exp_tag is required"); 889 return false; 890 } 891 841 892 // optional 842 893 psString exp_type = psMetadataLookupStr(&status, config->args, "-exp_type"); … … 989 1040 990 1041 rawExpRow *raw = rawExpRowAlloc( 991 exp->exp_tag,992 1042 exp->exp_id, 993 exp->camera, 994 exp->telescope, 1043 exp_name, 1044 camera, 1045 telescope, 995 1046 dateobs, 1047 exp_tag, 996 1048 exp_type, 997 exp->imfiles,1049 imfiles, 998 1050 filelevel, 999 1051 exp->workdir, … … 1011 1063 ccd_temp, 1012 1064 posang, 1013 user_1,1014 user_2,1015 user_3,1016 user_4,1017 user_5,1065 user_1, 1066 user_2, 1067 user_3, 1068 user_4, 1069 user_5, 1018 1070 object, 1019 1071 0.0, … … 1035 1087 1036 1088 bool status = false; 1089 // required 1090 psString exp_name = psMetadataLookupStr(&status, config->args, "-exp_name"); 1091 if (!status) { 1092 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_name"); 1093 return false; 1094 } 1095 if (!exp_name) { 1096 psError(PS_ERR_UNKNOWN, true, "-exp_name is required"); 1097 return false; 1098 } 1099 1100 psString camera = psMetadataLookupStr(&status, config->args, "-inst"); 1101 if (!status) { 1102 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -inst"); 1103 return false; 1104 } 1105 if (!camera) { 1106 psError(PS_ERR_UNKNOWN, true, "-inst is required"); 1107 return false; 1108 } 1109 1110 psString telescope = psMetadataLookupStr(&status, config->args, "-telescope"); 1111 if (!status) { 1112 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -telescope"); 1113 return false; 1114 } 1115 if (!telescope) { 1116 psError(PS_ERR_UNKNOWN, true, "-telescope is required"); 1117 return false; 1118 } 1119 1120 psString tmp_class_id = psMetadataLookupStr(&status, config->args, "-tmp_class_id"); 1121 if (!status) { 1122 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -tmp_class_id"); 1123 return false; 1124 } 1125 if (!tmp_class_id) { 1126 psError(PS_ERR_UNKNOWN, true, "-tmp_class_id is required"); 1127 return false; 1128 } 1129 1130 psString class_id = psMetadataLookupStr(&status, config->args, "-class_id"); 1131 if (!status) { 1132 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -class_id"); 1133 return false; 1134 } 1135 if (!class_id) { 1136 psError(PS_ERR_UNKNOWN, true, "-class_id is required"); 1137 return false; 1138 } 1139 1037 1140 // optional 1038 1141 psString exp_type = psMetadataLookupStr(&status, config->args, "-exp_type"); … … 1180 1283 1181 1284 rawImfileRow *raw = rawImfileRowAlloc( 1182 imfile->exp_tag, 1183 imfile->class_id, 1285 imfile->exp_id, 1286 exp_name, 1287 camera, 1288 telescope, 1289 dateobs, 1290 tmp_class_id, 1291 class_id, 1184 1292 imfile->uri, 1185 1293 exp_type, … … 1198 1306 ccd_temp, 1199 1307 posang, 1200 user_1,1201 user_2,1202 user_3,1203 user_4,1204 user_5,1308 user_1, 1309 user_2, 1310 user_3, 1311 user_4, 1312 user_5, 1205 1313 object, 1206 dateobs,1207 1314 code 1208 1315 ); -
trunk/ippTools/src/regtoolConfig.c
r13617 r14023 48 48 // -pendingimfile 49 49 psMetadata *pendingimfileArgs = psMetadataAlloc(); 50 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_ tag", 0,50 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_id", 0, 51 51 "search by exposure ID", NULL); 52 52 psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-class", 0, … … 61 61 // -addprocessedimfile 62 62 psMetadata *addprocessedimfileArgs = psMetadataAlloc(); 63 psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-exp_ tag", 0,63 psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-exp_id", 0, 64 64 "define exposure ID (required)", NULL); 65 psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-exp_name", 0, 66 "define the exp_name (required)", NULL); 67 psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-inst", 0, 68 "define the camera name (required)", NULL); 69 psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-telescope", 0, 70 "define the telescope name (required)", NULL); 71 psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-tmp_class_id", 0, 72 "define temp. class ID (required)", NULL); 65 73 psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-class_id", 0, 66 74 "define class ID (required)", NULL); … … 114 122 // -processedimfile 115 123 psMetadata *processedimfileArgs = psMetadataAlloc(); 116 psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-exp_ tag", 0,124 psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-exp_id", 0, 117 125 "search by exposure ID", NULL); 118 126 psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-class_id", 0, … … 127 135 // -updateprocessedimfile 128 136 psMetadata *updateprocessedimfileArgs = psMetadataAlloc(); 129 psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-exp_ tag", 0,137 psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-exp_id", 0, 130 138 "search by exposure ID", NULL); 131 139 psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-class_id", 0, … … 137 145 // -pendingexp 138 146 psMetadata *pendingexpArgs = psMetadataAlloc(); 139 psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-exp_ tag", 0,147 psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-exp_id", 0, 140 148 "search by exposure ID", NULL); 141 149 psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-inst", 0, … … 154 162 // -addprocessedexp 155 163 psMetadata *addprocessedexpArgs = psMetadataAlloc(); 164 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-exp_id", 0, 165 "exp_id to operate on (required)", NULL); 166 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-exp_name", 0, 167 "define the exp_name (required)", NULL); 168 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-inst", 0, 169 "define the camera name (required)", NULL); 170 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-telescope", 0, 171 "define the telescope name (required)", NULL); 156 172 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-exp_tag", 0, 157 "exp_tag to operate on (required)", NULL); 173 "define the external exposure tag name (required)", NULL); 174 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-dateobs", 0, 175 "define observation time", NULL); 158 176 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-exp_type", 0, 159 177 "define exposure type", NULL); 178 psMetadataAddS32(addprocessedexpArgs, PS_LIST_TAIL, "-imfiles", 0, 179 "define the number of imfiles in this exp (required)", 0); 160 180 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-filelevel", 0, 161 181 "define the data partitioning level of this file", NULL); … … 200 220 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-object", 0, 201 221 "define exposure object", NULL); 202 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-dateobs", 0,203 "define observation time", NULL);204 222 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-label", 0, 205 223 "define label for phase 2 processing (non-detrend data only)", NULL); … … 217 235 // -processedexp 218 236 psMetadata *processedexpArgs = psMetadataAlloc(); 219 psMetadataAddStr(processedexpArgs, PS_LIST_TAIL, "-exp_ tag", 0,237 psMetadataAddStr(processedexpArgs, PS_LIST_TAIL, "-exp_id", 0, 220 238 "search by exposure ID", NULL); 221 239 psMetadataAddU64(processedexpArgs, PS_LIST_TAIL, "-limit", 0, … … 228 246 // -updatedprocessedexp 229 247 psMetadata *updatedprocessedexpArgs = psMetadataAlloc(); 230 psMetadataAddStr(updatedprocessedexpArgs, PS_LIST_TAIL, "-exp_ tag", 0,248 psMetadataAddStr(updatedprocessedexpArgs, PS_LIST_TAIL, "-exp_id", 0, 231 249 "search by exposure ID", NULL); 232 250 psMetadataAddS16(updatedprocessedexpArgs, PS_LIST_TAIL, "-code", 0, … … 274 292 config->where = psMetadataAlloc(); 275 293 276 addWhereStr(exp_ tag);294 addWhereStr(exp_id); 277 295 // convert '-inst' to 'camera' 278 296 { -
trunk/ippTools/src/stacktool.c
r13691 r14023 124 124 } 125 125 126 // we have to support multipe exp_ tags126 // we have to support multipe exp_ids 127 127 psMetadataItem *warp_ids = psMetadataLookup(config->args, "-warp_id"); 128 128 if (!warp_ids) { -
trunk/ippTools/src/stacktoolConfig.c
r13691 r14023 198 198 addWhereStr(skycell_id); 199 199 addWhereStr(tess_id); 200 addWhereStr(exp_ tag);200 addWhereStr(exp_id); 201 201 202 202 if (config->where->list->n < 1) { -
trunk/ippTools/src/warptoolConfig.c
r13691 r14023 165 165 psMetadataAddStr(warpedArgs, PS_LIST_TAIL, "-tess_id", 0, 166 166 "define tessellation ID", NULL); 167 psMetadataAddStr(warpedArgs, PS_LIST_TAIL, "-exp_ tag", 0,167 psMetadataAddStr(warpedArgs, PS_LIST_TAIL, "-exp_id", 0, 168 168 "define exposure tag", NULL); 169 169 psMetadataAddStr(warpedArgs, PS_LIST_TAIL, "-cam_id", 0, … … 254 254 addWhereStr(skycell_id); 255 255 addWhereStr(tess_id); 256 addWhereStr(exp_ tag);256 addWhereStr(exp_id); 257 257 258 258 if (config->where->list->n < 1) {
Note:
See TracChangeset
for help on using the changeset viewer.
