IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23566


Ignore:
Timestamp:
Mar 26, 2009, 2:03:56 PM (17 years ago)
Author:
bills
Message:

progress on query for components ready to be processed

Location:
trunk/ippTools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/share/disttool_definebyquery_select.sql

    r23394 r23566  
    2020    WHERE distTarget.state = 'enabled'
    2121        AND rcInterest.state = 'enabled'
    22         AND chipRun.state = 'full'       -- XXX: we need a completed chip stage magicDSRun because we
     22        AND chipRun.state = 'full'       -- Note: we need a completed chip stage magicDSRun because we
    2323                                         -- need the mask file to NAN masked pixels
    2424        -- to support cameras that don't need magic disttool adds the magicked restriction
    2525        -- \nAND rawExp.magicked AND chipRun.magicked here:
    26         AND rawExp.magicked AND chipRun.magicked
    2726        -- raw magicked HOOK %s
    2827        AND distRun.dist_id IS NULL      -- no existing distRun
     
    4645            -- If camera requires files to be magicked before distibution
    4746            -- the following gets added by disttool
    48             -- AND chipRun.magicked
     47            AND chipRun.magicked
    4948            -- chip magicked HOOK %s
    5049           )
  • trunk/ippTools/share/disttool_pendingcomponent.sql

    r23254 r23566  
    22SELECT
    33    distRun.dist_id,
     4    distRun.label,
    45    stage,
    56    stage_id,
     
    89    rawExp.camera,
    910    outroot,
    10     rawImfile.uri as path_base,
     11    rawImfile.uri as path_base,         -- change this once rawImfile has path_base
    1112    chipProcessedImfile.path_base as chip_path_base,
    1213    NULL as state,
     
    1516FROM distRun
    1617JOIN rawExp ON exp_id = stage_id
    17 JOIN rawImfile using(exp_id)
     18JOIN (                      -- find the last magicked chip run
     19    SELECT
     20        exp_id,
     21        MAX(chip_id) AS chip_id
     22    FROM chipRun
     23    WHERE
     24        chipRun.state = 'full'
     25        AND chipRun.exp_id = exp_id
     26        --   AND chipRun.magicked
     27        -- magicked hook 1 %s
     28        GROUP BY exp_id
     29    ) AS bestChipRun
     30    USING(exp_id)
     31JOIN rawImfile USING(exp_id)
    1832JOIN chipProcessedImfile
    19     ON distRun.chip_id = chipProcessedImfile.chip_id
    20     AND rawImfile.class_id = chipProcessedImfile.class_id
     33    USING(exp_id, chip_id, class_id)
    2134LEFT JOIN distComponent
    2235    ON distRun.dist_id = distComponent.dist_id
     
    2639    AND distRun.stage = 'raw'
    2740    AND distComponent.dist_id IS NULL
     41    -- if magicked add AND rawImfile.magicked here
     42    -- where hook 1 %s
    2843
    2944-- chip stage
     
    3146SELECT
    3247    distRun.dist_id,
     48    distRun.label,
    3349    stage,
    3450    stage_id,
     
    5369    AND distRun.stage = 'chip'
    5470    AND distComponent.dist_id IS NULL
    55 UNION
    56 SELECT
    57     distRun.dist_id,
     71    -- where hook 2 %s
     72UNION
     73SELECT
     74    distRun.dist_id,
     75    distRun.label,
     76    stage,
     77    stage_id,
     78    chipProcessedImfile.class_id AS component,
     79    clean,
     80    rawExp.camera,
     81    outroot,
     82    camProcessedExp.path_base,
     83    chipProcessedImfile.path_base as chip_path_base,
     84    camRun.state,
     85    NULL,
     86    0
     87FROM distRun
     88JOIN camRun ON camRun.cam_id = distRun.stage_id
     89JOIN camProcessedExp USING(cam_id)
     90JOIN chipRun USING(chip_id)
     91JOIN chipProcessedImfile USING(exp_id, chip_id)
     92JOIN rawExp using(exp_id)
     93LEFT JOIN distComponent
     94    ON distRun.dist_id = distComponent.dist_id
     95    AND chipProcessedImfile.class_id = distComponent.component
     96WHERE
     97    distRun.state = 'new'
     98    AND distRun.stage = 'camera'
     99    AND distComponent.dist_id IS NULL
     100    -- where hook 3 %s
     101UNION
     102SELECT
     103    distRun.dist_id,
     104    distRun.label,
     105    stage,
     106    stage_id,
     107    fakeProcessedImfile.class_id AS component,
     108    clean,
     109    rawExp.camera,
     110    outroot,
     111    fakeProcessedImfile.path_base,
     112    NULL,
     113    fakeRun.state,
     114    NULL,
     115    0
     116FROM distRun
     117JOIN fakeRun ON fakeRun.fake_id = distRun.stage_id
     118JOIN fakeProcessedImfile USING(fake_id)
     119JOIN camRun USING(cam_id)
     120JOIN chipRun USING(chip_id, exp_id)
     121JOIN rawExp using(exp_id)
     122LEFT JOIN distComponent
     123    ON distRun.dist_id = distComponent.dist_id
     124    AND fakeProcessedImfile.class_id = distComponent.component
     125WHERE
     126    distRun.state = 'new'
     127    AND distRun.stage = 'fake'
     128    AND distComponent.dist_id IS NULL
     129    -- where hook 4 %s
     130UNION
     131SELECT
     132    distRun.dist_id,
     133    distRun.label,
    58134    stage,
    59135    stage_id,
     
    81157    AND distRun.stage = 'warp'
    82158    AND distComponent.dist_id IS NULL
    83 UNION
    84 SELECT
    85     distRun.dist_id,
     159    -- where hook 5 %s
     160UNION
     161SELECT
     162    distRun.dist_id,
     163    distRun.label,
    86164    stage,
    87165    stage_id,
     
    108186    AND distRun.stage = 'diff'
    109187    AND distComponent.dist_id IS NULL
     188    -- where hook 6 %s
    110189UNION
    111190SELECT DISTINCT
    112191    distRun.dist_id,
     192    distRun.label,
    113193    stage,
    114194    stage_id,
     
    152232    AND distRun.stage = 'stack'
    153233    AND distComponent.dist_id IS NULL
     234    -- where hook 7 %s
    154235) as Foo
  • trunk/ippTools/share/pxadmin_create_tables.sql

    r23390 r23566  
    12491249    stage       VARCHAR(64),
    12501250    stage_id    BIGINT,
    1251     chip_id     BIGINT,
    12521251    label       VARCHAR(64),
    12531252    outroot     VARCHAR(255),
  • trunk/ippTools/src/disttool.c

    r23365 r23566  
    296296    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
    297297    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
     298    PXOPT_LOOKUP_BOOL(need_magic, config->args, "-need_magic", false);
    298299
    299300    // look for "inputs" that need to processed
     
    318319    }
    319320
    320     if (!p_psDBRunQuery(config->dbh, query)) {
     321    psString    chip_magic = "";
     322    psString    raw_where = "";
     323    psString    chip_where = "";
     324    psString    camera_where = "";
     325    psString    fake_where = "";
     326    psString    warp_where = "";
     327    psString    diff_where = "";
     328    psString    stack_where = "";
     329
     330    if (need_magic) {
     331        chip_magic = psStringCopy("\nAND chipRun.magicked");
     332        raw_where  = psStringCopy("\nAND rawExp.magicked");
     333        chip_where = psStringCopy("\nAND (distRun.clean OR chipRun.magicked)");
     334        // chipRun must be magicked to allow release camera level masks
     335        camera_where = psStringCopy("\nAND (distRun.clean OR chipRun.magicked)");
     336        warp_where = psStringCopy("\nAND (distRun.clean OR warpRun.magicked)");
     337        diff_where = psStringCopy("\nAND (distRun.clean OR diffRun.magicked)");
     338    }
     339
     340    if (!p_psDBRunQueryF(config->dbh,
     341            query,
     342            chip_magic,
     343            raw_where,
     344            chip_where,
     345            camera_where,
     346            fake_where,
     347            warp_where,
     348            diff_where,
     349            stack_where)) {
    321350        psError(PS_ERR_UNKNOWN, false, "database error");
    322351        psFree(query);
  • trunk/ippTools/src/disttoolConfig.c

    r23393 r23566  
    7575    psMetadataAddS64(pendingcomponentArgs, PS_LIST_TAIL, "-dist_id", 0, "define dist_id", 0);
    7676    psMetadataAddStr(pendingcomponentArgs, PS_LIST_TAIL, "-stage",    0, "limit results to runs for stage", NULL);
     77    psMetadataAddBool(pendingcomponentArgs, PS_LIST_TAIL, "-need_magic", 0, "magic is needed", false);
    7778    psMetadataAddStr(pendingcomponentArgs, PS_LIST_TAIL, "-label",    0, "limit results to label", NULL);
    7879    psMetadataAddU64(pendingcomponentArgs, PS_LIST_TAIL, "-limit",  0,  "limit result set to N items", 0);
Note: See TracChangeset for help on using the changeset viewer.