IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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)) {
Note: See TracChangeset for help on using the changeset viewer.