IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 26, 2009, 1:59:32 PM (17 years ago)
Author:
beaumont
Message:

merged with trunk

Location:
branches/cnb_branches/cnb_branch_20090301
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090301

  • branches/cnb_branches/cnb_branch_20090301/ippTools/share

    • Property svn:ignore
      •  

        old new  
        11Makefile.in
        22Makefile
         3pxadmin_create_mirror_tables.sql
  • branches/cnb_branches/cnb_branch_20090301/ippTools/share/disttool_pendingcomponent.sql

    r23594 r24244  
    11SELECT * FROM (
     2    -- raw stage
    23SELECT
    34    distRun.dist_id,
     
    89    clean,
    910    rawExp.camera,
    10     outroot,
     11    CONCAT_WS('.', outroot, CONVERT(distRun.dist_id, CHAR)) as outdir,
    1112    rawImfile.uri as path_base,         -- change this once rawImfile has path_base
    1213    chipProcessedImfile.path_base as chip_path_base,
    1314    NULL as state,
    1415    NULL as data_state,
     16    0 as quality,
     17    distRun.no_magic,
    1518    rawImfile.magicked
    1619FROM distRun
    1720JOIN rawExp ON exp_id = stage_id
    18 JOIN (                      -- find the last magicked chip run
     21JOIN (                      -- find the last satisfactory chip run
     22                            -- note this requires that a chip run have been completed even when
     23                            -- magic is not required for the run
    1924    SELECT
    2025        exp_id,
    2126        MAX(chip_id) AS chip_id
    2227    FROM chipRun
     28    JOIN distRun ON stage_id = exp_id AND stage = 'raw'
    2329    WHERE
    2430        chipRun.state = 'full'
    2531        AND chipRun.exp_id = exp_id
    26         --   AND chipRun.magicked
    27         -- magicked hook 1 %s
     32        AND (chipRun.magicked OR distRun.no_magic)
    2833        GROUP BY exp_id
    2934    ) AS bestChipRun
     
    3742WHERE
    3843    distRun.state = 'new'
     44    AND distRun.clean = 0
    3945    AND distRun.stage = 'raw'
    4046    AND distComponent.dist_id IS NULL
    41     -- if magicked add AND rawImfile.magicked here
     47    AND (rawExp.magicked OR distRun.no_magic)
    4248    -- where hook 1 %s
     49UNION
     50    -- raw stage clean (dbinfo only)
     51SELECT
     52    distRun.dist_id,
     53    distRun.label,
     54    stage,
     55    stage_id,
     56    'exposure' AS component,
     57    clean,
     58    rawExp.camera,
     59    CONCAT_WS('.', outroot, CONVERT(distRun.dist_id, CHAR)) as outdir,
     60    NULL,
     61    NULL,
     62    NULL as state,
     63    NULL as data_state,
     64    0 as quality,
     65    distRun.no_magic,
     66    rawExp.magicked
     67FROM distRun
     68JOIN rawExp ON exp_id = stage_id
     69LEFT JOIN distComponent
     70    ON distRun.dist_id = distComponent.dist_id
     71WHERE
     72    distRun.state = 'new'
     73    AND distRun.stage = 'raw'
     74    AND distRun.clean
     75    AND distComponent.dist_id IS NULL
     76    -- where hook 2 %s
    4377
    4478-- chip stage
     
    5286    clean,
    5387    rawExp.camera,
    54     outroot,
     88    CONCAT_WS('.', outroot, CONVERT(distRun.dist_id, CHAR)) as outdir,
    5589    chipProcessedImfile.path_base,
    5690    chipProcessedImfile.path_base as chip_path_base,
    5791    chipRun.state,
    5892    chipProcessedImfile.data_state,
     93    chipProcessedImfile.quality,
     94    distRun.no_magic,
    5995    chipProcessedImfile.magicked
    6096FROM distRun
     
    69105    AND distRun.stage = 'chip'
    70106    AND distComponent.dist_id IS NULL
    71     -- where hook 2 %s
    72 UNION
    73 SELECT
    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,
     107    AND (distRun.clean OR chipRun.magicked OR distRun.no_magic)
     108    AND (chipRun.state = 'full' OR (distRun.clean AND chipRun.state = 'cleaned'))
     109    -- where hook 3 %s
     110UNION
     111SELECT
     112    distRun.dist_id,
     113    distRun.label,
     114    stage,
     115    stage_id,
     116    'exposure' AS component,
     117--    chipProcessedImfile.class_id AS component,
     118    clean,
     119    rawExp.camera,
     120    CONCAT_WS('.', outroot, CONVERT(distRun.dist_id, CHAR)) as outdir,
    82121    camProcessedExp.path_base,
    83     chipProcessedImfile.path_base as chip_path_base,
     122    NULL as chip_path_base,
    84123    camRun.state,
    85124    NULL,
    86     0
     125    camProcessedExp.quality,
     126    distRun.no_magic,
     127    chipRun.magicked
    87128FROM distRun
    88129JOIN camRun ON camRun.cam_id = distRun.stage_id
    89130JOIN camProcessedExp USING(cam_id)
    90131JOIN chipRun USING(chip_id)
    91 JOIN chipProcessedImfile USING(exp_id, chip_id)
    92 JOIN rawExp using(exp_id)
    93 LEFT JOIN distComponent
    94     ON distRun.dist_id = distComponent.dist_id
    95     AND chipProcessedImfile.class_id = distComponent.component
     132-- JOIN chipProcessedImfile USING(exp_id, chip_id)
     133JOIN rawExp using(exp_id)
     134LEFT JOIN distComponent
     135    ON distRun.dist_id = distComponent.dist_id
     136--    AND chipProcessedImfile.class_id = distComponent.component
    96137WHERE
    97138    distRun.state = 'new'
    98139    AND distRun.stage = 'camera'
    99140    AND distComponent.dist_id IS NULL
    100     -- where hook 3 %s
     141    AND (distRun.clean OR chipRun.magicked OR distRun.no_magic)
     142    AND (camRun.state = 'full' OR (distRun.clean AND camRun.state = 'cleaned'))
     143    -- where hook 4 %s
    101144UNION
    102145SELECT
     
    108151    clean,
    109152    rawExp.camera,
    110     outroot,
     153    CONCAT_WS('.', outroot, CONVERT(distRun.dist_id, CHAR)) as outdir,
    111154    fakeProcessedImfile.path_base,
    112155    NULL,
    113156    fakeRun.state,
    114157    NULL,
     158    0 as quality,
     159    distRun.no_magic,
    115160    0
    116161FROM distRun
     
    127172    AND distRun.stage = 'fake'
    128173    AND distComponent.dist_id IS NULL
    129     -- where hook 4 %s
     174    -- where hook 5 %s
    130175UNION
    131176SELECT
     
    137182    clean,
    138183    rawExp.camera,
    139     outroot,
     184    CONCAT_WS('.', outroot, CONVERT(distRun.dist_id, CHAR)) as outdir,
    140185    warpSkyfile.path_base,
    141186    NULL as chip_path_base,
    142187    warpRun.state,
    143188    warpSkyfile.data_state,
     189    warpSkyfile.quality,
     190    distRun.no_magic,
    144191    warpSkyfile.magicked
    145192FROM distRun
     
    157204    AND distRun.stage = 'warp'
    158205    AND distComponent.dist_id IS NULL
    159     -- where hook 5 %s
     206    AND (distRun.clean OR warpRun.magicked OR distRun.no_magic)
     207    AND (warpRun.state = 'full' OR (distRun.clean AND warpRun.state = 'cleaned'))
     208    -- where hook 6 %s
    160209UNION
    161210SELECT
     
    167216    clean,
    168217    rawExp.camera,
    169     outroot,
     218    CONCAT_WS('.', outroot, CONVERT(distRun.dist_id, CHAR)) as outdir,
    170219    diffSkyfile.path_base,
    171220    NULL as chip_path_base,
     
    174223    -- diffSkyfile.data_state,
    175224    'full' AS data_state,
     225    diffSkyfile.quality,
     226    distRun.no_magic,
    176227    diffSkyfile.magicked
    177228FROM distRun
    178229JOIN diffRun ON stage_id = diff_id
    179230JOIN diffSkyfile using(diff_id)
    180 JOIN rawExp using(exp_id)
     231JOIN diffInputSkyfile USING(diff_id, skycell_id)
     232JOIN warpRun
     233    ON warpRun.warp_id = diffInputSkyfile.warp1
     234JOIN fakeRun USING(fake_id)
     235JOIN camRun USING(cam_id)
     236JOIN chipRun USING(chip_id)
     237JOIN rawExp USING(exp_id)
    181238LEFT JOIN distComponent
    182239    ON distRun.dist_id = distComponent.dist_id
     
    186243    AND distRun.stage = 'diff'
    187244    AND distComponent.dist_id IS NULL
    188     -- where hook 6 %s
     245    AND (distRun.clean OR diffRun.magicked OR distRun.no_magic)
     246    AND (diffRun.state = 'full' OR (distRun.clean AND diffRun.state = 'cleaned'))
     247    -- where hook 7 %s
    189248UNION
    190249SELECT DISTINCT
     
    196255    clean,
    197256    rawExp.camera,
    198     outroot,
     257    CONCAT_WS('.', outroot, CONVERT(distRun.dist_id, CHAR)) as outdir,
    199258    stackSumSkyfile.path_base,
    200259    NULL as chip_path_base,
     
    203262    -- stackSumSkyfile.data_state,
    204263    'full' AS data_state,
     264    stackSumSkyfile.quality,
     265    1 AS no_magic,
    205266    0 AS magicked
    206267FROM distRun
     
    232293    AND distRun.stage = 'stack'
    233294    AND distComponent.dist_id IS NULL
    234     -- where hook 7 %s
     295    AND (stackRun.state = 'full' OR (distRun.clean AND stackRun.state = 'cleaned'))
     296    -- where hook 8 %s
    235297) as Foo
Note: See TracChangeset for help on using the changeset viewer.