IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14023


Ignore:
Timestamp:
Jul 5, 2007, 3:16:08 PM (19 years ago)
Author:
jhoblitt
Message:

rename exp_id -> exp_name
rename exp_tag -> exp_id
add add rawExp.exp_tag for use as an external name only

Location:
trunk
Files:
1 deleted
56 edited

Legend:

Unmodified
Added
Removed
  • trunk/dbconfig/chip.md

    r14017 r14023  
    11#
    2 #  We are dependant on the assumption that there is only ever one exp_tag in a
     2#  We are dependant on the assumption that there is only ever one exp_id in a
    33#  chipRun although the database does not enforce this.
    44#
     
    1717chipInputImfile METADATA
    1818    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)
    2020    class_id    STR         64      # Primary Key
    2121END
    2222
    2323chipProcessedImfile 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     STR         64      # Primary Key
     24    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
    2626    class_id        STR     64      # Primary Key
    2727    uri             STR     255
  • trunk/dbconfig/det.md

    r13937 r14023  
    3434    det_id      S64         0       # Primary Key
    3535    iteration   S32         0       # Primary Key
    36     exp_tag     STR         64      # Primary Key
     36    exp_id     S64         64      # Primary Key
    3737    include     BOOL        f
    3838END
     
    4040detProcessedImfile METADATA
    4141    det_id      S64         0      # Primary Key
    42     exp_tag     STR         64     # Primary Key
     42    exp_id     S64         64     # Primary Key
    4343    class_id    STR         64     # Primary Key
    4444    uri         STR         255
     
    6161detProcessedExp METADATA
    6262    det_id      S64         0      # Primary Key
    63     exp_tag     STR         64     # Primary Key
     63    exp_id     S64         64     # Primary Key
    6464    recipe      STR         64
    6565    bg          F64         0.0
     
    153153    det_id      S64         0       # Primary Key
    154154    iteration   S32         0       # Primary Key
    155     exp_tag     STR         64      # Primary Key
     155    exp_id     S64         64      # Primary Key
    156156    class_id    STR         64      # Primary Key
    157157    uri         STR         255
     
    176176    det_id      S64         0       # Primary Key
    177177    iteration   S32         0       # Primary Key
    178     exp_tag     STR         64      # Primary Key
     178    exp_id     S64         64      # Primary Key
    179179    recipe      STR         64
    180180    bg          F64         0.0
  • trunk/dbconfig/guide.md

    r12531 r14023  
    11guidePendingExp METADATA
    22    guide_id    S64         0       # Primary Key AUTO_INCREMENT
    3     exp_tag     STR         64      # Key
     3    exp_id     S64         64      # Key
    44    recipe      STR         64
    55END
  • trunk/dbconfig/magic.md

    r11813 r14023  
    1 # $Id: magic.md,v 1.1 2007-02-15 02:12:42 jhoblitt Exp $
     1# $Id: magic.md,v 1.2 2007-07-06 01:16:08 jhoblitt Exp $
    22
    33#
     
    1010p4MagicMaskImfile METADATA
    1111    p4_id       S32         0       # Primary Key
    12     exp_tag     STR         64      # Primary Key
     12    exp_id     S64         64      # Primary Key
    1313    p3_version  S32         0       # Primary Key
    1414# class is not yet consistently carried through pXtools
     
    2121# p4MagicMaskImfile METADATA
    2222#     p4_id       S32         0       # Primary Key
    23 #     exp_tag     STR         64      # Primary Key
     23#     exp_id     S64         64      # Primary Key
    2424#     p3_version  S32         0       # Primary Key
    2525# # class is not yet consistently carried through pXtools
     
    3434#     skycell_id  STR         64      # Primary Key
    3535#     tess_id     STR         64      # Primary Key
    36 #     exp_tag     STR         64      # Primary Key
     36#     exp_id     S64         64      # Primary Key
    3737#     p3_version  S32         0       # Primary Key
    3838# # class is not yet consistently carried through pXtools
     
    5050#     skycell_id  STR         64      # Primary Key
    5151#     tess_id     STR         64      # Primary Key
    52 #     exp_tag     STR         64      # Primary Key
     52#     exp_id     S64         64      # Primary Key
    5353#     p3_version  S32         0       # Primary Key
    5454# # class is not yet consistently carried through pXtools
     
    6464#     skycell_id  STR         64      # Primary Key
    6565#     tess_id     STR         64      # Primary Key
    66 #     exp_tag     STR         64      # Primary Key
     66#     exp_id     S64         64      # Primary Key
    6767#     p3_version  S32         0       # Primary Key
    6868# # class is not yet consistently carried through pXtools
     
    7777# p4MagicMaskImfile METADATA
    7878#     p4_id       S32         0       # Primary Key
    79 #     exp_tag     STR         64      # Primary Key
     79#     exp_id     S64         64      # Primary Key
    8080#     p3_version  S32         0       # Primary Key
    8181# # 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:30 jhoblitt Exp $
     1# $Id: skycell.md,v 1.4 2007-07-06 01:16:08 jhoblitt Exp $
    22
    33skyCell METADATA
     
    1717    skycell_id  STR         64      # Primary Key
    1818    tess_id     STR         64      # Primary Key
    19     exp_tag     STR         64      # Primary Key
     19    exp_id     S64         64      # Primary Key
    2020    p3_version  S32         0       # Primary Key
    2121# class is not yet consistently carried through pXtools
  • trunk/dbconfig/tasks.md

    r14017 r14023  
    1 # $Id: tasks.md,v 1.135 2007-07-05 20:13:45 jhoblitt Exp $
     1# $Id: tasks.md,v 1.136 2007-07-06 01:16:08 jhoblitt Exp $
    22
    33# this table records all exposure ID ever seen from the summit
    4 # exp_id == fileset
     4# exp_name == fileset
    55
    66# note that dec is a MySQL reserved word
     
    88# note that exp is a MySQL reserved word
    99
    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+
    1111#
    12 #CREATE FUNCTION genTag (exp_id varchar(64)) RETURNS VARCHAR(64)
     12#CREATE FUNCTION genTag (exp_name varchar(64)) RETURNS VARCHAR(64)
    1313#BEGIN
    1414#    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());
    1616#END
    1717#
    18 expTagCounter METADATA
    19    counter     U64         0
    20 END
     18#expTagCounter METADATA
     19#   counter     U64         0
     20#END
    2121
    2222# list of source exposures -- updated as exposures are seen
     
    2424# -1 as NULL or 0 might be a valid value (empty fileset)
    2525summitExp METADATA
    26     exp_id      STR         64      # Primary Key
     26    exp_name      STR         64      # Primary Key
    2727    camera      STR         64      # Primary Key
    2828    telescope   STR         64      # Primary Key
     
    3737# list of source images -- updated as exposures/filesets are queried
    3838summitImfile METADATA
    39     exp_id      STR         64      # Primary Key
     39    exp_name      STR         64      # Primary Key
    4040    camera      STR         64      # Primary Key
    4141    telescope   STR         64      # Primary Key
     
    5151# downloaded)
    5252pzPendingExp METADATA
    53     exp_id      STR         64      # Primary Key
     53    exp_name      STR         64      # Primary Key
    5454    camera      STR         64      # Primary Key
    5555    telescope   STR         64      # Primary Key
     
    5757
    5858pzPendingImfile METADATA
    59     exp_id      STR         64      # Primary Key
     59    exp_name    STR         64      # Primary Key
    6060    camera      STR         64      # Primary Key
    6161    telescope   STR         64      # Primary Key
    6262    class       STR         64      # Primary Key
    6363    class_id    STR         64      # Primary Key
    64     exp_tag     STR         64      # Unique Key
     64    exp_id      S64         64      # Unique Key
    6565END
    6666
    6767# list of exposures that have had all of their imfiles downloaded
    6868pzDoneExp METADATA
    69     exp_id      STR         64      # Primary Key
     69    exp_name    STR         64      # Primary Key
    7070    camera      STR         64      # Primary Key
    7171    telescope   STR         64      # Primary Key
     
    7373
    7474pzDoneImfile METADATA
    75     exp_id      STR         64      # Primary Key
     75    exp_name    STR         64      # Primary Key
    7676    camera      STR         64      # Primary Key
    7777    telescope   STR         64      # Primary Key
    7878    class       STR         64      # Primary Key
    7979    class_id    STR         64      # Primary Key
    80     exp_tag     STR         64      # Unique Key
     80    exp_id      S64         64      # Unique Key
    8181    uri         STR         255
    8282END
    8383
    8484newExp 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
    8789    state       STR         64      # Key
    88     camera      STR         64      # Key
    89     telescope   STR         64      # Key
    9090    imfiles     S32         0
    9191    workdir     STR         255     # destination for output files
     
    9696# from there
    9797newImfile METADATA
    98     exp_tag     STR         64      # Primary Key fkey(exp_tag) ref newExp(exp_tag)
    99     class_id    STR         64      # Primary Key
     98    exp_id      S64         64      # Primary Key fkey(exp_id) ref newExp(exp_id)
     99    tmp_class_id STR        64      # Primary Key
    100100    uri         STR         255
    101101END
     
    103103# paired with rawImfile
    104104rawExp METADATA
    105     exp_tag     STR         64      # Primary Key fkey(exp_tag) ref newExp(exp_tag)
    106     exp_id      STR         64      # Key
     105    exp_id      S64         64      # Primary Key fkey(exp_id) ref newExp(exp_id)
     106    exp_name    STR         64
    107107    camera      STR         64
    108108    telescope   STR         64
    109109    dateobs     UTC         0001-01-01T00:00:00Z
     110    exp_tag     STR         255
    110111    exp_type    STR         64
    111112    imfiles     S32         0
     
    136137
    137138rawImfile 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
    139145    class_id    STR         64      # Primary Key
    140146    uri         STR         255
     
    163169    user_5      F64         0.0
    164170    object      STR         64
    165     dateobs     UTC         0001-01-01T00:00:00Z
    166171    fault       S16         0       # Key NOT NULL
    167172END
    168 
    169 #
    170 # XXX - temporarily (???) stop carrying around class in imfiles after rawImfile
    171 #
  • trunk/dbconfig/warp.md

    r13690 r14023  
    1 # $Id: warp.md,v 1.3 2007-06-07 01:10:31 price Exp $
     1# $Id: warp.md,v 1.4 2007-07-06 01:16:08 jhoblitt Exp $
    22
    33#
     
    2323
    2424# the list of imfiles in our skycell keyed against phase 3
    25 # only allow one cam_version of an exp_tag per warpRun
     25# only allow one cam_version of an exp_id per warpRun
    2626warpInputExp METADATA
    2727    warp_id     S64         0       # Primary Key fkey(warp_id) ref warpRun(warp_id)
    2828    cam_id      S64         0       # Primary Key fkey(cam_id) ref camProcessedExp(cam_id)
    29 # if magic is T then look for the exp_tag in the magic output tables
     29# if magic is T then look for the exp_id in the magic output tables
    3030    magiced     BOOL        f       # Key
    3131END
  • trunk/ippTools/scripts/regtest.sh

    r14018 r14023  
    88echo -e "YES\nipp\n\n" | pxadmin -recreate || exit 1
    99
    10 exp_tag1=`$inject -newExp -exp_id t10 -inst gpc -telescope ps1 -imfiles 4 -workdir file::///some/path -simple` || exit 1
     10exp_id1=`$inject -newExp -tmp_exp_name t10 -tmp_inst gpc -tmp_telescope ps1 -imfiles 4 -workdir file::///some/path -simple` || exit 1
    1111
    1212for ID in `seq 0 3`; do
    13     $inject -newImfile -exp_tag $exp_tag1 -class_id $ID -uri file://$ID || exit 1
     13    $inject -newImfile -exp_id $exp_id1 -tmp_class_id tmp.$ID -uri file://$ID || exit 1
    1414done;
    1515
    16 $inject -updatenewExp -exp_tag $exp_tag1 -state run
     16$inject -updatenewExp -exp_id $exp_id1 -state run
    1717
    18 exp_tag2=`$inject -newExp -exp_id t11 -inst gpc -telescope ps1 -imfiles 4 -workdir file::///some/path -simple` || exit 1
     18exp_id2=`$inject -newExp -tmp_exp_name t11 -tmp_inst gpc -tmp_telescope ps1 -imfiles 4 -workdir file::///some/path -simple` || exit 1
    1919
    2020for ID in `seq 0 3`; do
    21     $inject -newImfile -exp_tag $exp_tag2 -class_id $ID -uri file://$ID || exit 1
     21    $inject -newImfile -exp_id $exp_id2 -tmp_class_id tmp.$ID -uri file://$ID || exit 1
    2222done;
    2323
    24 $inject -updatenewExp -exp_tag $exp_tag2 -state run
     24$inject -updatenewExp -exp_id $exp_id2 -state run
    2525
    2626$regtool -pendingimfile || exit 1
    2727
    2828for 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 1
     29    $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
    3030done;
    3131
    3232$regtool -pendingexp|| exit 1
    3333
    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 1
     34$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
    3535
    3636$regtool -pendingimfile || exit 1
    3737
    3838for 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 1
     39    $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
    4040done;
    4141
    4242$regtool -pendingexp|| exit 1
    4343
    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 1
     44$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  
    99        chiptool_pendingimfile.sql \
    1010        chiptool_processedimfile.sql \
    11         chiptool_queuerawexp.sql \
    1211        chiptool_queuerawimfile.sql \
    1312        detselect_search.sql \
  • trunk/ippTools/share/camtool_find_pendingexp.sql

    r14018 r14023  
    44SELECT
    55    camRun.*,
    6     rawExp.exp_tag,
    76    rawExp.exp_id,
     7    rawExp.exp_name,
    88    rawExp.camera,
    99    rawExp.telescope,
     
    1515    USING(chip_id)
    1616JOIN rawExp
    17     ON chipProcessedImfile.exp_tag = rawExp.exp_tag
     17    ON chipProcessedImfile.exp_id = rawExp.exp_id
    1818LEFT JOIN camProcessedExp
    1919    ON camRun.cam_id = camProcessedExp.cam_id
  • trunk/ippTools/share/camtool_find_pendingimfile.sql

    r12259 r14023  
    44    (SELECT
    55        camPendingExp.*,
    6         chipProcessedExp.exp_tag,
     6        chipProcessedExp.exp_id,
    77        chipProcessedExp.guide_id,
    88        chipProcessedImfile.class_id,
     
    1212        chipProcessedImfile.bg_mean_stdev,
    1313        chipProcessedImfile.path_base,
    14         rawExp.exp_id,
     14        rawExp.exp_name,
    1515        rawExp.camera,
    1616        rawExp.telescope,
     
    2222        USING(chip_id)
    2323    JOIN rawExp
    24         ON chipProcessedExp.exp_tag = rawExp.exp_tag
     24        ON chipProcessedExp.exp_id = rawExp.exp_id
    2525    LEFT JOIN camProcessedExp
    2626        ON camPendingExp.cam_id = camProcessedExp.cam_id
  • trunk/ippTools/share/camtool_find_processedexp.sql

    r12736 r14023  
    11SELECT
    22    camProcessedExp.*,
    3     rawExp.exp_id,
     3    rawExp.exp_name,
    44    rawExp.camera,
    55    rawExp.telescope,
     
    99    USING(chip_id)
    1010JOIN rawExp
    11     ON chipProcessedExp.exp_tag = rawExp.exp_tag
     11    ON chipProcessedExp.exp_id = rawExp.exp_id
    1212WHERE -- bogus condition so there is a pre-existing where to append to
    1313    camProcessedExp.cam_id IS NOT NULL
  • trunk/ippTools/share/chiptool_completely_processed_exp.sql

    r14018 r14023  
    1818        USING(chip_id)
    1919    JOIN rawExp
    20         ON chipInputImfile.exp_tag = rawExp.exp_tag
     20        ON chipInputImfile.exp_id = rawExp.exp_id
    2121    JOIN chipProcessedImfile
    2222        ON chipInputImfile.chip_id = chipProcessedImfile.chip_id
    23         AND chipInputImfile.exp_tag = chipProcessedImfile.exp_tag
     23        AND chipInputImfile.exp_id = chipProcessedImfile.exp_id
    2424        AND chipInputImfile.class_id = chipProcessedImfile.class_id
    2525    WHERE
     
    2828    GROUP BY
    2929        chipInputImfile.chip_id,
    30         chipInputImfile.exp_tag
     30        chipInputImfile.exp_id
    3131    HAVING rawExp.imfiles = COUNT(chipProcessedImfile.class_id)) as Foo
  • trunk/ippTools/share/chiptool_find_rawexp.sql

    r12184 r14023  
    22-- processeing
    33SELECT
    4     exp_tag
     4    exp_id
    55FROM rawExp
    66WHERE
  • trunk/ippTools/share/chiptool_pendingimfile.sql

    r14018 r14023  
    11SELECT
    22    chipRun.*,
    3     chipInputImfile.exp_tag,
     3    chipInputImfile.exp_id,
    44    chipInputImfile.class_id,
    55    rawImfile.uri,
    6     rawExp.exp_id,
     6    rawExp.exp_name,
    77    rawExp.camera,
    88    rawExp.telescope,
     
    1313LEFT JOIN chipProcessedImfile
    1414    ON chipInputImfile.chip_id = chipProcessedImfile.chip_id
    15     AND chipInputImfile.exp_tag = chipProcessedImfile.exp_tag
     15    AND chipInputImfile.exp_id = chipProcessedImfile.exp_id
    1616    AND chipInputImfile.class_id = chipProcessedImfile.class_id
    1717JOIN rawImfile
    18     ON chipInputImfile.exp_tag = rawImfile.exp_tag
     18    ON chipInputImfile.exp_id = rawImfile.exp_id
    1919    AND chipInputImfile.class_id = rawImfile.class_id
    2020JOIN rawExp
    21     ON rawImfile.exp_tag = rawExp.exp_tag
     21    ON rawImfile.exp_id = rawExp.exp_id
    2222LEFT JOIN chipMask
    2323    ON chipRun.label = chipMask.label
     
    2525    chipRun.state = 'run'
    2626    AND chipProcessedImfile.chip_id IS NULL
    27     AND chipProcessedImfile.exp_tag IS NULL
     27    AND chipProcessedImfile.exp_id IS NULL
    2828    AND chipProcessedImfile.class_id IS NULL
    2929    AND chipMask.label IS NULL
  • trunk/ippTools/share/chiptool_processedimfile.sql

    r12259 r14023  
    77    chipProcessedImfile.bg_mean_stdev,
    88    chipProcessedImfile.path_base,
    9     rawExp.exp_id,
     9    rawExp.exp_name,
    1010    rawExp.camera,
    1111    rawExp.telescope,
     
    1515    USING(chip_id)
    1616JOIN rawExp
    17     ON chipProcessedExp.exp_tag = rawExp.exp_tag
     17    ON chipProcessedExp.exp_id = rawExp.exp_id
    1818WHERE
    1919-- bogus test; just here so there there is a 'WHERE' stmt to append conditionals too
    20     chipProcessedImfile.exp_tag is NOT NULL
     20    chipProcessedImfile.exp_id is NOT NULL
    2121
  • trunk/ippTools/share/chiptool_queuerawimfile.sql

    r14018 r14023  
    22    SELECT
    33        LAST_INSERT_ID(),
    4         rawImfile.exp_tag,
     4        rawImfile.exp_id,
    55        rawImfile.class_id
    66    FROM rawImfile
    77    JOIN newExp
    8         USING(exp_tag)
     8        USING(exp_id)
    99    WHERE
    1010        rawImfile.fault = 0
    1111        AND newExp.state = 'stop'
    12         AND rawImfile.exp_tag = '%s'
     12        AND rawImfile.exp_id = '%s'
    1313
  • trunk/ippTools/share/dettool_find_completed_runs.sql

    r12424 r14023  
    66        detRun.det_id,
    77        detRun.iteration,
    8         detInputExp.exp_tag
     8        detInputExp.exp_id
    99    FROM detRun
    1010        LEFT JOIN detInputExp
     
    1212        AND detRun.iteration = detInputExp.iteration
    1313    LEFT JOIN rawExp
    14         ON detInputExp.exp_tag = rawExp.exp_tag
     14        ON detInputExp.exp_id = rawExp.exp_id
    1515    LEFT JOIN detResidExp
    1616        ON detRun.det_id = detResidExp.det_id
    1717        AND detRun.iteration = detResidExp.iteration
    18         AND detInputExp.exp_tag = detResidExp.exp_tag
     18        AND detInputExp.exp_id = detResidExp.exp_id
    1919   WHERE
    2020        detRun.state = 'run'
     
    2323        detRun.iteration
    2424    HAVING
    25         COUNT(detResidExp.exp_tag) = COUNT(detInputExp.exp_tag)
     25        COUNT(detResidExp.exp_id) = COUNT(detInputExp.exp_id)
    2626    ) AS residdetrun
  • trunk/ippTools/share/difftool_inputskyfile.sql

    r12312 r14023  
    1717    ON camProcessedExp.chip_id = chipProcessedExp.chip_id
    1818JOIN rawExp
    19     ON chipProcessedExp.exp_tag = rawExp.exp_tag
     19    ON chipProcessedExp.exp_id = rawExp.exp_id
    2020WHERE
    2121    diffRun.state = 'run'
  • trunk/ippTools/share/regtool_find_unprocessed_exp.sql

    r14018 r14023  
    44    FROM newExp
    55    JOIN newImfile
    6        USING(exp_tag)
     6       USING(exp_id)
    77    LEFT JOIN rawExp
    8        USING(exp_tag)
     8       USING(exp_id)
    99    WHERE
    1010        newExp.state = 'run'
    11         AND rawExp.exp_tag IS NULL
     11        AND rawExp.exp_id IS NULL
    1212        AND newExp.imfiles =
    13         (SELECT COUNT(exp_tag) FROM rawImfile
    14             WHERE rawImfile.exp_tag = newExp.exp_tag)) as Foo
     13        (SELECT COUNT(exp_id) FROM rawImfile
     14            WHERE rawImfile.exp_id = newExp.exp_id)) as Foo
    1515WHERE
    16     exp_tag = '%s'
     16    exp_id = '%s'
  • trunk/ippTools/share/regtool_pendingexp.sql

    r14018 r14023  
    33FROM newExp
    44JOIN newImfile
    5     USING(exp_tag)
     5    USING(exp_id)
    66LEFT JOIN rawExp
    7     USING(exp_tag)
     7    USING(exp_id)
    88WHERE
    99    newExp.state = 'run'
    10     AND rawExp.exp_tag IS NULL
     10    AND rawExp.exp_id IS NULL
    1111    AND newExp.imfiles =
    12     (SELECT COUNT(exp_tag) FROM rawImfile
     12    (SELECT COUNT(exp_id) FROM rawImfile
    1313        WHERE
    14             rawImfile.exp_tag = newExp.exp_tag
     14            rawImfile.exp_id = newExp.exp_id
    1515            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
     1SELECT 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  
    11SELECT
    22    rawImfile.*,
    3     newExp.exp_id,
     3    newExp.exp_name,
    44    newExp.camera,
    55    newExp.telescope
    66FROM rawImfile
    77JOIN newExp
    8     USING(exp_tag)
     8    USING(exp_id)
    99-- bogus conditional so there is a where clause to append to
    10 WHERE rawImfile.exp_tag is NOT NULL
     10WHERE rawImfile.exp_id is NOT NULL
  • trunk/ippTools/share/stacktool_inputskyfile.sql

    r12419 r14023  
    1616    ON camProcessedExp.chip_id = chipProcessedExp.chip_id
    1717JOIN rawExp
    18     ON chipProcessedExp.exp_tag = rawExp.exp_tag
     18    ON chipProcessedExp.exp_id = rawExp.exp_id
    1919WHERE
    2020    stackRun.state = 'run'
  • trunk/ippTools/share/warptool_imfile.sql

    r13827 r14023  
    1414    ON camProcessedExp.chip_id = chipProcessedImfile.chip_id
    1515JOIN rawImfile -- is there any reason not to refer back to rawimfiles?
    16     ON chipProcessedExp.exp_tag = rawImfile.exp_tag
     16    ON chipProcessedExp.exp_id = rawImfile.exp_id
    1717WHERE
    1818    warpRun.state = 'run'
  • trunk/ippTools/share/warptool_tooverlap.sql

    r12237 r14023  
    1212    ON camProcessedExp.chip_id = chipProcessedExp.chip_id
    1313JOIN rawExp
    14     ON chipProcessedExp.exp_tag = rawExp.exp_tag
     14    ON chipProcessedExp.exp_id = rawExp.exp_id
    1515LEFT JOIN warpSkyCellMap
    1616    ON warpInputExp.warp_id = warpSkyCellMap.warp_id
  • trunk/ippTools/share/warptool_towarped.sql

    r13088 r14023  
    1414    ON camProcessedExp.chip_id = chipProcessedExp.chip_id
    1515JOIN rawExp
    16     ON chipProcessedExp.exp_tag = rawExp.exp_tag
     16    ON chipProcessedExp.exp_id = rawExp.exp_id
    1717LEFT JOIN warpSkyfile
    1818    ON warpRun.warp_id = warpSkyfile.warp_id
  • trunk/ippTools/src/camtool.c

    r14018 r14023  
    144144}
    145145
    146     ADDPARAMSTR(config->args, where, "exp_tag");
    147146    ADDPARAMSTR(config->args, where, "exp_id");
     147    ADDPARAMSTR(config->args, where, "exp_name");
    148148    ADDPARAMSTR(config->args, where, "inst");
    149149    ADDPARAMSTR(config->args, where, "telescope");
  • trunk/ippTools/src/camtoolConfig.c

    r13937 r14023  
    5050    psMetadataAddStr(queueArgs, PS_LIST_TAIL, "-chip_id",  0,
    5151            "search by chip_id", NULL);
    52     psMetadataAddStr(queueArgs, PS_LIST_TAIL, "-exp_tag",  0,
    53             "search by exp_tag", NULL);
    5452    psMetadataAddStr(queueArgs, PS_LIST_TAIL, "-exp_id",  0,
    5553            "search by exp_id", NULL);
     54    psMetadataAddStr(queueArgs, PS_LIST_TAIL, "-exp_name",  0,
     55            "search by exp_name", NULL);
    5656    psMetadataAddStr(queueArgs, PS_LIST_TAIL, "-inst",  0,
    5757            "search by camera", NULL);
  • trunk/ippTools/src/chiptool.c

    r14018 r14023  
    132132
    133133    psMetadata *where = psMetadataAlloc();
    134     ADDPARAMSTR(config->args, where, "exp_tag");
    135134    ADDPARAMSTR(config->args, where, "exp_id");
     135    ADDPARAMSTR(config->args, where, "exp_name");
    136136    ADDRENAMEPARAMSTR(config->args, where, "inst", "camera");
    137137    ADDPARAMSTR(config->args, where, "telescope");
     
    190190    }
    191191
    192     // find the exp_tag of all the exposures that we want to queue up.
     192    // find the exp_id of all the exposures that we want to queue up.
    193193    psString query = pxDataGet("chiptool_find_rawexp.sql");
    194194    if (!query) {
     
    230230    }
    231231
    232     // loop over our list of exp_tags
     232    // loop over our list of exp_ids
    233233    for (long i = 0; i < psArrayLength(output); i++) {
    234234        psMetadata *md = output->data[i];
    235235
    236         psString exp_tag = psMetadataLookupStr(&status, md, "exp_tag");
     236        psString exp_id = psMetadataLookupStr(&status, md, "exp_id");
    237237        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");
    239239            psFree(output);
    240240            return false;
     
    242242
    243243        // 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)) {
    245245            if (!psDBRollback(config->dbh)) {
    246246                psError(PS_ERR_UNKNOWN, false, "database error");
    247247            }
    248248            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);
    250250            psFree(output);
    251251            return false;
     
    357357    }
    358358
    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_tag is 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");
    366366        return false;
    367367    }
     
    511511
    512512    chipProcessedImfileRow *imfile = chipProcessedImfileRowAlloc(
    513         (psU64)atoll(chip_id),
    514         exp_tag,
     513        (psS64)atoll(chip_id),
     514        (psS64)atoll(exp_id),
    515515        class_id,
    516516        uri,
  • trunk/ippTools/src/chiptoolConfig.c

    r14018 r14023  
    4646    // -queue
    4747    psMetadata *queueArgs = psMetadataAlloc();
    48     psMetadataAddStr(queueArgs, PS_LIST_TAIL, "-exp_tag",  0,
    49             "search by exp_tag", NULL);
    5048    psMetadataAddStr(queueArgs, PS_LIST_TAIL, "-exp_id",  0,
    5149            "search by exp_id", NULL);
     50    psMetadataAddStr(queueArgs, PS_LIST_TAIL, "-exp_name",  0,
     51            "search by exp_name", NULL);
    5252    psMetadataAddStr(queueArgs, PS_LIST_TAIL, "-inst",  0,
    5353            "search by camera", NULL);
     
    106106    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-chip_id",  0,
    107107            "search by chip ID", NULL);
    108     psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
     108    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
    109109            "search by exposure ID", NULL);
    110110    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-class",  0,
     
    127127    psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-chip_id",  0,
    128128            "define chip ID (required)", NULL);
    129     psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
     129    psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
    130130            "define exposure ID", NULL);
    131131    psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-class_id",  0,
     
    181181    psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-chip_id",  0,
    182182            "define chip ID", NULL);
    183     psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
     183    psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
    184184            "define exposure ID", NULL);
    185185    psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-class",  0,
     
    204204    psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-chip_id",  0,
    205205            "define chip ID", NULL);
    206     psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
     206    psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
    207207            "search by exposure ID", NULL);
    208208    psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-class",  0,
     
    217217    psMetadataAddStr(retryprocessedimfileArgs, PS_LIST_TAIL, "-chip_id",  0,
    218218            "define chip ID (required)", NULL);
    219     psMetadataAddStr(retryprocessedimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
     219    psMetadataAddStr(retryprocessedimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
    220220            "search by exposure ID", NULL);
    221221    psMetadataAddStr(retryprocessedimfileArgs, PS_LIST_TAIL, "-class",  0,
     
    294294}
    295295
    296     addWhereStr(exp_tag);
     296    addWhereStr(exp_id);
    297297    // convert '-inst' to 'camera'
    298298    {
  • trunk/ippTools/src/detselectConfig.c

    r13578 r14023  
    183183    addWhereStr(det_id);
    184184    addWhereS32(iteration);
    185     addWhereStr(exp_tag);
     185    addWhereStr(exp_id);
    186186    // convert '-inst' to 'camera'
    187187    {
  • trunk/ippTools/src/dettool.c

    r13977 r14023  
    173173        " FROM rawExp"
    174174        " LEFT JOIN detInputExp"
    175         "   ON rawExp.exp_tag = detInputExp.exp_tag"
     175        "   ON rawExp.exp_id = detInputExp.exp_id"
    176176        " WHERE"
    177         "    detInputExp.exp_tag IS NULL"
     177        "    detInputExp.exp_id IS NULL"
    178178        "    AND rawExp.obstype != 'object'"
    179179    );
     
    461461    }
    462462
    463     // we have to support multipe exp_tags
    464     psMetadataItem *item = psMetadataLookup(config->args, "-exp_tag");
     463    // we have to support multipe exp_ids
     464    psMetadataItem *item = psMetadataLookup(config->args, "-exp_id");
    465465    if (!item) {
    466466        // this shouldn't actually happen when using psArgs
    467         psError(PS_ERR_UNKNOWN, true, "-exp_tag is required");
     467        psError(PS_ERR_UNKNOWN, true, "-exp_id is required");
    468468        return false;
    469469    }
    470470    psMetadata *where = psMetadataAlloc();
    471471
    472     // make sure that -exp_tag was parsed correctly
     472    // make sure that -exp_id was parsed correctly
    473473    // XXX this can be removed someday
    474474    if (item->type == PS_DATA_METADATA_MULTI) {
     
    476476        psMetadataItem *mItem = NULL;
    477477        while ((mItem = psListGetAndIncrement(iter))) {
    478             psString exp_tag = mItem->data.V;
    479             // if exp_tag is NULL then it means that -exp_tag has not been
     478            psString exp_id = mItem->data.V;
     479            // if exp_id is NULL then it means that -exp_id has not been
    480480            // specified
    481             if (!exp_tag) {
     481            if (!exp_id) {
    482482                psError(PS_ERR_UNKNOWN, true,
    483                         "at least one -exp_tag is required");
     483                        "at least one -exp_id is required");
    484484                psFree(where);
    485485                return false;
    486486            }
    487487
    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");
    491491                psFree(iter);
    492492                psFree(where);
     
    496496        psFree(iter);
    497497    } else {
    498         psAbort(                "-exp_tag was not parsed correctly (this should not happen");
     498        psAbort(                "-exp_id was not parsed correctly (this should not happen");
    499499    }
    500500
     
    504504    }
    505505
    506     // check that the specified exp_tags actually exist
     506    // check that the specified exp_ids actually exist
    507507    psArray *detrendExps = rawExpSelectRowObjects(config->dbh, where, 0);
    508508    psFree(where);
     
    512512    }
    513513
    514     // we should have one rawExp row per exp_tag specified
     514    // we should have one rawExp row per exp_id specified
    515515    if (psListLength(item->data.list) != psArrayLength(detrendExps)) {
    516         psAbort(    "an -exp_tag matched more then one rawExp (this should not happen");
     516        psAbort(    "an -exp_id matched more then one rawExp (this should not happen");
    517517
    518518    }
     
    17681768        "       %d,"
    17691769        "       0,"
    1770         "       detResidExp.exp_tag,"
     1770        "       detResidExp.exp_id,"
    17711771        "       detResidExp.accept"
    17721772        "   FROM detResidExp"
    17731773        "   JOIN rawExp"
    1774         "       USING(exp_tag)"
     1774        "       USING(exp_id)"
    17751775        "   WHERE det_id = %d"
    17761776    );
     
    19791979        det_id,
    19801980        iteration,
    1981         rawExp->exp_tag,
     1981        rawExp->exp_id,
    19821982        true            // use
    19831983    );
     
    19911991    // select rawExp.*
    19921992    // by:
    1993     // exp_tag
     1993    // exp_id
    19941994
    19951995    psString query = psStringCopy(
     
    19971997        " FROM detInputExp"
    19981998        " JOIN rawExp"
    1999         " USING(exp_tag)"
     1999        " USING(exp_id)"
    20002000        );
    20012001
     
    20582058            " FROM rawImfile"
    20592059            " JOIN detInputExp"
    2060             "   USING(exp_tag) "
     2060            "   USING(exp_id) "
    20612061            " JOIN rawExp"
    2062             "   USING(exp_tag) "
     2062            "   USING(exp_id) "
    20632063            " JOIN detRun"
    20642064            "   ON detInputExp.det_id = detRun.det_id"
     
    21302130    //
    21312131    // det_id is in detInputExp
    2132     // exp_tag is in detInputExp
     2132    // exp_id is in detInputExp
    21332133    // det_id is not in detProccessedImfile
    2134     // exp_tag is not in detProccessedImfile
     2134    // exp_id is not in detProccessedImfile
    21352135    // class_is is not in detProccessedImfile
    21362136    psString query = psStringCopy(
     
    21462146            "    USING(det_id, iteration)"
    21472147            " JOIN rawExp"
    2148             "    ON detInputExp.exp_tag = rawExp.exp_tag"
     2148            "    ON detInputExp.exp_id = rawExp.exp_id"
    21492149            " JOIN rawImfile"
    2150             "    ON detInputExp.exp_tag = rawImfile.exp_tag"
     2150            "    ON detInputExp.exp_id = rawImfile.exp_id"
    21512151            " LEFT JOIN detProcessedImfile"
    21522152            "   ON detInputExp.det_id = detProcessedImfile.det_id"
    2153             "   AND rawImfile.exp_tag = detProcessedImfile.exp_tag"
     2153            "   AND rawImfile.exp_id = detProcessedImfile.exp_id"
    21542154            "   AND rawImfile.class_id = detProcessedImfile.class_id"
    21552155            " WHERE"
     
    21572157            "   AND detRun.mode = 'master'"
    21582158            "   AND detProcessedImfile.det_id IS NULL"
    2159             "   AND detProcessedImfile.exp_tag IS NULL"
     2159            "   AND detProcessedImfile.exp_id IS NULL"
    21602160            "   AND detProcessedImfile.class_id IS NULL"
    21612161        );
     
    22232223    }
    22242224
    2225     // select exp_tags from detInputExp matching det_idp
     2225    // select exp_ids from detInputExp matching det_idp
    22262226    // where query should be pre-generated
    22272227    psArray *detInputExp =
     
    22322232    }
    22332233
    2234     // generate where query with just the exp_tags
    2235     psMetadata *where_exp_tags = psMetadataAlloc();
     2234    // generate where query with just the exp_ids
     2235    psMetadata *where_exp_ids = psMetadataAlloc();
    22362236    for (long i = 0; i < psArrayLength(detInputExp); i++) {
    22372237        detInputExpRow *row = detInputExp->data[i];
    2238         if (!psMetadataAddStr(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)
    22402240        ) {
    2241             psError(PS_ERR_UNKNOWN, false, "failed to add item exp_tag");
     2241            psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
    22422242            psFree(detInputExp);
    2243             psFree(where_exp_tags);
     2243            psFree(where_exp_ids);
    22442244            return NULL;
    22452245        }
     
    22472247    psFree(detInputExp);
    22482248
    2249     // select rawImfiles with matching exp_tags
     2249    // select rawImfiles with matching exp_ids
    22502250    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);
    22532253    if (!rawImfiles) {
    22542254        psError(PS_ERR_UNKNOWN, false, "no rawImfile rows found");
     
    22632263    PS_ASSERT_PTR_NON_NULL(config, false);
    22642264
    2265     // det_id, exp_tag, class_id, uri, recipe, -bg, -bg_stdev
     2265    // det_id, exp_id, class_id, uri, recipe, -bg, -bg_stdev
    22662266    // are required
    22672267    bool status = false;
     
    22752275        return false;
    22762276    }
    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_tag is 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");
    22842284        return false;
    22852285    }
     
    23842384    }
    23852385
    2386     // find the matching rawImfile by exp_tag/class_id
     2386    // find the matching rawImfile by exp_id/class_id
    23872387    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");
    23902390        psFree(where);
    23912391        return false;
     
    24152415    detProcessedImfileRow *detRow = detProcessedImfileRowAlloc(
    24162416        (psS32)atol(det_id),
    2417         exp_tag,
     2417        (psS64)atoll(exp_id),
    24182418        class_id,
    24192419        uri,
     
    24612461    // select detRun.iteration
    24622462    // select detRun.det_type
    2463     // select detProcessedImfile.exp_tag
     2463    // select detProcessedImfile.exp_id
    24642464    // by:
    24652465    // find the current iteration bassed on det_id
    2466     // find all exp_tags in the current det_id/iteration from detInputExp
    2467     // find all rawImfiles in the current exp_tags
    2468     // compare to detProcessedImfiles by det_id/exp_tag
     2466    // 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
    24692469    // found how many imfile there are in each class_id
    24702470    // and:
     
    24772477        "    iteration,"
    24782478        "    det_type,"
    2479         "    exp_tag,"
     2479        "    exp_id,"
    24802480        "    camera,"
    24812481        "    workdir"
     
    24862486        "    detRun.det_type,"
    24872487        "    detRun.workdir,"
    2488         "    detProcessedImfile.exp_tag,"
     2488        "    detProcessedImfile.exp_id,"
    24892489        "    rawExp.camera,"
    24902490        "    detProcessedImfile.class_id,"
     
    24942494        "   USING(det_id, iteration)"
    24952495        " JOIN rawExp"
    2496         "   ON detInputExp.exp_tag = rawExp.exp_tag"
     2496        "   ON detInputExp.exp_id = rawExp.exp_id"
    24972497        " JOIN rawImfile"
    2498         "   ON rawExp.exp_tag = rawImfile.exp_tag"
     2498        "   ON rawExp.exp_id = rawImfile.exp_id"
    24992499        " LEFT JOIN detProcessedImfile"
    25002500        "   ON detRun.det_id = detProcessedImfile.det_id"
    2501         "   AND detInputExp.exp_tag = detProcessedImfile.exp_tag"
     2501        "   AND detInputExp.exp_id = detProcessedImfile.exp_id"
    25022502        "   AND rawImfile.class_id = detProcessedImfile.class_id"
    25032503        " LEFT JOIN detProcessedExp"
    25042504        "   ON detProcessedImfile.det_id = detProcessedExp.det_id"
    2505         "   AND detProcessedImfile.exp_tag = detProcessedExp.exp_tag"
     2505        "   AND detProcessedImfile.exp_id = detProcessedExp.exp_id"
    25062506        " WHERE"
    25072507        "   detRun.state = 'run'"
     
    25092509        "   AND detProcessedImfile.fault = 0"
    25102510        "   AND detProcessedExp.det_id IS NULL"
    2511         "   AND detProcessedExp.exp_tag IS NULL"
     2511        "   AND detProcessedExp.exp_id IS NULL"
    25122512        "   AND detInputExp.include = 1"
    25132513        " GROUP BY"
    2514         "    rawExp.exp_tag,"
     2514        "    rawExp.exp_id,"
    25152515        "    detRun.det_id"
    25162516        " HAVING"
     
    25792579    PS_ASSERT_PTR_NON_NULL(config, false);
    25802580
    2581     // det_id, exp_tag, recip, -bg, -bg_stdev
     2581    // det_id, exp_id, recip, -bg, -bg_stdev
    25822582    // are required
    25832583    bool status = false;
     
    25912591        return false;
    25922592    }
    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_tag is 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");
    26002600        return false;
    26012601    }
     
    26932693        "    detRun.iteration,"
    26942694        "    detRun.det_type,"
    2695         "    detProcessedImfile.exp_tag"
     2695        "    detProcessedImfile.exp_id"
    26962696        " FROM detRun"
    26972697        " JOIN detInputExp"
     
    26992699        "    AND detRun.iteration = detInputExp.iteration"
    27002700        " JOIN rawExp"
    2701         "    ON detInputExp.exp_tag = rawExp.exp_tag"
     2701        "    ON detInputExp.exp_id = rawExp.exp_id"
    27022702        " JOIN detProcessedImfile"
    27032703        "    ON detInputExp.det_id = detProcessedImfile.det_id"
    2704         "    AND detInputExp.exp_tag = detProcessedImfile.exp_tag"
     2704        "    AND detInputExp.exp_id = detProcessedImfile.exp_id"
    27052705        " LEFT JOIN detProcessedExp"
    27062706        "    ON detInputExp.det_id = detProcessedExp.det_id"
    2707         "    AND detProcessedImfile.exp_tag= detProcessedExp.exp_tag"
     2707        "    AND detProcessedImfile.exp_id= detProcessedExp.exp_id"
    27082708        " LEFT JOIN rawImfile"
    2709         "    ON detInputExp.exp_tag = rawImfile.exp_tag"
     2709        "    ON detInputExp.exp_id = rawImfile.exp_id"
    27102710        "    AND detProcessedImfile.class_id = rawImfile.class_id"
    27112711        " WHERE"
     
    27132713        "   AND detRun.mode = 'master'"
    27142714        "   AND detProcessedExp.det_id IS NULL"
    2715         "   AND detProcessedExp.exp_tag IS NULL"
     2715        "   AND detProcessedExp.exp_id IS NULL"
    27162716        "   AND detInputExp.include = 1"
    27172717        "   AND detRun.det_id = %s"
    2718         "   AND detProcessedImfile.exp_tag = '%s'"
     2718        "   AND detProcessedImfile.exp_id = '%s'"
    27192719        " GROUP BY"
    27202720        "    detProcessedImfile.class_id,"
     
    27252725        );
    27262726
    2727     if (!p_psDBRunQuery(config->dbh, query, det_id, exp_tag)) {
     2727    if (!p_psDBRunQuery(config->dbh, query, det_id, exp_id)) {
    27282728        psError(PS_ERR_UNKNOWN, false, "database error");
    27292729        psFree(query);
     
    27472747    detProcessedExpRow *detRow = detProcessedExpRowAlloc(
    27482748        (psS32)atol(det_id),
    2749         exp_tag,
     2749        (psS64)atoll(exp_id),
    27502750        recipe,
    27512751        bg,
     
    28722872    // by:
    28732873    // find the current iteration bassed on det_id
    2874     // find all exp_tags in the current det_id/iteration from detInputExp
    2875     // find all rawImfiles in the current exp_tags
    2876     // compare to detProcessedImfiles by det_id/exp_tag
     2874    // 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
    28772877    // found how many imfile there are in each class_id
    28782878    // and:
     
    28952895        "    AND detRun.iteration = detInputExp.iteration\n"
    28962896        " JOIN rawExp\n"
    2897         "    ON detInputExp.exp_tag = rawExp.exp_tag\n"
     2897        "    ON detInputExp.exp_id = rawExp.exp_id\n"
    28982898        " JOIN rawImfile\n"
    2899         "    ON detInputExp.exp_tag = rawImfile.exp_tag\n"
     2899        "    ON detInputExp.exp_id = rawImfile.exp_id\n"
    29002900        " LEFT JOIN detProcessedImfile\n"
    29012901        "    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"
    29032903        "    AND rawImfile.class_id = detProcessedImfile.class_id\n"
    29042904        " LEFT JOIN detStackedImfile\n"
     
    30073007        "   ON detRun.det_id = detInputExp.det_id"
    30083008        "   AND detRun.iteration = detInputExp.iteration"
    3009         "   AND detProcessedImfile.exp_tag = detInputExp.exp_tag"
     3009        "   AND detProcessedImfile.exp_id = detInputExp.exp_id"
    30103010        " JOIN rawExp"
    3011         "   ON rawExp.exp_tag = detProcessedImfile.exp_tag"
     3011        "   ON rawExp.exp_id = detProcessedImfile.exp_id"
    30123012        " WHERE"
    30133013    );
     
    32133213    if (!psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==",
    32143214            (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");
    32163216        psFree(where);
    32173217        return false;
     
    33773377    // by:
    33783378    // find the current iteration bassed on det_id
    3379     // find all exp_tags in the current det_id/iteration from detInputExp
     3379    // find all exp_ids in the current det_id/iteration from detInputExp
    33803380    // sort to detInputExp.imfiles to find the largest value per det_id/iter
    33813381    // compare imfiles to the number of detStackedImfiles by class_id
     
    34073407        "   AND detRun.iteration = detInputExp.iteration"
    34083408        " JOIN rawExp"
    3409         "   ON detInputExp.exp_tag = rawExp.exp_tag"
     3409        "   ON detInputExp.exp_id = rawExp.exp_id"
    34103410        " JOIN detStackedImfile"
    34113411        "   ON detInputExp.det_id = detStackedImfile.det_id"
     
    34233423        "   AND detNormalizedStatImfile.class_id IS NULL"
    34243424        " GROUP BY"
    3425         "   rawExp.exp_tag,"
     3425        "   rawExp.exp_id,"
    34263426        "   detRun.iteration,"
    34273427        "   detRun.det_id"
     
    36333633        "   USING(det_id, iteration)"
    36343634        " JOIN rawExp"
    3635         "   ON detInputExp.exp_tag = rawExp.exp_tag"
     3635        "   ON detInputExp.exp_id = rawExp.exp_id"
    36363636        " JOIN detNormalizedStatImfile"
    36373637        "   ON detStackedImfile.det_id = detNormalizedStatImfile.det_id"
     
    37743774        psMetadata *where = psMetadataAlloc();
    37753775        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",
    37773777                    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");
    37803780                psFree(inputExps);
    37813781                psFree(where);
     
    39633963        "    AND detRun.iteration = detInputExp.iteration"
    39643964        " JOIN rawExp"
    3965         "    ON detInputExp.exp_tag = rawExp.exp_tag"
     3965        "    ON detInputExp.exp_id = rawExp.exp_id"
    39663966        " JOIN detNormalizedImfile"
    39673967        "    ON detInputExp.det_id = detNormalizedImfile.det_id"
    39683968        "    AND detInputExp.iteration = detNormalizedImfile.iteration"
    39693969        " LEFT JOIN rawImfile"
    3970         "    ON detInputExp.exp_tag = rawImfile.exp_tag"
     3970        "    ON detInputExp.exp_id = rawImfile.exp_id"
    39713971        "    AND detNormalizedImfile.class_id = rawImfile.class_id"
    39723972        " LEFT JOIN detNormalizedExp"
     
    41524152        "    AND detRun.iteration = detInputExp.iteration"
    41534153        " JOIN rawExp"
    4154         "    ON detInputExp.exp_tag = rawExp.exp_tag"
     4154        "    ON detInputExp.exp_id = rawExp.exp_id"
    41554155        " JOIN detNormalizedImfile"
    41564156        "    ON detInputExp.det_id = detNormalizedImfile.det_id"
    41574157        "    AND detInputExp.iteration = detNormalizedImfile.iteration"
    41584158        " LEFT JOIN rawImfile"
    4159         "    ON detInputExp.exp_tag = rawImfile.exp_tag"
     4159        "    ON detInputExp.exp_id = rawImfile.exp_id"
    41604160        "    AND detNormalizedImfile.class_id = rawImfile.class_id"
    41614161        " LEFT JOIN detNormalizedExp"
     
    44374437        "   detRun.workdir,\n"
    44384438        "   detRun.reduction,\n"
    4439         "   detProcessedImfile.exp_tag,\n"
     4439        "   detProcessedImfile.exp_id,\n"
    44404440        "   detProcessedImfile.class_id,\n"
    44414441        "   detProcessedImfile.uri,\n"
     
    44464446        "   USING(det_id, iteration)\n"
    44474447        " JOIN rawExp\n"
    4448         "   ON detInputExp.exp_tag = rawExp.exp_tag\n"
     4448        "   ON detInputExp.exp_id = rawExp.exp_id\n"
    44494449        " JOIN detProcessedImfile\n"
    44504450        "   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"
    44524452        " JOIN detNormalizedImfile\n"
    44534453        "   ON detRun.det_id = detNormalizedImfile.det_id\n"
     
    44574457        "   ON detRun.det_id = detResidImfile.det_id\n"
    44584458        "   AND detRun.iteration = detResidImfile.iteration\n"
    4459         "   AND detProcessedImfile.exp_tag = detResidImfile.exp_tag\n"
     4459        "   AND detProcessedImfile.exp_id = detResidImfile.exp_id\n"
    44604460        "   AND detProcessedImfile.class_id = detResidImfile.class_id\n"
    44614461        " WHERE\n"
     
    44654465        "   AND detResidImfile.det_id IS NULL\n"
    44664466        "   AND detResidImfile.iteration IS NULL\n"
    4467         "   AND detResidImfile.exp_tag IS NULL\n"
     4467        "   AND detResidImfile.exp_id IS NULL\n"
    44684468        "   AND detResidImfile.class_id IS NULL\n"
    44694469        " UNION"
     
    44754475        "   detRun.workdir,\n"
    44764476        "   detRun.reduction,\n"
    4477         "   rawImfile.exp_tag,\n"
     4477        "   rawImfile.exp_id,\n"
    44784478        "   rawImfile.class_id,\n"
    44794479        "   rawImfile.uri,\n"
     
    44844484        "    USING(det_id, iteration)\n"
    44854485        " JOIN rawExp\n"
    4486         "    ON detInputExp.exp_tag = rawExp.exp_tag\n"
     4486        "    ON detInputExp.exp_id = rawExp.exp_id\n"
    44874487        " JOIN rawImfile\n"
    4488         "    ON detInputExp.exp_tag = rawImfile.exp_tag\n"
     4488        "    ON detInputExp.exp_id = rawImfile.exp_id\n"
    44894489        " LEFT JOIN detResidImfile\n"
    44904490        "   ON detRun.det_id = detResidImfile.det_id\n"
    44914491        "   AND detRun.iteration = detResidImfile.iteration\n"
    4492         "   AND rawImfile.exp_tag = detResidImfile.exp_tag\n"
     4492        "   AND rawImfile.exp_id = detResidImfile.exp_id\n"
    44934493        "   AND rawImfile.class_id = detResidImfile.class_id\n"
    44944494        " WHERE\n"
     
    44974497        "   AND detResidImfile.det_id IS NULL\n"
    44984498        "   AND detResidImfile.iteration IS NULL\n"
    4499         "   AND detResidImfile.exp_tag IS NULL\n"
     4499        "   AND detResidImfile.exp_id IS NULL\n"
    45004500        "   AND detResidImfile.class_id IS NULL\n"
    45014501        );
     
    46584658
    46594659    // make sure that there is a coresponding entry in detNormalizedImfile
    4660     // and the exp_tag specified is valid
     4660    // and the exp_id specified is valid
    46614661    // select * from detNormalizedImfile
    46624662    // by det_id, iteration, class_id
     
    46744674        "   ON detRun.det_id = detResidImfile.det_id\n"
    46754675        "   AND detRun.iteration = detResidImfile.iteration\n"
    4676         "   AND detInputExp.exp_tag = detResidImfile.exp_tag\n"
     4676        "   AND detInputExp.exp_id = detResidImfile.exp_id\n"
    46774677        "   AND detNormalizedImfile.class_id = detResidImfile.class_id\n"
    46784678        " WHERE\n"
     
    46814681        "  AND detResidImfile.det_id IS NULL\n"
    46824682        "  AND detResidImfile.iteration IS NULL\n"
    4683         "  AND detResidImfile.exp_tag IS NULL\n"
     4683        "  AND detResidImfile.exp_id IS NULL\n"
    46844684        "  AND detResidImfile.class_id IS NULL\n"
    46854685        " UNION\n"
     
    47034703        "    USING(det_id, iteration)\n"
    47044704        " JOIN rawExp\n"
    4705         "    ON detInputExp.exp_tag = rawExp.exp_tag\n"
     4705        "    ON detInputExp.exp_id = rawExp.exp_id\n"
    47064706        " JOIN rawImfile\n"
    4707         "    ON detInputExp.exp_tag = rawImfile.exp_tag\n"
     4707        "    ON detInputExp.exp_id = rawImfile.exp_id\n"
    47084708        " LEFT JOIN detResidImfile\n"
    47094709        "   ON detRun.det_id = detResidImfile.det_id\n"
    47104710        "   AND detRun.iteration = detResidImfile.iteration\n"
    4711         "   AND rawImfile.exp_tag = detResidImfile.exp_tag\n"
     4711        "   AND rawImfile.exp_id = detResidImfile.exp_id\n"
    47124712        "   AND rawImfile.class_id = detResidImfile.class_id\n"
    47134713        " WHERE\n"
     
    47164716        "   AND detResidImfile.det_id IS NULL\n"
    47174717        "   AND detResidImfile.iteration IS NULL\n"
    4718         "   AND detResidImfile.exp_tag IS NULL\n"
     4718        "   AND detResidImfile.exp_id IS NULL\n"
    47194719        "   AND detResidImfile.class_id IS NULL\n"
    4720         "   AND detInputExp.exp_tag = '%1$s'\n"
     4720        "   AND detInputExp.exp_id = '%1$s'\n"
    47214721        ") AS foo\n"
    47224722        "  %2$s"
     
    47764776    psFree(where);
    47774777
    4778     // exp_tag is manadatory to cross check that this is a exp_tag for this
     4778    // exp_id is manadatory to cross check that this is a exp_id for this
    47794779    // 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");
    47834783        psFree(whereClause);
    47844784        psFree(query);
    47854785        return false;
    47864786    }
    4787     if (!exp_tag) {
    4788         psError(PS_ERR_UNKNOWN, true, "-exp_tag is required");
     4787    if (!exp_id) {
     4788        psError(PS_ERR_UNKNOWN, true, "-exp_id is required");
    47894789        psFree(whereClause);
    47904790        psFree(query);
     
    47924792    }
    47934793
    4794     if (!p_psDBRunQuery(config->dbh, query, exp_tag, whereClause)) {
     4794    if (!p_psDBRunQuery(config->dbh, query, exp_id, whereClause)) {
    47954795        psError(PS_ERR_UNKNOWN, false, "database error");
    47964796        psFree(whereClause);
     
    48624862
    48634863    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_tag is 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");
    48714871        return false;
    48724872    }
     
    49794979            normalizedImfile->det_id,
    49804980            normalizedImfile->iteration,
    4981             exp_tag,
     4981            (psS64)atoll(exp_id),
    49824982            normalizedImfile->class_id,
    49834983            uri,
     
    50205020    // select detResidImfile.*
    50215021    // by:
    5022     // where det_id, iteration, exp_tag is not in detResidExp;
     5022    // where det_id, iteration, exp_id is not in detResidExp;
    50235023
    50245024    psString query = psStringCopy(
     
    50325032        "   USING(det_id, iteration)"
    50335033        " JOIN rawExp"
    5034         "   USING(exp_tag)"
     5034        "   USING(exp_id)"
    50355035        " WHERE"
    50365036    );
     
    51285128    // select detRun.iteration
    51295129    // select detRun.det_type
    5130     // select detInputExp.exp_tag
     5130    // select detInputExp.exp_id
    51315131    // select detInputExp.include
    51325132    // by:
    51335133    // find the current iteration bassed on det_id
    5134     // find all exp_tags in the current det_id/iteration from detInputExp
     5134    // find all exp_ids in the current det_id/iteration from detInputExp
    51355135    // compare to detInputExp.imfiles to derResidImfile by class_id
    51365136    // and:
    5137     // detResidImfile.{det_id, iteration, exp_tag} is not in detResidExp
     5137    // detResidImfile.{det_id, iteration, exp_id} is not in detResidExp
    51385138
    51395139    psString query = psStringCopy(
     
    51435143        "   det_type,\n"
    51445144        "   mode,\n"
    5145         "   exp_tag,\n"
     5145        "   exp_id,\n"
    51465146        "   include,\n"
    51475147        "   camera,\n"
     
    51545154        "       detRun.mode,\n"
    51555155        "       detRun.workdir,\n"
    5156         "       detInputExp.exp_tag,\n"
     5156        "       detInputExp.exp_id,\n"
    51575157        "       detInputExp.include,\n"
    51585158        "       rawExp.imfiles,\n"
     
    51635163        "       USING(det_id, iteration)\n"
    51645164        "   JOIN rawExp\n"
    5165         "       ON detInputExp.exp_tag = rawExp.exp_tag\n"
     5165        "       ON detInputExp.exp_id = rawExp.exp_id\n"
    51665166        "   JOIN detResidImfile\n"
    51675167        "       ON detRun.det_id = detResidImfile.det_id\n"
    51685168        "       AND detRun.iteration = detResidImfile.iteration\n"
    5169         "       AND detInputExp.exp_tag = detResidImfile.exp_tag\n"
     5169        "       AND detInputExp.exp_id = detResidImfile.exp_id\n"
    51705170        "   LEFT JOIN detResidExp\n"
    51715171        "       ON detResidImfile.det_id = detResidExp.det_id\n"
    51725172        "       AND detResidImfile.iteration = detResidExp.iteration\n"
    5173         "       AND detResidImfile.exp_tag = detResidExp.exp_tag\n"
     5173        "       AND detResidImfile.exp_id = detResidExp.exp_id\n"
    51745174        "   WHERE\n"
    51755175        "       detRun.state = 'run'\n"
     
    51775177        "       AND detResidExp.det_id IS NULL\n"
    51785178        "       AND detResidExp.iteration IS NULL\n"
    5179         "       AND detResidExp.exp_tag IS NULL\n"
     5179        "       AND detResidExp.exp_id IS NULL\n"
    51805180        "   GROUP BY\n"
    5181         "       detInputExp.exp_tag,\n"
     5181        "       detInputExp.exp_id,\n"
    51825182        "       detRun.iteration,\n"
    51835183        "       detRun.det_id\n"
     
    52585258    // select detRun.iteration
    52595259    // select detRun.det_type
    5260     // select detInputExp.exp_tag
     5260    // select detInputExp.exp_id
    52615261    // select detInputExp.include
    52625262    // by:
    52635263    // find the current iteration bassed on det_id
    5264     // find all exp_tags in the current det_id/iteration from detInputExp
     5264    // find all exp_ids in the current det_id/iteration from detInputExp
    52655265    // compare to detInputExp.imfiles to derResidImfile by class_id
    52665266    // and:
    5267     // detResidImfile.{det_id, iteration, exp_tag} is not in detResidExp
     5267    // detResidImfile.{det_id, iteration, exp_id} is not in detResidExp
    52685268
    52695269    psString query = psStringCopy(
     
    52715271        "   det_id,"
    52725272        "   iteration,"
    5273         "   exp_tag,"
     5273        "   exp_id,"
    52745274        "   include"
    52755275        " FROM"
     
    52785278        "       detRun.iteration,"
    52795279        "       detRun.det_type,"
    5280         "       detInputExp.exp_tag,"
     5280        "       detInputExp.exp_id,"
    52815281        "       detInputExp.include,"
    52825282        "       rawExp.imfiles"
     
    52855285        "       USING(det_id, iteration)"
    52865286        "   JOIN rawExp"
    5287         "       ON detInputExp.exp_tag = rawExp.exp_tag"
     5287        "       ON detInputExp.exp_id = rawExp.exp_id"
    52885288        "   JOIN detResidImfile"
    52895289        "       ON detRun.det_id = detResidImfile.det_id"
    52905290        "       AND detRun.iteration = detResidImfile.iteration"
    5291         "       AND detInputExp.exp_tag = detResidImfile.exp_tag"
     5291        "       AND detInputExp.exp_id = detResidImfile.exp_id"
    52925292        "   LEFT JOIN detResidExp"
    52935293        "       ON detResidImfile.det_id = detResidExp.det_id"
    52945294        "       AND detResidImfile.iteration = detResidExp.iteration"
    5295         "       AND detResidImfile.exp_tag = detResidExp.exp_tag"
     5295        "       AND detResidImfile.exp_id = detResidExp.exp_id"
    52965296        "   WHERE"
    52975297        "       detRun.state = 'run'"
    52985298        "       AND detResidExp.det_id IS NULL"
    52995299        "       AND detResidExp.iteration IS NULL"
    5300         "       AND detResidExp.exp_tag IS NULL"
     5300        "       AND detResidExp.exp_id IS NULL"
    53015301        "   GROUP BY"
    5302         "       detInputExp.exp_tag,"
     5302        "       detInputExp.exp_id,"
    53035303        "       detRun.iteration,"
    53045304        "       detRun.det_id"
     
    53095309
    53105310    {
    5311         // build a query to search by det_id, iteration, exp_tag
     5311        // build a query to search by det_id, iteration, exp_id
    53125312        psMetadata *where = psMetadataAlloc();
    53135313        bool status = false;
     
    53425342            return false;
    53435343        }
    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");
    53475347            psFree(where);
    53485348            psFree(query);
    53495349            return false;
    53505350        }
    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");
    53545354                psFree(where);
    53555355                psFree(query);
     
    54485448        return false;
    54495449    }
    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_tag is 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");
    54575457        return false;
    54585458    }
     
    55655565            det_id,
    55665566            iteration,
    5567             exp_tag,
     5567            (psS64)atoll(exp_id),
    55685568            recipe,
    55695569            bg,
     
    56115611        "   USING(det_id, iteration)"
    56125612        " JOIN detResidExp"
    5613         "   USING(det_id, iteration, exp_tag)"
     5613        "   USING(det_id, iteration, exp_id)"
    56145614        " WHERE"
    56155615        "   detRun.state = 'run'"
     
    56975697    // by:
    56985698    // find the current iteration bassed on det_id
    5699     // find all exp_tags in the current det_id/iteration from detInputExp
    5700     // find all exp_tags in the current det_id/iteration from detResidExp
    5701     // compare the counts of exp_tags
     5699    // 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
    57025702
    57035703    psString query = psStringCopy(
     
    57165716        "       detRun.mode,\n"
    57175717        "       detRun.workdir,\n"
    5718         "       detInputExp.exp_tag,\n"
     5718        "       detInputExp.exp_id,\n"
    57195719        "       rawExp.camera\n"
    57205720        "   FROM detRun\n"
     
    57225722        "       USING(det_id, iteration)\n"
    57235723        "   JOIN rawExp\n"
    5724         "       ON detInputExp.exp_tag = rawExp.exp_tag\n"
     5724        "       ON detInputExp.exp_id = rawExp.exp_id\n"
    57255725        "   LEFT JOIN detResidExp\n"
    57265726        "       ON detRun.det_id = detResidExp.det_id\n"
    57275727        "       AND detRun.iteration = detResidExp.iteration\n"
    5728         "       AND detInputExp.exp_tag = detResidExp.exp_tag\n"
     5728        "       AND detInputExp.exp_id = detResidExp.exp_id\n"
    57295729        "   WHERE\n"
    57305730        "       detRun.state = 'run'\n"
     
    57335733        "       detRun.iteration\n"
    57345734        "   HAVING\n"
    5735         "       COUNT(detResidExp.exp_tag) = COUNT(detInputExp.exp_tag)\n"
     5735        "       COUNT(detResidExp.exp_id) = COUNT(detInputExp.exp_id)\n"
    57365736        " ) AS residdetrun\n"
    57375737        );
     
    57975797    PS_ASSERT_PTR_NON_NULL(config, false);
    57985798
    5799     // build a query to search by det_id, iteration, exp_tag
     5799    // build a query to search by det_id, iteration, exp_id
    58005800    psMetadata *where = psMetadataAlloc();
    58015801    bool status = false;
     
    58255825        return false;
    58265826    }
    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");
    58305830        psFree(where);
    58315831        return false;
    58325832    }
    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");
    58365836            psFree(where);
    58375837            return false;
     
    58405840
    58415841    // find the values we're going to set
    5842     // copy everything but det_id, iteration, & exp_tag from the args and
     5842    // copy everything but det_id, iteration, & exp_id from the args and
    58435843    // remove the '-' prefix
    58445844    psMetadata *set = psMetadataAlloc();
     
    59575957    // by:
    59585958    // find the current iteration bassed on det_id
    5959     // find all exp_tags in the current det_id/iteration from detInputExp
    5960     // find all exp_tags in the current det_id/iteration from detResidExp
    5961     // compare the counts of exp_tags
     5959    // 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
    59625962
    59635963    psString query = pxDataGet("dettool_find_completed_runs.sql");
     
    59685968
    59695969    {
    5970         // build a query to search by det_id, iteration, exp_tag
     5970        // build a query to search by det_id, iteration, exp_id
    59715971        psMetadata *where = psMetadataAlloc();
    59725972        bool status = false;
     
    62716271    // select detRun.det_id
    62726272    // select detRun.iteration
    6273     // select detInputExp.exp_tag
     6273    // select detInputExp.exp_id
    62746274    // select detResidExp.accept
    62756275    // by:
    62766276    // find the current iteration bassed on det_id
    6277     // find all exp_tags in the current det_id/iteration from detInputExp
    6278     // find all exp_tags in the current det_id/iteration from detResidExp
    6279     // compare the counts of exp_tags
     6277    // 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
    62806280
    62816281    psString query = psStringCopy(
     
    62836283        "   detRun.det_id AS det_id,"
    62846284        "   detRun.iteration,"
    6285         "   detInputExp.exp_tag,"
     6285        "   detInputExp.exp_id,"
    62866286        "   detResidExp.accept"
    62876287        " FROM detRun"
     
    62926292        "   ON detRun.det_id = detResidExp.det_id"
    62936293        "   AND detRun.iteration = detResidExp.iteration"
    6294         "   AND detInputExp.exp_tag = detResidExp.exp_tag"
     6294        "   AND detInputExp.exp_id = detResidExp.exp_id"
    62956295        " WHERE"
    62966296        "   detRun.state = 'run'"
     
    63106310        "   detRun.det_id,"
    63116311        "   detRun.iteration,"
    6312         "   detInputExp.exp_tag"
     6312        "   detInputExp.exp_id"
    63136313        " HAVING"
    6314         "   COUNT(detResidExp.exp_tag) = COUNT(detInputExp.exp_tag)"
     6314        "   COUNT(detResidExp.exp_id) = COUNT(detInputExp.exp_id)"
    63156315        );
    63166316
     
    63576357    for (long i = 0; i < psArrayLength(output); i++) {
    63586358        psMetadata *row = output->data[i];
    6359         psString exp_tag = psMetadataLookupStr(&status, row, "exp_tag");
     6359        psString exp_id = psMetadataLookupStr(&status, row, "exp_id");
    63606360        if (!status) {
    63616361            // rollback
     
    63636363                psError(PS_ERR_UNKNOWN, false, "database error");
    63646364            }
    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");
    63666366            psFree(output);
    63676367            return false;
     
    63836383                    (psS32)atol(det_id),
    63846384                    newIteration,
    6385                     exp_tag,
     6385                    (psS64)atoll(exp_id),
    63866386                    accept
    63876387                )
     
    64246424    }
    64256425
    6426     // we have to support multipe exp_tags
    6427     psMetadataItem *item = psMetadataLookup(config->args, "-exp_tag");
     6426    // we have to support multipe exp_ids
     6427    psMetadataItem *item = psMetadataLookup(config->args, "-exp_id");
    64286428    if (!item) {
    64296429        // this shouldn't actually happen when using psArgs
    6430         psError(PS_ERR_UNKNOWN, true, "-exp_tag is 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;
    64356435    psMetadata *where = psMetadataAlloc();
    6436     // make sure that -exp_tag was parsed correctly
     6436    // make sure that -exp_id was parsed correctly
    64376437    // XXX this can be removed someday
    64386438    if (item->type == PS_DATA_METADATA_MULTI) {
     
    64406440        psMetadataItem *mItem = NULL;
    64416441        while ((mItem = psListGetAndIncrement(iter))) {
    6442             psString exp_tag = mItem->data.V;
    6443             // if exp_tag is NULL then it means that -exp_tag has not been
     6442            psString exp_id = mItem->data.V;
     6443            // if exp_id is NULL then it means that -exp_id has not been
    64446444            // specified
    6445             if (!exp_tag) {
     6445            if (!exp_id) {
    64466446                psError(PS_ERR_UNKNOWN, true,
    6447                         "at least one -exp_tag is required");
     6447                        "at least one -exp_id is required");
    64486448                psFree(where);
    64496449                return false;
    64506450            }
    64516451
    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");
    64556455                psFree(iter);
    64566456                psFree(where);
     
    64606460        psFree(iter);
    64616461    } else {
    6462         psAbort(                "-exp_tag was not parsed correctly (this should not happen");
    6463     }
    6464 
    6465     // check that the specified exp_tags actually exist in the iteration zero
     6462        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
    64666466    // detInputExp set
    64676467
     
    64876487    }
    64886488
    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
    64916493    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,
    64946496            detrendExps->data[i]
    64956497        );
    64966498    }
     6499#endif
    64976500    psFree(detrendExps);
    64986501
     
    65016504    if (!psDBTransaction(config->dbh)) {
    65026505        psError(PS_ERR_UNKNOWN, false, "database error");
    6503         psFree(valid_exp_tags);
     6506        psFree(valid_exp_ids);
    65046507        return false;
    65056508    }
     
    65126515            psError(PS_ERR_UNKNOWN, false, "database error");
    65136516        }
    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 same
     6517        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
    65196522    // time
    6520     psListIterator *iter = psListIteratorAlloc(exp_tag_list, 0, false);
     6523    psListIterator *iter = psListIteratorAlloc(exp_id_list, 0, false);
    65216524    psMetadataItem *mItem = NULL;
    6522     psArray *newInputExps = psArrayAllocEmpty(psListLength(exp_tag_list));
     6525    psArray *newInputExps = psArrayAllocEmpty(psListLength(exp_id_list));
    65236526    while ((mItem = psListGetAndIncrement(iter))) {
    6524         detInputExpRow *inputExp = psHashLookup(valid_exp_tags,
     6527        detInputExpRow *inputExp = psHashLookup(valid_exp_ids,
    65256528                (char *)mItem->data.V);
    65266529        if (!inputExp) {
     
    65296532                psError(PS_ERR_UNKNOWN, false, "database error");
    65306533            }
    6531             // invalid exp_tag
    6532             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",
    65336536                    (char *)mItem->data.V, det_id);
    65346537            psFree(iter);
    6535             psFree(valid_exp_tags);
     6538            psFree(valid_exp_ids);
    65366539            return false;
    65376540        }
     
    65396542            (psS32)atol(det_id),
    65406543            newIteration,
    6541             inputExp->exp_tag,
     6544            inputExp->exp_id,
    65426545            true   // use
    65436546        );
     
    65466549    }
    65476550    psFree(iter);
    6548     psFree(valid_exp_tags);
     6551    psFree(valid_exp_ids);
    65496552
    65506553    for (long i = 0; i < psArrayLength(newInputExps); i++) {
  • trunk/ippTools/src/dettoolConfig.c

    r13974 r14023  
    4949    // -pending
    5050    psMetadata *pendingArgs = psMetadataAlloc();
    51     psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-exp_tag",  0,
     51    psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-exp_id",  0,
    5252            "search by exposure ID", NULL);
    5353    psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-exp_type",  0,
     
    6666    // -definebytag
    6767    psMetadata *definebytagArgs = psMetadataAlloc();
    68     psMetadataAddStr(definebytagArgs, PS_LIST_TAIL, "-exp_tag",
     68    psMetadataAddStr(definebytagArgs, PS_LIST_TAIL, "-exp_id",
    6969            PS_META_DUPLICATE_OK,
    7070            "include this exposure (multiple OK, required)", NULL);
     
    292292    psMetadataAddS32(inputArgs, PS_LIST_TAIL, "-iteration",  0,
    293293            "define iteration number", 0);
    294     psMetadataAddStr(inputArgs, PS_LIST_TAIL, "-exp_tag",  0,
     294    psMetadataAddStr(inputArgs, PS_LIST_TAIL, "-exp_id",  0,
    295295            "search for exp ID", NULL);
    296296    psMetadataAddBool(inputArgs, PS_LIST_TAIL, "-simple",  0,
     
    306306    psMetadataAddStr(toprocessedimfileArgs, PS_LIST_TAIL, "-det_id",  0,
    307307            "search for detrend ID", NULL);
    308     psMetadataAddStr(toprocessedimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
     308    psMetadataAddStr(toprocessedimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
    309309            "search for exp ID", NULL);
    310310    psMetadataAddStr(toprocessedimfileArgs, PS_LIST_TAIL, "-class_id",  0,
     
    319319    psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-det_id",  0,
    320320            "define detrend ID (required)", NULL);
    321     psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
     321    psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
    322322            "define exp ID (required)", NULL);
    323323    psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-class_id",  0,
     
    358358    psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-det_id",  0,
    359359            "search for detrend ID", NULL);
    360     psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
     360    psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
    361361            "search for exp ID", NULL);
    362362    psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-class_id",  0,
     
    390390    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-det_id",  0,
    391391            "define detrend ID (required)", NULL);
    392     psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-exp_tag",  0,
     392    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-exp_id",  0,
    393393            "define detrend ID (required)", NULL);
    394394    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-recip",  0,
     
    425425    psMetadataAddStr(processedexpArgs, PS_LIST_TAIL, "-det_id",  0,
    426426            "define detrend ID", NULL);
    427     psMetadataAddStr(processedexpArgs, PS_LIST_TAIL, "-exp_tag",  0,
     427    psMetadataAddStr(processedexpArgs, PS_LIST_TAIL, "-exp_id",  0,
    428428            "define detrend ID", NULL);
    429429    psMetadataAddU64(processedexpArgs, PS_LIST_TAIL, "-limit",  0,
     
    645645    psMetadataAddS32(addresidimfileArgs, PS_LIST_TAIL, "-iteration",  0,
    646646            "define iteration number", 0);
    647     psMetadataAddStr(addresidimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
     647    psMetadataAddStr(addresidimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
    648648            "define detrend ID (required)", NULL);
    649649    psMetadataAddStr(addresidimfileArgs, PS_LIST_TAIL, "-class_id",  0,
     
    688688    psMetadataAddS32(residimfileArgs, PS_LIST_TAIL, "-iteration",  0,
    689689            "search for iteration number", 0);
    690     psMetadataAddStr(residimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
     690    psMetadataAddStr(residimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
    691691            "define detrend ID", NULL);
    692692    psMetadataAddStr(residimfileArgs, PS_LIST_TAIL, "-class_id",  0,
     
    709709    psMetadataAddS32(addresidexpArgs, PS_LIST_TAIL, "-iteration",  0,
    710710            "define iteration number", 0);
    711     psMetadataAddStr(addresidexpArgs, PS_LIST_TAIL, "-exp_tag",  0,
     711    psMetadataAddStr(addresidexpArgs, PS_LIST_TAIL, "-exp_id",  0,
    712712            "define detrend ID (required)", NULL);
    713713    psMetadataAddStr(addresidexpArgs, PS_LIST_TAIL, "-recip",  0,
     
    750750    psMetadataAddS32(residexpArgs, PS_LIST_TAIL, "-iteration",  0,
    751751            "search for iteration number", 0);
    752     psMetadataAddStr(residexpArgs, PS_LIST_TAIL, "-exp_tag",  0,
     752    psMetadataAddStr(residexpArgs, PS_LIST_TAIL, "-exp_id",  0,
    753753            "search for exp ID", NULL);
    754754    psMetadataAddStr(residexpArgs, PS_LIST_TAIL, "-recip",  0,
     
    776776    psMetadataAddS32(updateresidexpArgs, PS_LIST_TAIL, "-iteration",  0,
    777777            "define iteration number", 0);
    778     psMetadataAddStr(updateresidexpArgs, PS_LIST_TAIL, "-exp_tag",  0,
     778    psMetadataAddStr(updateresidexpArgs, PS_LIST_TAIL, "-exp_id",  0,
    779779            "define exp ID", NULL);
    780780    psMetadataAddStr(updateresidexpArgs, PS_LIST_TAIL, "-recip",  0,
     
    834834    psMetadataAddStr(rerunArgs, PS_LIST_TAIL, "-det_id",  0,
    835835            "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,
    837837            "include this exposure (multiple OK, required)", NULL);
    838838
     
    999999    }
    10001000    addWhereStr(det_type);
    1001     addWhereStr(exp_tag);
     1001    addWhereStr(exp_id);
    10021002    addWhereStr(class_id);
    10031003    // convert '-inst' to 'camera'
  • trunk/ippTools/src/guidetool.c

    r12025 r14023  
    185185
    186186    return guidePendingExpRowAlloc(
    187         exp->exp_tag,
     187        exp->exp_id,
    188188        exp->camera,
    189189        exp->telescope,
  • trunk/ippTools/src/guidetoolConfig.c

    r12025 r14023  
    5252    // -pending search
    5353    psMetadata *pendingArgs = psMetadataAlloc();
    54     psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-exp_tag",  0,
     54    psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-exp_id",  0,
    5555        "define exposure ID", NULL);
    5656    psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-inst",  0,
     
    7171    // -define inputs
    7272    psMetadata *defineArgs = psMetadataAlloc();
    73     psMetadataAddStr(defineArgs, PS_LIST_TAIL, "-exp_tag",  0,
     73    psMetadataAddStr(defineArgs, PS_LIST_TAIL, "-exp_id",  0,
    7474        "define class", NULL);
    7575    psMetadataAddStr(defineArgs, PS_LIST_TAIL, "-inst",  0,
     
    163163    bool status = false;
    164164
    165     addWhereStr(exp_tag);
     165    addWhereStr(exp_id);
    166166    // convert '-inst' to 'camera'
    167167    if ((str = psMetadataLookupStr(&status, config->args, "-inst"))) {
  • trunk/ippTools/src/pxcam.c

    r14018 r14023  
    6666    PS_ASSERT_PTR_NON_NULL(config, false);
    6767
    68     // load the SQL to enqueue our exp_tags from disk once
     68    // load the SQL to enqueue our exp_ids from disk once
    6969    static psString query = NULL;
    7070    if (!query) {
  • trunk/ippTools/src/pxchip.c

    r14018 r14023  
    5757
    5858bool pxchipQueueByExpTag(pxConfig *config,
    59                          psString exp_tag,
     59                         psString exp_id,
    6060                         psString workdir,
    6161                         psString label,
     
    9696#endif
    9797
    98     // populate the chipInputImfile table from rawImfile based on exp_tag,
     98    // populate the chipInputImfile table from rawImfile based on exp_id,
    9999    // where the coresponding newExp.state entry is set to stop
    100100    psString query = pxDataGetCached("chiptool_queuerawimfile.sql");
     
    104104    }
    105105
    106     // queue the imfiles for the exp_tag
    107     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)) {
    108108        psError(PS_ERR_UNKNOWN, false, "database error");
    109109        return false;
  • trunk/ippTools/src/pxchip.h

    r14018 r14023  
    2828
    2929bool pxchipQueueByExpTag(pxConfig *config,
    30                          psString exp_tag,
     30                         psString exp_id,
    3131                         psString workdir,
    3232                         psString label,
  • trunk/ippTools/src/pxinject.c

    r14018 r14023  
    8080
    8181    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_id is 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 telescope = psMetadataLookupStr(&status, config->args, "-telescope");
    101     if (!status) {
    102         psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -telescope");
    103         return false;
    104     }
    105     if (!telescope) {
    106         psError(PS_ERR_UNKNOWN, true, "-telescope 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");
    107107        return false;
    108108    }
     
    127127    }
    128128
    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 
    135129    if (!newExpInsert(config->dbh,
    136                 exp_tag,
    137                 exp_id,
     130                0x0, // exp_id
     131                tmp_exp_name,
    138132                "reg", // state
    139                 camera,
    140                 telescope,
     133                tmp_camera,
     134                tmp_telescope,
    141135                imfiles,
    142136                workdir,
     
    145139        ) {
    146140        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);
    150146
    151147    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");
    154150        psFree(md);
    155         psFree(exp_tag);
    156         psFree(md);
    157     }
    158     psFree(exp_tag);
     151        psFree(exp_id);
     152    }
     153    psFree(exp_id);
    159154
    160155    bool simple = false;
     
    186181
    187182    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_tag is 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");
    195190        return false;
    196191    }
     
    206201    }
    207202#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");
    215210        return false;
    216211    }
     
    226221
    227222    // 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)) {
    229224        psError(PS_ERR_UNKNOWN, false, "database error");
    230225        return false;
     
    240235
    241236    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_tag is 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");
    249244        return false;
    250245    }
     
    262257    if (state) {
    263258        // set detRun.state to state
    264         return pxnewExpSetState(config, exp_tag, state);
     259        return pxnewExpSetState(config, exp_id, state);
    265260    }
    266261
  • trunk/ippTools/src/pxinjectConfig.c

    r14018 r14023  
    4545    // -newExp
    4646    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,
    5050            "define the camera name (required)", NULL);
    51     psMetadataAddStr(newExpArgs, PS_LIST_TAIL, "-telescope",  0,
     51    psMetadataAddStr(newExpArgs, PS_LIST_TAIL, "-tmp_telescope",  0,
    5252            "define the telescope name (required)", NULL);
    5353    psMetadataAddS32(newExpArgs, PS_LIST_TAIL, "-imfiles",  0,
     
    6060    // -newImfile
    6161    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);
    6464#if 0
    6565    psMetadataAddStr(newImfileArgs, PS_LIST_TAIL, "-class",  0,
    6666            "define the class (required)", NULL);
    6767#endif
    68     psMetadataAddStr(newImfileArgs, PS_LIST_TAIL, "-class_id",  0,
     68    psMetadataAddStr(newImfileArgs, PS_LIST_TAIL, "-tmp_class_id",  0,
    6969            "define the class ID (required)", NULL);
    7070    psMetadataAddStr(newImfileArgs, PS_LIST_TAIL, "-uri",  0,
     
    7373    // -updatenewExp
    7474    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);
    7777    psMetadataAddStr(updatenewExpArgs, PS_LIST_TAIL, "-state", 0,
    7878            "set state (required)", NULL);
     
    127127    }
    128128    addWhereStr(det_type);
    129     addWhereStr(exp_tag);
     129    addWhereStr(exp_id);
    130130    addWhereStr(class_id);
    131131    // convert '-inst' to 'camera'
  • trunk/ippTools/src/pxregister.c

    r14018 r14023  
    2929#include "pxregister.h"
    3030
    31 bool pxnewExpSetState(pxConfig *config, const char *exp_tag, const char *state)
     31bool pxnewExpSetState(pxConfig *config, const char *exp_id, const char *state)
    3232{
    33     PS_ASSERT_PTR_NON_NULL(exp_tag, false);
     33    PS_ASSERT_PTR_NON_NULL(exp_id, false);
    3434    PS_ASSERT_PTR_NON_NULL(state, false);
    3535
     
    4646    }
    4747
    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)) {
    5050        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);
    5252        return false;
    5353    }
  • trunk/ippTools/src/pxregister.h

    r14018 r14023  
    2525#include "pxtools.h"
    2626
    27 bool pxnewExpSetState(pxConfig *config, const char *exp_tag, const char *state);
     27bool pxnewExpSetState(pxConfig *config, const char *exp_id, const char *state);
    2828
    2929#endif // PXREGISTER_H
  • trunk/ippTools/src/pxtables.c

    r14018 r14023  
    4343
    4444    bool            status = true;
     45#if 0
    4546    CREATE_TABLE(expTagCounterCreateTable);
    4647    // the counter must be initialized to 0
     
    4950        status = false;
    5051    }
     52#endif
    5153    CREATE_TABLE(summitExpCreateTable);
    5254    CREATE_TABLE(summitImfileCreateTable);
     
    129131    }
    130132
    131     DROP_TABLE(expTagCounterDropTable);
     133//    DROP_TABLE(expTagCounterDropTable);
    132134    DROP_TABLE(summitExpDropTable);
    133135    DROP_TABLE(summitImfileDropTable);
  • trunk/ippTools/src/pxtag.c

    r10709 r14023  
    2727#include "pxtag.h"
    2828
    29 psString pxGenExpTag(pxConfig *config, const char *exp_id)
     29psString pxGenExpTag(pxConfig *config, const char *exp_name)
    3030{
    3131    PS_ASSERT_PTR_NON_NULL(config, NULL);
     
    9595        return NULL;
    9696    }
    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);
    9999    psFree(output);
    100100
    101     return exp_tag;
     101    return exp_id;
    102102}
  • trunk/ippTools/src/pxtag.h

    r14018 r14023  
    2525#include "pxconfig.h"
    2626
    27 psString pxGenExpTag(pxConfig *config, const char *exp_id);
     27psString pxGenExpTag(pxConfig *config, const char *exp_name);
    2828
    2929#endif // PXTAG_H
  • trunk/ippTools/src/pzgetexp.c

    r12093 r14023  
    6868{
    6969    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)
    7171    bool haveLastFileSet = false;
    7272    psString lastFileSet = NULL;
     
    9090            haveLastFileSet = true;
    9191            bool status = false;
    92             lastFileSet = psStringCopy(psMetadataLookupStr(&status, output->data[0], "exp_id"));
     92            lastFileSet = psStringCopy(psMetadataLookupStr(&status, output->data[0], "exp_name"));
    9393            psFree(output);
    9494        }
     
    142142    {
    143143        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))"
    145145           " ENGINE=MEMORY";
    146146        if (!p_psDBRunQuery(config->dbh, query)) {
     
    156156
    157157    {
    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 (?, ?, ?, ?, ?, ?)";
    159159
    160160        long inserted = p_psDBRunQueryPrepared(config->dbh, newSummitExps, query);
     
    188188            "INSERT INTO pzPendingExp"
    189189            "   SElECT"
    190             "       incoming.exp_id,"
     190            "       incoming.exp_name,"
    191191            "       incoming.camera,"
    192192            "       incoming.telescope"
    193193            "   FROM incoming"
    194194            "   LEFT JOIN summitExp"
    195             "       USING(exp_id, camera, telescope)"
     195            "       USING(exp_name, camera, telescope)"
    196196            "   WHERE"
    197             "       summitExp.exp_id is NULL"
     197            "       summitExp.exp_name is NULL"
    198198            "       AND summitExp.camera is NULL"
    199199            "       AND summitExp.telescope is NULL";
     
    218218            "   FROM incoming"
    219219            "   LEFT JOIN summitExp"
    220             "       USING(exp_id, camera, telescope)"
     220            "       USING(exp_name, camera, telescope)"
    221221            "   WHERE"
    222             "       summitExp.exp_id is NULL"
     222            "       summitExp.exp_name is NULL"
    223223            "       AND summitExp.camera is NULL"
    224224            "       AND summitExp.telescope is NULL";
     
    296296        psListIterator *tokenCursor = psListIteratorAlloc(tokens, 0, false);
    297297        char *uri       = psListGetAndIncrement(tokenCursor);
    298         char *exp_id    = psListGetAndIncrement(tokenCursor); // fileset
     298        char *exp_name    = psListGetAndIncrement(tokenCursor); // fileset
    299299        char *dateobsStr= psListGetAndIncrement(tokenCursor); // datetime
    300300        char *exp_type  = psListGetAndIncrement(tokenCursor); // type
     
    302302        // create a new metadata to represent this line and it's values
    303303        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");
    306306            psFree(md);
    307307            psFree(tokenCursor);
  • trunk/ippTools/src/pzgetimfiles.c

    r12131 r14023  
    161161            "UPDATE summitExp"
    162162            " SET imfiles = %d"
    163             " WHERE exp_id = '%s'"
     163            " WHERE exp_name = '%s'"
    164164            " AND camera = '%s'"
    165165            " AND telescope = '%s'";
     
    178178                "DELETE FROM pzPendingExp"
    179179                " WHERE"
    180                 "   exp_id = '%s'"
     180                "   exp_name = '%s'"
    181181                "   AND camera = '%s'"
    182182                "   AND telescope = '%s'";
     
    220220    {
    221221        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";
    223223
    224224        if (!p_psDBRunQuery(config->dbh, query)) {
     
    235235    // load the imfiles (files) into the temp table
    236236    {
    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 (?, ?, ?, ?, ?, ?, ?, ?, ?)";
    238238
    239239        long inserted = p_psDBRunQueryPrepared(config->dbh, newImfiles, query);
     
    270270            "INSERT INTO pzPendingImfile"
    271271            "   SElECT"
    272             "       incoming.exp_id,"
     272            "       incoming.exp_name,"
    273273            "       incoming.camera,"
    274274            "       incoming.telescope,"
    275275            "       incoming.class,"
    276276            "       incoming.class_id,"
    277             "       NULL" // exp_tag, will be assigned later
     277            "       NULL" // exp_id, will be assigned later
    278278            "   FROM incoming"
    279279            "   JOIN pzPendingExp"
    280             "       USING(exp_id, camera, telescope)"
     280            "       USING(exp_name, camera, telescope)"
    281281            "   LEFT JOIN summitImfile"
    282             "       USING(exp_id, camera, telescope, class, class_id)"
     282            "       USING(exp_name, camera, telescope, class, class_id)"
    283283            "   WHERE"
    284             "       summitImfile.exp_id is NULL"
     284            "       summitImfile.exp_name is NULL"
    285285            "       AND summitImfile.camera is NULL"
    286286            "       AND summitImfile.telescope is NULL"
     
    303303            "INSERT INTO summitImfile"
    304304            "   SElECT"
    305             "       incoming.exp_id,"
     305            "       incoming.exp_name,"
    306306            "       incoming.camera,"
    307307            "       incoming.telescope,"
     
    314314            "   FROM incoming"
    315315            "   LEFT JOIN summitImfile"
    316             "       USING(exp_id, camera, telescope, class, class_id)"
     316            "       USING(exp_name, camera, telescope, class, class_id)"
    317317            "   WHERE"
    318             "       summitImfile.exp_id is NULL"
     318            "       summitImfile.exp_name is NULL"
    319319            "       AND summitImfile.camera is NULL"
    320320            "       AND summitImfile.telescope is NULL"
     
    338338            " SET imfiles = (SELECT COUNT(*) FROM summitImfile"
    339339            "   WHERE"
    340             "       exp_id = '%s'"
     340            "       exp_name = '%s'"
    341341            "       AND camera = '%s'"
    342342            "       AND telescope = '%s'"
    343343            ")"
    344344            " WHERE"
    345             "   exp_id = '%s'"
     345            "   exp_name = '%s'"
    346346            "   AND camera = '%s'"
    347347            "   AND telescope = '%s'";
     
    367367    }
    368368
    369     // copy the summitExp row into newExp in order to create a new exp_tag
    370     {
    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) {
    373373            // rollback
    374374            if (!psDBRollback(config->dbh)) {
     
    382382            "INSERT INTO newExp"
    383383            "   SElECT"
    384             "       '%s'," // exp_tag
    385             "       summitExp.exp_id,"
     384            "       '%s'," // exp_id
     385            "       summitExp.exp_name,"
    386386            "       summitExp.camera,"
    387387            "       summitExp.telescope,"
     
    392392            "   FROM summitExp"
    393393            "   WHERE"
    394             "       summitExp.exp_id = '%s'"
     394            "       summitExp.exp_name = '%s'"
    395395            "       AND summitExp.camera = '%s'"
    396396            "       AND summitExp.telescope = '%s'";
    397397
    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);
    408408
    409409        // sanity check: we should have inserted only one row
     
    419419    }
    420420 
    421     // set the exp_tag for the imfiles (files) in the exposure (fileset) that
     421    // set the exp_id for the imfiles (files) in the exposure (fileset) that
    422422    // we are investigating
    423423    {
    424424        char *query =
    425425            "UPDATE pzPendingImfile"
    426             " SET exp_tag = (SELECT exp_tag from newExp"
    427             "                WHERE exp_id = '%s'"
     426            " SET exp_id = (SELECT exp_id from newExp"
     427            "                WHERE exp_name = '%s'"
    428428            "                AND camera = '%s'"
    429429            "                AND telescope = '%s')"
    430430            " WHERE"
    431             "   exp_id = '%s'"
     431            "   exp_name = '%s'"
    432432            "   AND camera = '%s'"
    433433            "   AND telescope = '%s'";
     
    450450            "   FROM pzPendingExp"
    451451            "   WHERE"
    452             "       pzPendingExp.exp_id = '%s'"
     452            "       pzPendingExp.exp_name = '%s'"
    453453            "       AND pzPendingExp.camera = '%s'"
    454454            "       AND pzPendingExp.telescope = '%s'";
     
    479479            "DELETE FROM pzPendingExp"
    480480            " WHERE"
    481             "   exp_id = '%s'"
     481            "   exp_name = '%s'"
    482482            "   AND camera = '%s'"
    483483            "   AND telescope = '%s'";
     
    524524    // any work
    525525    bool status = false;
    526     psString exp_id = psMetadataLookupStr(&status, config->args, "-filesetid");
     526    psString exp_name = psMetadataLookupStr(&status, config->args, "-filesetid");
    527527    if (!status) {
    528528        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for '-filesetid'");
    529529        return NULL;
    530530    }
    531     if (!exp_id) {
     531    if (!exp_name) {
    532532        psError(PS_ERR_UNKNOWN, true, "-filesetid is required");
    533533        return NULL;
     
    596596        // create a new metadata to represent this line and it's values
    597597        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");
    600600            psFree(md);
    601601            psFree(tokenCursor);
  • trunk/ippTools/src/pztool.c

    r12093 r14023  
    140140            " FROM pzPendingExp"
    141141            " JOIN summitExp"
    142             "   USING(exp_id, camera, telescope)"
     142            "   USING(exp_name, camera, telescope)"
    143143        );
    144144
     
    197197            "SELECT"
    198198            "   summitImfile.*,"
    199             "   pzPendingImfile.exp_tag"
     199            "   pzPendingImfile.exp_id"
    200200            " FROM pzPendingImfile"
    201201            " JOIN summitImfile"
    202             "   USING(exp_id, camera, telescope, class, class_id)"
     202            "   USING(exp_name, camera, telescope, class, class_id)"
    203203        );
    204204
     
    255255
    256256    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_id is 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");
    264264        return false;
    265265    }
     
    315315    }
    316316
    317     // need to know exp_id, camera, telescope, class, class_id (to find the
     317    // need to know exp_name, camera, telescope, class, class_id (to find the
    318318    // pzPendingImfile entry and the URI for the newImfile entry.
    319319
     
    329329            "INSERT INTO newImfile"
    330330            "   SElECT"
    331             "       pzPendingImfile.exp_tag,"
     331            "       pzPendingImfile.exp_id,"
    332332            "       pzPendingImfile.class,"
    333333            "       pzPendingImfile.class_id,"
     
    336336            "   FROM pzPendingImfile"
    337337            "   WHERE"
    338             "       pzPendingImfile.exp_id = '%s'"
     338            "       pzPendingImfile.exp_name = '%s'"
    339339            "       AND pzPendingImfile.camera = '%s'"
    340340            "       AND pzPendingImfile.telescope = '%s'"
     
    342342            "       AND pzPendingImfile.class_id = '%s'";
    343343
    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)) {
    345345            // rollback
    346346            if (!psDBRollback(config->dbh)) {
     
    372372            "   FROM pzPendingImfile"
    373373            "   WHERE"
    374             "       pzPendingImfile.exp_id = '%s'"
     374            "       pzPendingImfile.exp_name = '%s'"
    375375            "       AND pzPendingImfile.camera = '%s'"
    376376            "       AND pzPendingImfile.telescope = '%s'"
     
    378378            "       AND pzPendingImfile.class_id = '%s'";
    379379
    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)) {
    381381            // rollback
    382382            if (!psDBRollback(config->dbh)) {
     
    404404            "DELETE FROM pzPendingImfile"
    405405            "   WHERE"
    406             "       pzPendingImfile.exp_id = '%s'"
     406            "       pzPendingImfile.exp_name = '%s'"
    407407            "       AND pzPendingImfile.camera = '%s'"
    408408            "       AND pzPendingImfile.telescope = '%s'"
     
    410410            "       AND pzPendingImfile.class_id = '%s'";
    411411
    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)) {
    413413            // rollback
    414414            if (!psDBRollback(config->dbh)) {
  • trunk/ippTools/src/pztoolConfig.c

    r11860 r14023  
    4545    // -seen
    4646    psMetadata *seenArgs = psMetadataAlloc();
    47     psMetadataAddStr(seenArgs, PS_LIST_TAIL, "-exp_tag", 0,
     47    psMetadataAddStr(seenArgs, PS_LIST_TAIL, "-exp_id", 0,
    4848            "define exposure ID", NULL);
    4949    psMetadataAddStr(seenArgs, PS_LIST_TAIL, "-inst", 0,
     
    5858    // -pendingexp
    5959    psMetadata *pendingexpArgs = psMetadataAlloc();
    60     psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-exp_tag", 0,
     60    psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-exp_id", 0,
    6161            "define exposure ID", NULL);
    6262    psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-inst", 0,
     
    7171    // -pendingimfile
    7272    psMetadata *pendingimfileArgs = psMetadataAlloc();
    73     psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_tag", 0,
     73    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_id", 0,
    7474            "define exposure ID", NULL);
    7575    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-inst", 0,
     
    8484    // -copydone
    8585    psMetadata *copydoneArgs = psMetadataAlloc();
    86     psMetadataAddStr(copydoneArgs, PS_LIST_TAIL, "-exp_id", 0,
     86    psMetadataAddStr(copydoneArgs, PS_LIST_TAIL, "-exp_name", 0,
    8787            "define exposure ID", NULL);
    8888    psMetadataAddStr(copydoneArgs, PS_LIST_TAIL, "-inst", 0,
     
    173173    config->where = psMetadataAlloc();
    174174
    175     addWhereStr(exp_tag);
     175    addWhereStr(exp_id);
    176176    addWhereStr(telescope);
    177177    // convert '-inst' to 'camera'
  • trunk/ippTools/src/regtool.c

    r14018 r14023  
    111111
    112112    // select newImfiles that:
    113     // exp_tag is in newExp
    114     // don't have their exp_tag in rawExp
    115     // XXX having the same exp_tag in newExp and raw*Exp is probably an error
     113    // 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
    116116    // that should be checked for
    117117
     
    181181    PS_ASSERT_PTR_NON_NULL(config, false);
    182182
    183     psString query = pxDataGet("regtool_find_unprocessed_imfile.sql");
     183    psString query = pxDataGet("regtool_pendingimfile.sql");
    184184    if (!query) {
    185185        psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
     
    188188
    189189    {
    190         // build a query to search by exp_tag, class, class_id
     190        // build a query to search by exp_id, class, class_id
    191191        psMetadata *where = psMetadataAlloc();
    192192        bool status = false;
    193         psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag");
     193        psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");
    194194        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");
    196196            psFree(query);
    197197            return false;
    198198        }
    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");
    202202                psFree(where);
    203203                psFree(query);
     
    206206        }
    207207
    208         psString class_id = psMetadataLookupStr(&status, config->args, "-class_id");
     208        psString tmp_class_id = psMetadataLookupStr(&status, config->args, "-tmp_class_id");
    209209        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");
    211211            psFree(query);
    212212            return false;
    213213        }
    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");
    217217                psFree(where);
    218218                psFree(query);
     
    511511    PS_ASSERT_PTR_NON_NULL(config, false);
    512512
    513     // make sure that the exp_tag(s) are ready to be updated based on:
    514     // exp_tag is not in rawExp
    515     // exp_tag is not in newImfile
     513    // 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
    516516    // that the correct count of imfiles is in rawImfile
    517517   
    518518    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_tag is 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");
    526526        return false;
    527527    }
     
    539539    }
    540540
    541     if (!p_psDBRunQuery(config->dbh, query, exp_tag)) {
     541    if (!p_psDBRunQuery(config->dbh, query, exp_id)) {
    542542        psError(PS_ERR_UNKNOWN, false, "database error");
    543543        psFree(query);
     
    608608        if (detrend) {
    609609            // set the state for the newExp to stop
    610             if (!pxnewExpSetState(config, exp_tag, "stop")) {
     610            if (!pxnewExpSetState(config, exp_id, "stop")) {
    611611                // rollback
    612612                if (!psDBRollback(config->dbh)) {
    613613                    psError(PS_ERR_UNKNOWN, false, "database error");
    614614                }
    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);
    616616                psFree(output);
    617617                return false;
     
    622622
    623623        // set the state for the newExp to stop
    624         if (!pxnewExpSetState(config, exp_tag, "stop")) {
     624        if (!pxnewExpSetState(config, exp_id, "stop")) {
    625625            // rollback
    626626            if (!psDBRollback(config->dbh)) {
    627627                psError(PS_ERR_UNKNOWN, false, "database error");
    628628            }
    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);
    630630            psFree(output);
    631631            return false;
     
    634634        // insert an entry into the chipPendingExp table
    635635        // 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)) {
    637637            // rollback
    638638            if (!psDBRollback(config->dbh)) {
     
    776776{
    777777    return guidePendingExpRowAlloc(
    778         newExp->exp_tag,
     778        newExp->exp_id,
    779779        newExp->camera,
    780780        newExp->telescope,
     
    810810    chipPendingExpRow *chipExp = chipPendingExpRowAlloc(
    811811            0,              // chip ID, assigned by db
    812             exp->exp_tag,
     812            exp->exp_id,
    813813            0xdeadbeef,     // guide version
    814814            label,
     
    839839
    840840    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
    841892    // optional
    842893    psString exp_type = psMetadataLookupStr(&status, config->args, "-exp_type");
     
    9891040
    9901041    rawExpRow *raw = rawExpRowAlloc(
    991         exp->exp_tag,
    9921042        exp->exp_id,
    993         exp->camera,
    994         exp->telescope,
     1043        exp_name,
     1044        camera,
     1045        telescope,
    9951046        dateobs,
     1047        exp_tag,
    9961048        exp_type,
    997         exp->imfiles,
     1049        imfiles,
    9981050        filelevel,
    9991051        exp->workdir,
     
    10111063        ccd_temp,
    10121064        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,
    10181070        object,
    10191071        0.0,
     
    10351087
    10361088    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
    10371140    // optional
    10381141    psString exp_type = psMetadataLookupStr(&status, config->args, "-exp_type");
     
    11801283
    11811284    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,
    11841292        imfile->uri,
    11851293        exp_type,
     
    11981306        ccd_temp,
    11991307        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,
    12051313        object,
    1206         dateobs,
    12071314        code
    12081315    );
  • trunk/ippTools/src/regtoolConfig.c

    r13617 r14023  
    4848    // -pendingimfile
    4949    psMetadata *pendingimfileArgs = psMetadataAlloc();
    50     psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
     50    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
    5151        "search by exposure ID", NULL);
    5252    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-class",  0,
     
    6161    // -addprocessedimfile
    6262    psMetadata *addprocessedimfileArgs = psMetadataAlloc();
    63     psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
     63    psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
    6464        "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);
    6573    psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-class_id",  0,
    6674        "define class ID (required)", NULL);
     
    114122    // -processedimfile
    115123    psMetadata *processedimfileArgs = psMetadataAlloc();
    116     psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
     124    psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
    117125        "search by exposure ID", NULL);
    118126    psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-class_id",  0,
     
    127135    // -updateprocessedimfile
    128136    psMetadata *updateprocessedimfileArgs = psMetadataAlloc();
    129     psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
     137    psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
    130138        "search by exposure ID", NULL);
    131139    psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-class_id",  0,
     
    137145    // -pendingexp
    138146    psMetadata *pendingexpArgs = psMetadataAlloc();
    139     psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-exp_tag",  0,
     147    psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-exp_id",  0,
    140148        "search by exposure ID", NULL);
    141149    psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-inst",  0,
     
    154162    // -addprocessedexp
    155163    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);
    156172    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);
    158176    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-exp_type",  0,
    159177        "define exposure type", NULL);
     178    psMetadataAddS32(addprocessedexpArgs, PS_LIST_TAIL, "-imfiles",  0,
     179        "define the number of imfiles in this exp (required)", 0);
    160180    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-filelevel",  0,
    161181        "define the data partitioning level of this file", NULL);
     
    200220    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-object",  0,
    201221        "define exposure object", NULL);
    202     psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-dateobs",  0,
    203         "define observation time", NULL);
    204222    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-label",  0,
    205223        "define label for phase 2 processing (non-detrend data only)", NULL);
     
    217235    // -processedexp
    218236    psMetadata *processedexpArgs = psMetadataAlloc();
    219     psMetadataAddStr(processedexpArgs, PS_LIST_TAIL, "-exp_tag",  0,
     237    psMetadataAddStr(processedexpArgs, PS_LIST_TAIL, "-exp_id",  0,
    220238        "search by exposure ID", NULL);
    221239    psMetadataAddU64(processedexpArgs, PS_LIST_TAIL, "-limit",  0,
     
    228246    // -updatedprocessedexp
    229247    psMetadata *updatedprocessedexpArgs = psMetadataAlloc();
    230     psMetadataAddStr(updatedprocessedexpArgs, PS_LIST_TAIL, "-exp_tag",  0,
     248    psMetadataAddStr(updatedprocessedexpArgs, PS_LIST_TAIL, "-exp_id",  0,
    231249        "search by exposure ID", NULL);
    232250    psMetadataAddS16(updatedprocessedexpArgs, PS_LIST_TAIL, "-code",  0,
     
    274292    config->where = psMetadataAlloc();
    275293
    276     addWhereStr(exp_tag);
     294    addWhereStr(exp_id);
    277295    // convert '-inst' to 'camera'
    278296    {
  • trunk/ippTools/src/stacktool.c

    r13691 r14023  
    124124    }
    125125
    126     // we have to support multipe exp_tags
     126    // we have to support multipe exp_ids
    127127    psMetadataItem *warp_ids = psMetadataLookup(config->args, "-warp_id");
    128128    if (!warp_ids) {
  • trunk/ippTools/src/stacktoolConfig.c

    r13691 r14023  
    198198    addWhereStr(skycell_id);
    199199    addWhereStr(tess_id);
    200     addWhereStr(exp_tag);
     200    addWhereStr(exp_id);
    201201
    202202    if (config->where->list->n < 1) {
  • trunk/ippTools/src/warptoolConfig.c

    r13691 r14023  
    165165    psMetadataAddStr(warpedArgs, PS_LIST_TAIL, "-tess_id",  0,
    166166            "define tessellation ID", NULL);
    167     psMetadataAddStr(warpedArgs, PS_LIST_TAIL, "-exp_tag", 0,
     167    psMetadataAddStr(warpedArgs, PS_LIST_TAIL, "-exp_id", 0,
    168168            "define exposure tag", NULL);
    169169    psMetadataAddStr(warpedArgs, PS_LIST_TAIL, "-cam_id", 0,
     
    254254    addWhereStr(skycell_id);
    255255    addWhereStr(tess_id);
    256     addWhereStr(exp_tag);
     256    addWhereStr(exp_id);
    257257
    258258    if (config->where->list->n < 1) {
Note: See TracChangeset for help on using the changeset viewer.