IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12131


Ignore:
Timestamp:
Feb 28, 2007, 6:44:37 PM (19 years ago)
Author:
jhoblitt
Message:

rename all *_version fields to be *_id
change chip* tables to use a chip_id
change cam* tables to use a cam_id
change all *_id fields to be S64

Location:
trunk/ippTools
Files:
2 added
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/configure.ac

    r12088 r12131  
    11AC_PREREQ(2.59)
    22
    3 AC_INIT([ipptools], [1.1.13], [ipp-support@ifa.hawaii.edu])
     3AC_INIT([ipptools], [1.1.14], [ipp-support@ifa.hawaii.edu])
    44AC_CONFIG_SRCDIR([autogen.sh])
    55
     
    1818PKG_CHECK_MODULES([PSLIB], [pslib >= 1.1.0])
    1919PKG_CHECK_MODULES([PSMODULES], [psmodules >= 1.1.0])
    20 PKG_CHECK_MODULES([IPPDB], [ippdb >= 1.1.13])
     20PKG_CHECK_MODULES([IPPDB], [ippdb >= 1.1.14])
    2121
    2222PXTOOLS_CFLAGS="${PSLIB_CFLAGS=} ${PSMODULES_CFLAGS=} ${IPPDB_CFLAGS=}"
  • trunk/ippTools/scripts/camtest.sh

    r12058 r12131  
    88camtool -pendingimfile || exit 1
    99
    10 camtool -addprocessedexp -exp_tag t10.1 -uri file://camp -recip myrecipe -bg 1 -bg_stdev 2 -bg_mean_stdev 3 -sigma_ra 1 -sigma_dec 2 -nastro 42 -path_base file:///foo -zp_mean 1 -zp_stdev 2 || exit 1
    11 camtool -addprocessedexp -exp_tag t11.2 -uri file://camp -recip myrecipe -bg 1 -bg_stdev 2 -bg_mean_stdev 3 -sigma_ra 1 -sigma_dec 2 -nastro 42 -path_base file:///foo -zp_mean 1 -zp_stdev 2 || exit 1
     10camtool -addprocessedexp -cam_id 1 -uri file://camp -recip myrecipe -bg 1 -bg_stdev 2 -bg_mean_stdev 3 -sigma_ra 1 -sigma_dec 2 -nastro 42 -path_base file:///foo -zp_mean 1 -zp_stdev 2 || exit 1
     11camtool -addprocessedexp -cam_id 2 -uri file://camp -recip myrecipe -bg 1 -bg_stdev 2 -bg_mean_stdev 3 -sigma_ra 1 -sigma_dec 2 -nastro 42 -path_base file:///foo -zp_mean 1 -zp_stdev 2 || exit 1
  • trunk/ippTools/scripts/chiptest.sh

    r12058 r12131  
    88
    99for ID in `seq 0 3`; do
    10     chiptool -addprocessedimfile -exp_tag t10.1 -class_id $ID -uri file://chipp-t10.$ID -recip myrecipe -bg 1 -bg_stdev 2 -bg_mean_stdev 3 -path_base file:///foo || exit 1
     10    chiptool -addprocessedimfile -chip_id 1 -class_id $ID -uri file://chipp-t10.$ID -recip myrecipe -bg 1 -bg_stdev 2 -bg_mean_stdev 3 -path_base file:///foo || exit 1
    1111done;
    1212
    1313for ID in `seq 0 3`; do
    14     chiptool -addprocessedimfile -exp_tag t11.2 -class_id $ID -uri file://chipp-t11.$ID -recip myrecipe -bg 1 -bg_stdev 2 -bg_mean_stdev 3 -path_base file:///foo || exit 1
     14    chiptool -addprocessedimfile -chip_id 2 -class_id $ID -uri file://chipp-t11.$ID -recip myrecipe -bg 1 -bg_stdev 2 -bg_mean_stdev 3 -path_base file:///foo || exit 1
    1515done;
    1616
  • trunk/ippTools/scripts/mapfile.txt

    r12058 r12131  
    22
    33warpSkyCellMap METADATA
    4     warp_id           S32     1
     4    warp_id         S64     1
     5    cam_id          S64     1
    56    skycell_id      STR     foo1
    67    tess_id         STR     bar
    7     exp_tag         STR     t10.1
    8     cam_version      S32     0
    98    class_id        STR     quix1
    109    fault           S16     0
     
    1211
    1312warpSkyCellMap METADATA
    14     warp_id           S32     1
     13    warp_id         S64     1
     14    cam_id          S64     1
    1515    skycell_id      STR     foo2
    1616    tess_id         STR     bar
    17     exp_tag         STR     t10.1
    18     cam_version      S32     0
    1917    class_id        STR     quix2
    2018    fault           S16     0
  • trunk/ippTools/scripts/warptest.sh

    r12029 r12131  
    77warptool -definerun -mode warp -workdir file:///foo || exit 1
    88
    9 warptool -addinputexp -warp_id 1 -exp_tag t10.1 -cam_version 0 || exit 1
     9warptool -addinputexp -warp_id 1 -cam_id 1 || exit 1
     10warptool -addinputexp -warp_id 1 -cam_id 2 || exit 1
    1011
    1112warptool -updaterun -warp_id 1 -state run || exit 1
  • trunk/ippTools/src/Makefile.am

    r12075 r12131  
    3232        pxinject.h \
    3333        pxdata.h \
     34        pxio.h \
    3435        pxtag.h \
    3536        pzgetexp.h \
     
    4849        pxtables.c \
    4950        pxdata.c \
     51        pxio.c \
    5052        pxtag.c
    5153
  • trunk/ippTools/src/camtool.c

    r12093 r12131  
    100100            "   rawExp.workdir"
    101101            " FROM camPendingExp"
     102            " JOIN chipProcessedExp"
     103            "   USING(chip_id)"
    102104            " JOIN rawExp"
    103             "   USING(exp_tag)"
     105            "   ON chipProcessedExp.exp_tag = rawExp.exp_tag"
    104106            " LEFT JOIN camProcessedExp"
    105             "   USING(exp_tag)"
     107            "   on camPendingExp.cam_id = camPendingExp.cam_id"
    106108            " LEFT JOIN camMask"
    107109            "   ON camPendingExp.label = camMask.label"
    108110            " WHERE"
    109             "   camProcessedExp.exp_tag IS NULL"
     111            "   camProcessedExp.cam_id IS NULL"
    110112            "   AND camMask.label IS NULL"
    111113    );
     
    152154    }
    153155
     156    if (!convertIdToStr(output)) {
     157        psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
     158        psFree(output);
     159        return false;
     160    }
     161
    154162    // negate simple so the default is true
    155163    if (!ippdbPrintMetadatas(stdout, output, "camPendingExp", !simple)) {
     
    170178    psString query = psStringCopy(
    171179            "SELECT"
     180            "   camPendingExp.cam_id,"
    172181            "   chipProcessedImfile.*,"
    173182            "   rawExp.camera,"
     
    175184            " FROM camPendingExp"
    176185            " JOIN chipProcessedImfile"
    177             "   USING(exp_tag, chip_version)"
     186            "   USING(chip_id)"
    178187            " JOIN rawExp"
    179             "   USING(exp_tag)"
     188            "   ON chipProcessedImfile.exp_tag = rawExp.exp_tag"
    180189            " LEFT JOIN camProcessedExp"
    181             "   USING(exp_tag)"
     190            "   ON camPendingExp.cam_id = camProcessedExp.cam_id"
    182191            " LEFT JOIN camMask"
    183192            "   ON camPendingExp.label = camMask.label"
    184193            " WHERE"
    185             "   camProcessedExp.exp_tag IS NULL"
     194            "   camProcessedExp.cam_id IS NULL"
    186195            "   AND camMask.label IS NULL"
    187196    );
     
    221230    }
    222231
     232    if (!convertIdToStr(output)) {
     233        psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
     234        psFree(output);
     235        return false;
     236    }
     237
     238    if (!convertIdToStr(output)) {
     239        psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
     240        psFree(output);
     241        return false;
     242    }
     243
     244    if (!convertIdToStr(output)) {
     245        psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
     246        psFree(output);
     247        return false;
     248    }
     249
     250    if (!convertIdToStr(output)) {
     251        psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
     252        psFree(output);
     253        return false;
     254    }
     255
    223256    // negate simple so the default is true
    224257    if (!ippdbPrintMetadatas(stdout, output, "chipProcessedImfile", !simple)) {
     
    237270    PS_ASSERT_PTR_NON_NULL(config, false);
    238271
    239     // det_id, exp_tag, recip
    240     // are required
    241272    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");
    249         return false;
    250     }
     273    psString cam_id = psMetadataLookupStr(&status, config->args, "-cam_id");
     274    if (!status) {
     275        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -cam_id");
     276        return false;
     277    }
     278    if (!cam_id) {
     279        psError(PS_ERR_UNKNOWN, true, "-cam_id is required");
     280        return false;
     281    }
     282
    251283    psString uri = psMetadataLookupStr(&status, config->args, "-uri");
    252284    if (!status) {
     
    258290        return false;
    259291    }
     292
    260293    psString recipe = psMetadataLookupStr(&status, config->args, "-recip");
    261294    if (!status) {
     
    267300        return false;
    268301    }
     302
    269303    psF64 bg = psMetadataLookupF64(&status, config->args, "-bg");
    270304    if (!status) {
     
    272306        return false;
    273307    }
     308
    274309    psF64 bg_stdev = psMetadataLookupF64(&status, config->args, "-bg_stdev");
    275310    if (!status) {
     
    277312        return false;
    278313    }
     314
    279315    psF64 bg_mean_stdev = psMetadataLookupF64(&status, config->args, "-bg_mean_stdev");
    280316    if (!status) {
     
    282318        return false;
    283319    }
     320
    284321    psF32 sigma_ra = psMetadataLookupF32(&status, config->args, "-sigma_ra");
    285322    if (!status) {
     
    291328        return false;
    292329    }
     330
    293331    psF32 sigma_dec = psMetadataLookupF32(&status, config->args, "-sigma_dec");
    294332    if (!status) {
     
    300338        return false;
    301339    }
     340
    302341    psS32 nastro = psMetadataLookupS32(&status, config->args, "-nastro");
    303342    if (!status) {
     
    309348        return false;
    310349    }
     350
    311351    psF32 zp_mean = psMetadataLookupF32(&status, config->args, "-zp_mean");
    312352    if (!status) {
     
    318358        return false;
    319359    }
     360
    320361    psF32 zp_stdev = psMetadataLookupF32(&status, config->args, "-zp_stdev");
    321362    if (!status) {
     
    346387        " FROM camPendingExp"
    347388        " LEFT JOIN camProcessedExp"
    348         "   USING(exp_tag)"
     389        "   USING(cam_id)"
    349390        " WHERE"
    350         "   camProcessedExp.exp_tag IS NULL"
    351         "   AND camPendingExp.exp_tag = '%s'"
     391        "   camProcessedExp.cam_id IS NULL"
     392        "   AND camPendingExp.cam_id = '%s'"
    352393    );
    353394
    354     if (!p_psDBRunQuery(config->dbh, query, exp_tag)) {
     395    if (!p_psDBRunQuery(config->dbh, query, cam_id)) {
    355396        psError(PS_ERR_UNKNOWN, false, "database error");
    356397        psFree(query);
     
    382423    // create a new camProcessedImfile object
    383424    camProcessedExpRow *row = camProcessedExpRowAlloc(
    384         exp_tag,
    385         pendingRow->cam_version,
    386         pendingRow->chip_version,
     425        pendingRow->cam_id,
     426        pendingRow->chip_id,
    387427        pendingRow->label,
    388428        uri,
     
    437477}
    438478
     479
    439480static bool processedexpMode(pxConfig *config)
    440481{
     
    460501            "   rawExp.workdir"
    461502            " FROM camProcessedExp"
     503            " JOIN chipProcessedExp"
     504            "   USING(chip_id)"
    462505            " JOIN rawExp"
    463             "   USING(exp_tag)"
     506            "   chipProcessedExp.exp_tag = rawExp.exp_tag"
    464507            " WHERE"
    465             "   camProcessedExp.exp_tag IS NOT NULL"
     508            "   camProcessedExp.cam_id IS NOT NULL" // bongus
    466509    );
    467510
     
    515558    }
    516559
     560    if (!convertIdToStr(output)) {
     561        psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
     562        psFree(output);
     563        return false;
     564    }
     565
     566    if (!convertIdToStr(output)) {
     567        psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
     568        psFree(output);
     569        return false;
     570    }
     571
     572    if (!convertIdToStr(output)) {
     573        psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
     574        psFree(output);
     575        return false;
     576    }
     577
     578    if (!convertIdToStr(output)) {
     579        psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
     580        psFree(output);
     581        return false;
     582    }
     583
    517584    // negate simple so the default is true
    518585    if (!ippdbPrintMetadatas(stdout, output, "camProcessedExp", !simple)) {
     
    570637    return true;
    571638}
     639
    572640
    573641static bool maskedMode(pxConfig *config)
     
    605673    }
    606674
     675    if (!convertIdToStr(output)) {
     676        psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
     677        psFree(output);
     678        return false;
     679    }
     680
    607681    // negative simple so the default is true
    608682    if (!ippdbPrintMetadatas(stdout, output, "camMask", !simple)) {
     
    617691}
    618692
     693
    619694static bool unblockMode(pxConfig *config)
    620695{
  • trunk/ippTools/src/camtoolConfig.c

    r12058 r12131  
    4646    // -pendingexp
    4747    psMetadata *pendingexpArgs = psMetadataAlloc();
    48     psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-exp_tag", 0,
    49             "search by exposure ID", NULL);
    50     psMetadataAddS32(pendingexpArgs, PS_LIST_TAIL, "-chip_version", 0,
    51             "search for exposures with this chip version", -1);
    52     psMetadataAddS32(pendingexpArgs, PS_LIST_TAIL, "-cam_version", 0,
    53             "search for exposures with this cam version", -1);
     48    psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-cam_id", 0,
     49            "search by camtool ID", NULL);
     50    psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-chip_id", 0,
     51            "search by chiptool ID", NULL);
    5452    psMetadataAddU64(pendingexpArgs, PS_LIST_TAIL, "-limit",  0,
    55         "limit result set to N items", 0);
     53            "limit result set to N items", 0);
    5654    psMetadataAddBool(pendingexpArgs, PS_LIST_TAIL, "-simple", 0,
    5755            "use the simple output format", false);
     
    6058    // -pendingimfile
    6159    psMetadata *pendingimfileArgs = psMetadataAlloc();
    62     psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_tag", 0,
    63             "search by exposure ID", NULL);
     60    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-cam_id", 0,
     61            "search by camtool ID", NULL);
     62    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-chip_id", 0,
     63            "search by chiptool ID", NULL);
    6464    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-class", 0,
    6565            "search by class", NULL);
     
    7272    // -addprocessedexp
    7373    psMetadata *addprocessedexpArgs = psMetadataAlloc();
    74     psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-exp_tag", 0,
    75             "define exp ID (required)", NULL);
     74    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-cam_id", 0,
     75            "define camtool ID (required)", NULL);
     76    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-chip_id", 0,
     77            "define chiptool ID (required)", NULL);
    7678    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-uri", 0,
    7779            "define URI (required)", NULL);
     
    9698    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-path_base", 0,
    9799            "define banana 1", NULL);
    98     psMetadataAddS8(addprocessedexpArgs, PS_LIST_TAIL, "-code",  0,
    99         "set fault code (required)", 0);
    100     psMetadataAddBool(pendingexpArgs, PS_LIST_TAIL, "-faulted",  0,
    101         "only return imfiles with a fault status set", false);
     100    psMetadataAddS16(addprocessedexpArgs, PS_LIST_TAIL, "-code",  0,
     101            "set fault code (required)", 0);
     102    psMetadataAddBool(addprocessedexpArgs, PS_LIST_TAIL, "-faulted",  0,
     103            "only return imfiles with a fault status set", false);
    102104
    103105    // -processedexp
    104106    psMetadata *processedexpArgs = psMetadataAlloc();
    105     psMetadataAddStr(processedexpArgs, PS_LIST_TAIL, "-exp_tag", 0,
    106             "search by exposure ID", NULL);
    107     psMetadataAddS32(processedexpArgs, PS_LIST_TAIL, "-chip_version", 0,
    108             "search for exposures with this chip version", -1);
    109     psMetadataAddS32(processedexpArgs, PS_LIST_TAIL, "-cam_version", 0,
    110             "search for exposures with this cam version", -1);
     107    psMetadataAddStr(processedexpArgs, PS_LIST_TAIL, "-cam_id", 0,
     108            "search by camtool ID", NULL);
     109    psMetadataAddStr(processedexpArgs, PS_LIST_TAIL, "-chip_id", 0,
     110            "search by chiptool ID", NULL);
    111111    psMetadataAddU64(processedexpArgs, PS_LIST_TAIL, "-limit",  0,
    112         "limit result set to N items", 0);
     112            "limit result set to N items", 0);
    113113    psMetadataAddBool(processedexpArgs, PS_LIST_TAIL, "-simple", 0,
    114114            "use the simple output format", false);
    115115    psMetadataAddBool(processedexpArgs, PS_LIST_TAIL, "-faulted",  0,
    116         "only return imfiles with a fault status set", false);
     116            "only return imfiles with a fault status set", false);
    117117
    118118    // -updateprocessedexp
    119119    psMetadata *updateprocessedexpArgs = psMetadataAlloc();
    120     psMetadataAddStr(updateprocessedexpArgs, PS_LIST_TAIL, "-exp_tag",  0,
    121         "search by exposure ID", NULL);
     120    psMetadataAddStr(updateprocessedexpArgs, PS_LIST_TAIL, "-cam_id", 0,
     121            "search by camtool ID", NULL);
     122    psMetadataAddStr(updateprocessedexpArgs, PS_LIST_TAIL, "-chip_id",  0,
     123            "search by chiptool ID", NULL);
    122124    psMetadataAddStr(updateprocessedexpArgs, PS_LIST_TAIL, "-class",  0,
    123         "search by class", NULL);
     125            "search by class", NULL);
    124126    psMetadataAddStr(updateprocessedexpArgs, PS_LIST_TAIL, "-class_id",  0,
    125         "search by class ID", NULL);
    126     psMetadataAddS8(updateprocessedexpArgs, PS_LIST_TAIL, "-code",  0,
    127         "set fault code (required)", 0);
     127            "search by class ID", NULL);
     128    psMetadataAddS16(updateprocessedexpArgs, PS_LIST_TAIL, "-code",  0,
     129            "set fault code (required)", 0);
    128130
    129131    // -block
     
    221223    config->where = psMetadataAlloc();
    222224
    223     addWhereStr(exp_tag);
     225{
     226    psString str = NULL;
     227    bool status = false;
     228    if ((str = psMetadataLookupStr(&status, config->args, "-cam_id"))) {
     229        if (!psMetadataAddS64(config->where, PS_LIST_TAIL, "cam_id", 0, "==", (psS64)atoll(str))) {
     230            psError(PS_ERR_UNKNOWN, false, "failed to add item cam_id");
     231            psFree(config);
     232            return NULL;
     233        }
     234    }
     235}
     236
     237{
     238    psString str = NULL;
     239    bool status = false;
     240    if ((str = psMetadataLookupStr(&status, config->args, "-chip_id"))) {
     241        if (!psMetadataAddS64(config->where, PS_LIST_TAIL, "chip_id", 0, "==", (psS64)atoll(str))) {
     242            psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id");
     243            psFree(config);
     244            return NULL;
     245        }
     246    }
     247}
     248
    224249    // convert '-inst' to 'camera'
    225250    {
  • trunk/ippTools/src/chiptool.c

    r12096 r12131  
    169169            "INSERT INTO chipPendingExp\n"
    170170            "   SElECT\n"
     171            "       0\n"            // chip_id
    171172            "       exp_tag,\n"
    172173            "       'my recipe',\n"  // recipe
     
    269270    }
    270271
     272    if (!convertIdToStr(output)) {
     273        psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
     274        psFree(output);
     275        return false;
     276    }
     277
    271278    // negative simple so the default is true
    272279    if (!ippdbPrintMetadatas(stdout, output, "chipPendingImfile", !simple)) {
     
    307314        psMetadata *where = psMetadataAlloc();
    308315        bool status = false;
    309         psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag");        if (!status) {
    310             psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_tag");
     316        psString chip_id = psMetadataLookupStr(&status, config->args, "-chip_id");        if (!status) {
     317            psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -chip_id");
    311318            psFree(query);
    312319            return false;
    313320        }
    314         if (exp_tag) {
    315             if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_tag", 0, "==", exp_tag)) {
    316                 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_tag");
     321        if (chip_id) {
     322            if (!psMetadataAddStr(where, PS_LIST_TAIL, "chip_id", 0, "==", chip_id)) {
     323                psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id");
    317324                psFree(where);
    318325                psFree(query);
     
    320327            }
    321328        }
     329
    322330        psString class_id = psMetadataLookupStr(&status, config->args, "-class_id");
    323331        if (!status) {
     
    517525    }
    518526
     527    if (!convertIdToStr(output)) {
     528        psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
     529        psFree(output);
     530        return false;
     531    }
     532
    519533    // negative simple so the default is true
    520534    if (!ippdbPrintMetadatas(stdout, output, "chipProcessedImfile", !simple)) {
     
    606620            return false;
    607621        }
     622    }
     623
     624    if (!convertIdToStr(output)) {
     625        psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
     626        psFree(output);
     627        return false;
    608628    }
    609629
     
    799819
    800820    return chipProcessedImfileRowAlloc(
     821        imfile->chip_id,
    801822        imfile->exp_tag,
    802         imfile->chip_version,
    803         imfile->guide_version,
     823        imfile->guide_id,
    804824        imfile->class_id,
    805825        recipe,
     
    819839 
    820840    return chipProcessedExpRowAlloc(
     841        pendingExp->chip_id,
    821842        pendingExp->exp_tag,
    822         pendingExp->chip_version,
    823         pendingExp->guide_version,
     843        pendingExp->guide_id,
    824844        pendingExp->label,
    825845        pendingExp->expgroup,
     
    834854
    835855    return camPendingExpRowAlloc(
    836         pendingExp->exp_tag,
    837         0x0,        // cam version
    838         pendingExp->chip_version,
     856        0,                      // cam version, assigned by db
     857        pendingExp->chip_id,
    839858        pendingExp->label,
    840859        pendingExp->expgroup,
  • trunk/ippTools/src/chiptoolConfig.c

    r12058 r12131  
    9191    // -pendingimfile
    9292    psMetadata *pendingimfileArgs = psMetadataAlloc();
     93    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-chip_id",  0,
     94            "search by chip ID", NULL);
    9395    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
    94             "define exposure ID", NULL);
     96            "search by exposure ID", NULL);
    9597    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-class",  0,
    96             "define class", NULL);
     98            "search by class", NULL);
    9799    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-class_id",  0,
    98             "define class ID", NULL);
     100            "search by class ID", NULL);
    99101    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-inst",  0,
    100             "define camera of interest", NULL);
     102            "search by camera of interest", NULL);
    101103    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-filter",  0,
    102             "define filter of interest", NULL);
     104            "search by filter of interest", NULL);
    103105    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-uri",  0,
    104             "define URL", NULL);
     106            "search by URL", NULL);
    105107    psMetadataAddU64(pendingimfileArgs, PS_LIST_TAIL, "-limit",  0,
    106108            "limit result set to N items", 0);
     
    110112    // -addprocessedimfile
    111113    psMetadata *addprocessedimfileArgs = psMetadataAlloc();
     114    psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-chip_id",  0,
     115            "define chip ID (required)", NULL);
     116#if 0
    112117    psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
    113             "define exp_tag (required)", NULL);
     118            "define exposure tag (required) (XXX redudant with chip_id)", NULL);
     119#endif
    114120    psMetadataAddStr(addprocessedimfileArgs, PS_LIST_TAIL, "-class_id",  0,
    115121            "define class ID", NULL);
     
    131137    // -processedimfile
    132138    psMetadata *processedimfileArgs = psMetadataAlloc();
     139    psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-chip_id",  0,
     140            "define chip ID (required)", NULL);
    133141    psMetadataAddStr(processedimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
    134142            "define exposure ID", NULL);
     
    152160    // -updateprocessedimfile
    153161    psMetadata *updateprocessedimfileArgs = psMetadataAlloc();
     162    psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-chip_id",  0,
     163            "define chip ID (required)", NULL);
    154164    psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-exp_tag",  0,
    155165            "search by exposure ID", NULL);
     
    257267    config->where = psMetadataAlloc();
    258268
     269{
     270    psString str = NULL;
     271    bool status = false;
     272    if ((str = psMetadataLookupStr(&status, config->args, "-chip_id"))) {
     273        if (!psMetadataAddS64(config->where, PS_LIST_TAIL, "chip_id", 0, "==", (psS64)atoll(str))) {
     274            psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id");
     275            psFree(config);
     276            return NULL;
     277        }
     278    }
     279}
     280
    259281    addWhereStr(exp_tag);
    260282    // convert '-inst' to 'camera'
  • trunk/ippTools/src/dettool.c

    r12123 r12131  
    2525#include <string.h>
    2626#include <stdlib.h>
     27#include <stdint.h>
     28
    2729#include <ippdb.h>
    2830
     
    7072static bool register_detrend_imfileMode(pxConfig *config);
    7173
    72 static bool convertDetIdToStr(psArray *mds);
    7374static detNormalizedStatImfileRow *detStackedToDetNormalizedStatImfile(pxConfig *config, detStackedImfileRow *stackedImfile);
    7475static  detNormalizedImfileRow *detNormalizedStatToDetNormalizedmfile(pxConfig *config, detNormalizedStatImfileRow *statImfile);
     
    598599    }
    599600
    600     // convert det_id to a str externally
    601     if (!convertDetIdToStr(detRuns)) {
    602         psError(PS_ERR_UNKNOWN, false, "failed to convert det_id to a string");
     601    if (!convertIdToStr(detRuns)) {
     602        psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
    603603        psFree(detRuns);
    604604        return false;
     
    616616}
    617617
     618#if 0
    618619// This function is used to convert the det_id from an int, as it is used
    619620// internally, to be a string for external use.  The rational being that we may
     
    640641    return true;
    641642}
     643#endif
    642644
    643645static bool definebyqueryMode(pxConfig *config)
     
    12431245
    12441246    // convert det_id to a string externaly
    1245     if (!convertDetIdToStr(detRuns)) {
     1247    if (!convertIdToStr(detRuns)) {
    12461248        psError(PS_ERR_UNKNOWN, false, "failed to convert det_id to a string");
    12471249        psFree(detRuns);
     
    12811283    {
    12821284        psMetadata *where = psMetadataAlloc();
    1283         psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==", (psS32)atoi(det_id));
     1285        psMetadataAddS64(where, PS_LIST_TAIL, "det_id", 0, "==", (psS64)atoll(det_id));
    12841286        detRuns = detRunSelectRowObjects(config->dbh, where, 0);
    12851287        psFree(where);
     
    12911293    // sanity check the result... we should have only found one det_id
    12921294    if (psArrayLength(detRuns) != 1) {
    1293         psAbort("found more then one detRun matching det_id %d(this should not happen)", (psS32)atoi(det_id));
     1295        psAbort("found more then one detRun matching det_id %" PRId64 " (this should not happen)", (psS64)atoll(det_id));
    12941296        return false;                   // unreachable
    12951297    }
     
    16241626    psFree(time_filter);
    16251627
    1626     if (!p_psDBRunQuery(config->dbh, query, (psS32)newDet_id, (psS32)atoi(det_id))) {
     1628    if (!p_psDBRunQuery(config->dbh, query, (psS64)newDet_id, (psS64)atoll(det_id))) {
    16271629        psError(PS_ERR_UNKNOWN, false, "database error");
    16281630        psFree(query);
     
    16661668
    16671669    // convert det_id to a string externaly
    1668     if (!convertDetIdToStr(newDetRuns)) {
    1669         psError(PS_ERR_UNKNOWN, false, "failed to convert det_id to a string");
    1670         psFree(newDetRuns);
     1670    if (!convertIdToStr(detRuns)) {
     1671        psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
     1672        psFree(detRuns);
    16711673        return false;
    16721674    }
     
    17011703
    17021704    // convert det_id to a string externaly
    1703     if (!convertDetIdToStr(runs)) {
    1704         psError(PS_ERR_UNKNOWN, false, "failed to convert det_id to a string");
     1705    if (!convertIdToStr(runs)) {
     1706        psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
    17051707        psFree(runs);
    17061708        return false;
     
    17841786
    17851787    // convert det_id to a string externaly
    1786     if (!convertDetIdToStr(output)) {
    1787         psError(PS_ERR_UNKNOWN, false, "failed to convert det_id to a string");
     1788    if (!convertIdToStr(output)) {
     1789        psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
    17881790        psFree(output);
    17891791        return false;
     
    29072909    psMetadata *where = psMetadataAlloc();
    29082910    if (!psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==",
    2909             (psS32)atoi(det_id))) {
     2911            (psS64)atoll(det_id))) {
    29102912        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_tag");
    29112913        psFree(where);
     
    48704872            return false;
    48714873        }
    4872         if (!psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==", (psS32)atoi(det_id))) {
     4874        if (!psMetadataAddS64(where, PS_LIST_TAIL, "det_id", 0, "==", (psS64)atoll(det_id))) {
    48734875            psError(PS_ERR_UNKNOWN, false, "failed to add item det_id");
    48744876            psFree(where);
     
    63326334            0.0,        // solang max
    63336335            label,      // label
    6334             atoi(parent)
     6336            (psS64)atoll(parent)
    63356337    )) {
    63366338        psError(PS_ERR_UNKNOWN, false, "database error");
     
    64356437    // the det_id is valid
    64366438    if (!detNormalizedImfileInsert(config->dbh,
    6437             (psS32)atoi(det_id),
     6439            (psS64)atoll(det_id),
    64386440            0,  // the iteration is fixed at 0
    64396441            class_id,
  • trunk/ippTools/src/difftool.c

    r12112 r12131  
    281281    // constrants
    282282    if (!diffInputSkyfileInsert(config->dbh,
    283             (psS32)atoi(diff_id),
    284             (psS32)atoi(warp_id),
     283            (psS64)atoll(diff_id),
     284            (psS64)atoll(warp_id),
    285285            skycell_id,
    286286            tess_id,
     
    322322        " JOIN warpInputExp\n"
    323323        "   ON diffInputSkyfile.warp_id    = warpInputExp.warp_id\n"
     324        " JOIN camProcessedExp\n"
     325        "   ON warpInputExp.cam_id = camProcessedExp.cam_id\n"
     326        " JOIN chipProcessedExp\n"
     327        "   ON camProcessedExp.chip_id = chipProcessedExp.chip_id\n"
    324328        " JOIN rawExp\n"
    325         "   ON warpInputExp.exp_tag        = rawExp.exp_tag\n"
     329        "   ON chipProcessedExp.exp_tag = rawExp.exp_tag\n"
    326330        " WHERE\n"
    327331        "   diffRun.state = 'run'\n"
     
    379383
    380384    if (psArrayLength(output)) {
     385        if (!convertIdToStr(output)) {
     386            psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
     387            psFree(output);
     388            return false;
     389        }
     390
    381391        // negative simple so the default is true
    382392        if (!ippdbPrintMetadatas(stdout, output, "diffInputSkyfile", !simple)) {
     
    474484
    475485    if (psArrayLength(output)) {
     486        if (!convertIdToStr(output)) {
     487            psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
     488            psFree(output);
     489            return false;
     490        }
     491
    476492        // negative simple so the default is true
    477493        if (!ippdbPrintMetadatas(stdout, output, "diffSkyfile", !simple)) {
     
    532548
    533549    if (!diffSkyfileInsert(config->dbh,
    534             (psS32)atoi(diff_id),
     550            (psS64)atoll(diff_id),
    535551            uri,
    536552            bg,
     
    637653
    638654    if (psArrayLength(output)) {
     655        if (!convertIdToStr(output)) {
     656            psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
     657            psFree(output);
     658            return false;
     659        }
     660
    639661        // negative simple so the default is true
    640662        if (!ippdbPrintMetadatas(stdout, output, "diffSkyfile", !simple)) {
  • trunk/ippTools/src/difftoolConfig.c

    r12029 r12131  
    239239    bool status = false;
    240240    if ((str = psMetadataLookupStr(&status, config->args, "-diff_id"))) {
    241         if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "diff_id", 0, "==", (psS32)atoi(str))) {
     241        if (!psMetadataAddS64(config->where, PS_LIST_TAIL, "diff_id", 0, "==", (psS64)atoll(str))) {
    242242            psError(PS_ERR_UNKNOWN, false, "failed to add item diff_id");
    243243            psFree(config);
     
    250250    bool status = false;
    251251    if ((str = psMetadataLookupStr(&status, config->args, "-warp_id"))) {
    252         if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "warp_id", 0, "==", (psS32)atoi(str))) {
     252        if (!psMetadataAddS64(config->where, PS_LIST_TAIL, "warp_id", 0, "==", (psS64)atoll(str))) {
    253253            psError(PS_ERR_UNKNOWN, false, "failed to add item warp_id");
    254254            psFree(config);
  • trunk/ippTools/src/pxtools.h

    r11047 r12131  
    2727# include <psmodules.h>
    2828# include <ippdb.h>
     29
    2930# include "pxtoolsErrorCodes.h"
     31# include "pxio.h"
     32# include "pxdata.h"
    3033
    3134// load these values from the db in the init stage
  • trunk/ippTools/src/pzgetimfiles.c

    r11859 r12131  
    624624            return NULL;
    625625        }
    626         if (!psMetadataAddS32(md, PS_LIST_TAIL, "bytes", 0, NULL, (psS32)atoi(bytes))) {
     626        if (!psMetadataAddS64(md, PS_LIST_TAIL, "bytes", 0, NULL, (psS64)atoll(bytes))) {
    627627            psError(PS_ERR_UNKNOWN, false, "failed to add item bytes");
    628628            psFree(md);
  • trunk/ippTools/src/regtool.c

    r12096 r12131  
    4141// static guidePendingExpRow *newToP1PendingExp(newExpRow *newExp);
    4242static chipPendingExpRow *newTochipPendingExp(pxConfig *config, newExpRow *newExp);
    43 static chipPendingImfileRow *rawImfileTochipPendingImfile(pxConfig *config, rawImfileRow *rawImfile);
     43static chipPendingImfileRow *rawImfileTochipPendingImfile(pxConfig *config, psS64 chip_id, rawImfileRow *rawImfile);
    4444
    4545static rawExpRow *newToRawExp(pxConfig *config, newExpRow *exp);
     
    664664            return false;
    665665        }
     666
     667        // get the chip_id for the imfiles
     668        psS64 chip_id = psDBLastInsertID(config->dbh);
    666669        psFree(chipPendingExp);
    667670
     
    712715        for (long i = 0; i < psArrayLength(rawImfiles); i++) {
    713716            rawImfileRow *rawImfile = rawImfiles->data[i];
    714             chipPendingImfileRow *pendingImfile = rawImfileTochipPendingImfile(config, rawImfile);
     717            chipPendingImfileRow *pendingImfile = rawImfileTochipPendingImfile(config, chip_id, rawImfile);
    715718            if (!chipPendingImfileInsertObject(config->dbh, pendingImfile)){
    716719                // rollback
     
    890893
    891894    chipPendingExpRow *chipExp = chipPendingExpRowAlloc(
    892         exp->exp_tag,
    893         0x0,            // chip version XXX calc version number
    894         0xdeadbeef,     // guide version
    895         label,
    896         "my recipe",
    897         NULL,           // groupa
    898         NULL            // dvodb
     895            0,              // chip ID, assigned by db
     896            exp->exp_tag,
     897            0xdeadbeef,     // guide version
     898            label,
     899            "my recipe",    // recipe
     900            NULL,           // expgroup
     901            NULL            // dvodb
    899902    );
    900903
     
    903906
    904907
    905 static chipPendingImfileRow *rawImfileTochipPendingImfile(pxConfig *config, rawImfileRow *rawImfile)
     908static chipPendingImfileRow *rawImfileTochipPendingImfile(pxConfig *config, psS64 chip_id, rawImfileRow *rawImfile)
    906909{
    907910    return chipPendingImfileRowAlloc(
    908         rawImfile->exp_tag,
    909         0x0,          // chip version XXX calc version number
    910         0xdeadbeef,   // guide version
    911         rawImfile->class_id,
    912         "my recipe",
    913         rawImfile->uri
     911            chip_id,
     912            rawImfile->exp_tag,
     913            0xdeadbeef,     // guide version
     914            rawImfile->class_id,
     915            "my recipe",    // recipe
     916            rawImfile->uri
    914917    );
    915918}
  • trunk/ippTools/src/stacktool.c

    r12114 r12131  
    192192            return false;
    193193        }
    194         if (!stackInputSkyfileInsert(config->dbh, run->stack_id, atoi((char *)item->data.V))) {
     194        if (!stackInputSkyfileInsert(config->dbh, run->stack_id, (psS64)atoll((char *)item->data.V))) {
    195195            if (!psDBRollback(config->dbh)) {
    196196                psError(PS_ERR_UNKNOWN, false, "database error");
     
    296296    // constrants
    297297    if (!stackInputSkyfileInsert(config->dbh,
    298             (psS32)atoi(stack_id),
    299             (psS32)atoi(warp_id)
     298            (psS64)atoll(stack_id),
     299            (psS64)atoll(warp_id)
    300300        )) {
    301301        psError(PS_ERR_UNKNOWN, false, "database error");
     
    388388
    389389    if (psArrayLength(output)) {
     390        if (!convertIdToStr(output)) {
     391            psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
     392            psFree(output);
     393            return false;
     394        }
     395
    390396        // negative simple so the default is true
    391397        if (!ippdbPrintMetadatas(stdout, output, "stackInputSkyfile", !simple)) {
     
    477483
    478484    if (psArrayLength(output)) {
     485        if (!convertIdToStr(output)) {
     486            psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
     487            psFree(output);
     488            return false;
     489        }
     490
    479491        // negative simple so the default is true
    480492        if (!ippdbPrintMetadatas(stdout, output, "stackSumSkyfile", !simple)) {
     
    539551    // constrants
    540552    if (!stackSumSkyfileInsert(config->dbh,
    541             (psS32)atoi(stack_id),
     553            (psS64)atoll(stack_id),
    542554            uri,
    543555            bg,
     
    642654
    643655    if (psArrayLength(output)) {
     656        if (!convertIdToStr(output)) {
     657            psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
     658            psFree(output);
     659            return false;
     660        }
     661
    644662        if (!ippdbPrintMetadatas(stdout, output, "stackSumSkyfile", !simple)) {
    645663            psError(PS_ERR_UNKNOWN, false, "failed to print array");
  • trunk/ippTools/src/stacktoolConfig.c

    r12029 r12131  
    226226    bool status = false;
    227227    if ((str = psMetadataLookupStr(&status, config->args, "-warp_id"))) {
    228         if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "warp_id", 0, "==", (psS32)atoi(str))) {
     228        if (!psMetadataAddS64(config->where, PS_LIST_TAIL, "warp_id", 0, "==", (psS64)atoll(str))) {
    229229            psError(PS_ERR_UNKNOWN, false, "failed to add item warp_id");
    230230            psFree(config);
  • trunk/ippTools/src/warptool.c

    r12105 r12131  
    239239    }
    240240
    241     psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag");
    242     if (!status) {
    243         psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_tag");
    244         return false;
    245     }
    246     if (!exp_tag) {
    247         psError(PS_ERR_UNKNOWN, true, "-exp_tag is required");
    248         return false;
    249     }
    250 
    251     // defaults to 0
    252     psS32 cam_version = psMetadataLookupS32(&status, config->args, "-cam_version");
    253     if (!status) {
    254         psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -cam_version");
     241    psString cam_id = psMetadataLookupStr(&status, config->args, "-cam_id");
     242    if (!status) {
     243        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -cam_id");
     244        return false;
     245    }
     246    if (!cam_id) {
     247        psError(PS_ERR_UNKNOWN, true, "-cam_id is required");
    255248        return false;
    256249    }
     
    267260    // constrants
    268261    if (!warpInputExpInsert(config->dbh,
    269             (psS32)atoi(warp_id),
    270             exp_tag,
    271             cam_version,
     262            (psS64)atoll(warp_id),
     263            (psS64)atoll(cam_id),
    272264            magiced
    273265        )) {
     
    299291        "   USING(warp_id)\n"
    300292        " JOIN camProcessedExp\n"
    301         "   ON warpInputExp.exp_tag = camProcessedExp.exp_tag\n"
    302         "   AND warpInputExp.cam_version = camProcessedExp.cam_version\n"
     293        "   ON warpInputExp.cam_id = camProcessedExp.cam_id\n"
    303294        " WHERE\n"
    304295        "   warpRun.state = 'run'\n"
     
    357348
    358349    if (psArrayLength(output)) {
     350        if (!convertIdToStr(output)) {
     351            psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
     352            psFree(output);
     353            return false;
     354        }
     355
    359356        // negative simple so the default is true
    360357        if (!ippdbPrintMetadatas(stdout, output, "warpInputExp", !simple)) {
     
    386383        "SELECT\n"
    387384        "   rawImfile.*,\n"
    388         "   warpInputExp.cam_version\n"
     385        "   warpInputExp.cam_id\n"
    389386        " FROM warpRun\n"
    390387        " JOIN warpInputExp\n"
    391388        "   USING(warp_id)\n"
     389        " JOIN camProcessedExp\n"
     390        "   ON warpInputExp.cam_id = camProcessedExp.cam_id"
     391        " JOIN chipProcessedExp\n"
     392        "   ON camProcessedExp.chip_id = chipProcessedExp.chip_id"
    392393        " JOIN rawImfile\n" // is there any reason not to refer back to rawimfiles?
    393         "   ON warpInputExp.exp_tag = rawImfile.exp_tag\n"
     394        "   ON chipProcessedExp.exp_tag = rawImfile.exp_tag\n"
    394395        " WHERE\n"
    395396        "   warpRun.state = 'run'\n"
     
    446447
    447448    if (psArrayLength(output)) {
     449        if (!convertIdToStr(output)) {
     450            psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
     451            psFree(output);
     452            return false;
     453        }
     454
    448455        // negative simple so the default is true
    449456        if (!ippdbPrintMetadatas(stdout, output, "warpInputImfile", !simple)) {
     
    482489        "   USING(warp_id)\n"
    483490        " JOIN camProcessedExp\n"
    484         "   ON warpInputExp.exp_tag = camProcessedExp.exp_tag\n"
    485         "   AND warpInputExp.cam_version = camProcessedExp.cam_version\n"
     491        "   ON warpInputExp.cam_id = camProcessedExp.cam_id\n"
     492        " JOIN chipProcessedExp\n"
     493        "   ON camProcessedExp.chip_id = chipProcessedExp.chip_id"
    486494        " JOIN rawExp\n"
    487         "   ON camProcessedExp.exp_tag = rawExp.exp_tag\n"
     495        "   ON chipProcessedExp.exp_tag = rawExp.exp_tag\n"
    488496        " LEFT JOIN warpSkyCellMap\n"
    489497        "   ON warpInputExp.warp_id = warpSkyCellMap.warp_id\n"
    490         "   AND warpInputExp.exp_tag = warpSkyCellMap.exp_tag\n"
    491         "   AND warpInputExp.cam_version = warpSkyCellMap.cam_version\n"
     498        "   AND warpInputExp.cam_id = warpSkyCellMap.cam_id\n"
    492499        " WHERE\n"
    493500        "   warpRun.state = 'run'\n"
    494501        "   AND camProcessedExp.fault = 0\n"
    495502        "   AND warpSkyCellMap.warp_id IS NULL\n"
    496         "   AND warpSkyCellMap.exp_tag IS NULL\n"
    497         "   AND warpSkyCellMap.cam_version IS NULL\n"
     503        "   AND warpSkyCellMap.cam_id IS NULL\n"
    498504    );
    499505
     
    549555
    550556    if (psArrayLength(output)) {
     557        if (!convertIdToStr(output)) {
     558            psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
     559            psFree(output);
     560            return false;
     561        }
     562
    551563        // negative simple so the default is true
    552564        if (!ippdbPrintMetadatas(stdout, output, "warpInputExp", !simple)) {
     
    681693        " JOIN warpSkyCellMap\n"
    682694        "   USING(warp_id)\n"
     695        " JOIN camProcessedExp\n"
     696        "   ON warpSkyCellMap.cam_id = camProcessedExp.cam_id"
    683697        " JOIN chipProcessedImfile\n"
    684         "   ON warpSkyCellMap.exp_tag = chipProcessedImfile.exp_tag\n"
     698        "   ON camProcessedExp.chip_id = chipProcessedImfile.chip_id"
    685699        "   AND warpSkyCellMap.class_id = chipProcessedImfile.class_id\n"
    686700        " WHERE\n"
     
    739753
    740754    if (psArrayLength(output)) {
     755        if (!convertIdToStr(output)) {
     756            psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
     757            psFree(output);
     758            return false;
     759        }
     760
    741761        // negative simple so the default is true
    742762        if (!ippdbPrintMetadatas(stdout, output, "warpSkyCellMap", !simple)) {
     
    773793        " JOIN warpSkyCellMap\n"
    774794        "   USING(warp_id)\n"
     795        " JOIN camProcessedExp\n"
     796        "   ON warpSkyCellMap.cam_id = camProcessedExp.cam_id"
     797        " JOIN chipProcessedExp\n"
     798        "   ON camProcessedExp.chip_id = chipProcessedExp.chip_id"
    775799        " JOIN rawExp\n"
    776         "   ON warpSkyCellMap.exp_tag = rawExp.exp_tag\n"
     800        "   ON chipProcessedExp.exp_tag = rawExp.exp_tag\n"
    777801        " LEFT JOIN warpSkyfile\n"
    778802        "   ON warpRun.warp_id = warpSkyfile.warp_id\n"
     
    837861
    838862    if (psArrayLength(output)) {
     863        if (!convertIdToStr(output)) {
     864            psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
     865            psFree(output);
     866            return false;
     867        }
     868
    839869        // negative simple so the default is true
    840870        if (!ippdbPrintMetadatas(stdout, output, "warpPendingSkyCell", !simple)) {
     
    918948    // XXX need to validate that this coresponds to an warpInputImfile
    919949    if (!warpSkyfileInsert(config->dbh,
    920             (psS32)atoi(warp_id),
     950            (psS64)atoll(warp_id),
    921951            skycell_id,
    922952            tess_id,
     
    11251155
    11261156    if (psArrayLength(output)) {
     1157        if (!convertIdToStr(output)) {
     1158            psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
     1159            psFree(output);
     1160            return false;
     1161        }
     1162
    11271163        // negative simple so the default is true
    11281164        if (!ippdbPrintMetadatas(stdout, output, "warpSkyfile", !simple)) {
  • trunk/ippTools/src/warptoolConfig.c

    r12029 r12131  
    6060    psMetadata *updaterunArgs = psMetadataAlloc();
    6161    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-warp_id", 0,
    62             "define warp ID (required)", NULL);
     62            "define warptool ID (required)", NULL);
    6363    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-state", 0,
    6464            "set state (required)", NULL);
     
    7373    psMetadata *addinputexpArgs = psMetadataAlloc();
    7474    psMetadataAddStr(addinputexpArgs, PS_LIST_TAIL, "-warp_id", 0,
    75             "define warp ID (required)", NULL);
    76     psMetadataAddStr(addinputexpArgs, PS_LIST_TAIL, "-exp_tag", 0,
    77             "define exposure tag (required)", NULL);
    78     psMetadataAddS32(addinputexpArgs, PS_LIST_TAIL, "-cam_version", 0,
    79             "define phase 3 version of exposure tag (required)", 0);
     75            "define warptool ID (required)", NULL);
     76    psMetadataAddStr(addinputexpArgs, PS_LIST_TAIL, "-cam_id", 0,
     77            "define camtool ID (required)", NULL);
    8078    psMetadataAddBool(addinputexpArgs, PS_LIST_TAIL, "-magiced",  0,
    8179            "has this exposure been magiced", false);
     
    8482    psMetadata *expArgs = psMetadataAlloc();
    8583    psMetadataAddStr(expArgs, PS_LIST_TAIL, "-warp_id", 0,
    86             "define warp ID (required)", NULL);
    87     psMetadataAddStr(expArgs, PS_LIST_TAIL, "-exp_tag", 0,
    88             "define exposure tag (required)", NULL);
    89     psMetadataAddS32(expArgs, PS_LIST_TAIL, "-cam_version", 0,
    90             "define phase 3 version of exposure tag (required)", 0);
     84            "search by warptool ID", NULL);
     85    psMetadataAddStr(expArgs, PS_LIST_TAIL, "-cam_id", 0,
     86            "search by camtool ID", NULL);
    9187    psMetadataAddU64(expArgs, PS_LIST_TAIL, "-limit",  0,
    9288            "limit result set to N items", 0);
     
    9793    psMetadata *imfileArgs = psMetadataAlloc();
    9894    psMetadataAddStr(imfileArgs, PS_LIST_TAIL, "-warp_id", 0,
    99             "define warp ID (required)", NULL);
    100     psMetadataAddStr(imfileArgs, PS_LIST_TAIL, "-exp_tag", 0,
    101             "define exposure tag (required)", NULL);
    102     psMetadataAddS32(imfileArgs, PS_LIST_TAIL, "-cam_version", 0,
    103             "define phase 3 version of exposure tag (required)", 0);
     95            "search by warptool ID", NULL);
     96    psMetadataAddStr(imfileArgs, PS_LIST_TAIL, "-cam_id", 0,
     97            "search by camtool ID", NULL);
    10498    psMetadataAddU64(imfileArgs, PS_LIST_TAIL, "-limit",  0,
    10599            "limit result set to N items", 0);
     
    119113    psMetadata *addoverlapArgs = psMetadataAlloc();
    120114    psMetadataAddStr(addoverlapArgs, PS_LIST_TAIL, "-mapfile", 0,
    121             "skycell <-> imfile mapping description", NULL);
     115            "path to skycell <-> imfile mapping file", NULL);
    122116
    123117    // -scmap
    124118    psMetadata *scmapArgs = psMetadataAlloc();
    125119    psMetadataAddStr(scmapArgs, PS_LIST_TAIL, "-warp_id", 0,
    126             "search by warp ID", NULL);
     120            "search by warptool ID", NULL);
    127121    psMetadataAddStr(scmapArgs, PS_LIST_TAIL, "-skycell_id", 0,
    128122            "searcy by skycell ID", NULL);
     
    137131    psMetadata *towarpedArgs = psMetadataAlloc();
    138132    psMetadataAddStr(towarpedArgs, PS_LIST_TAIL, "-warp_id", 0,
    139             "search by warp ID", NULL);
     133            "search by warptool ID", NULL);
    140134    psMetadataAddU64(towarpedArgs, PS_LIST_TAIL, "-limit",  0,
    141135            "limit result set to N items", 0);
     
    146140    psMetadata *addwarpedArgs = psMetadataAlloc();
    147141    psMetadataAddStr(addwarpedArgs, PS_LIST_TAIL, "-warp_id", 0,
    148             "define warp ID (required)", NULL);
     142            "define warptool ID (required)", NULL);
    149143    psMetadataAddStr(addwarpedArgs, PS_LIST_TAIL, "-skycell_id",  0,
    150144            "define skycell ID (required)", NULL);
     
    161155    psMetadata *warpedArgs = psMetadataAlloc();
    162156    psMetadataAddStr(warpedArgs, PS_LIST_TAIL, "-warp_id", 0,
    163             "search by warp ID", NULL);
     157            "search by warptool ID", NULL);
    164158    psMetadataAddStr(warpedArgs, PS_LIST_TAIL, "-skycell_id",  0,
    165159            "define skycell ID (required)", NULL);
     
    168162    psMetadataAddStr(warpedArgs, PS_LIST_TAIL, "-exp_tag", 0,
    169163            "define exposure tag (required)", NULL);
    170     psMetadataAddS32(warpedArgs, PS_LIST_TAIL, "-cam_version", 0,
    171             "define phase 3 version of exposure tag (required)", 0);
     164    psMetadataAddStr(warpedArgs, PS_LIST_TAIL, "-cam_id", 0,
     165            "define phase 3 version of exposure tag (required)", NULL);
    172166    psMetadataAddU64(warpedArgs, PS_LIST_TAIL, "-limit",  0,
    173167            "limit result set to N items", 0);
     
    286280    bool status = false;
    287281    if ((str = psMetadataLookupStr(&status, config->args, "-warp_id"))) {
    288         if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "warp_id", 0, "==", (psS32)atoi(str))) {
     282        if (!psMetadataAddS64(config->where, PS_LIST_TAIL, "warp_id", 0, "==", (psS64)atoll(str))) {
    289283            psError(PS_ERR_UNKNOWN, false, "failed to add item warp_id");
    290284            psFree(config);
Note: See TracChangeset for help on using the changeset viewer.