IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 26, 2010, 11:12:59 AM (16 years ago)
Author:
bills
Message:

reorganize the query for raw files to support distributing from alternate inputs

File:
1 edited

Legend:

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

    r26519 r27456  
    1 SELECT DISTINCT     -- we use distinct to handle multiple chip runs. Distribution will find right chipRun
     1SELECT
    22    'raw' AS stage,
    33    rawExp.exp_id AS stage_id,
    44    rawExp.exp_name AS run_tag,
    55    rawExp.magicked,
    6     chipRun.label,
    7     chipRun.data_group,
     6    camRun.label,
     7    camRun.data_group,
    88    distTarget.dist_group,
    99    distTarget.target_id,
    1010    distTarget.clean
    1111FROM rawExp
    12 JOIN chipRun USING(exp_id)
    13 JOIN distTarget ON distTarget.dist_group = chipRun.dist_group AND distTarget.stage = 'raw'
     12JOIN magicDSRun ON stage = 'raw' AND magicDSRun.stage_id = exp_id
     13JOIN camRun USING(cam_id)
     14JOIN distTarget ON distTarget.dist_group = camRun.dist_group AND distTarget.stage = 'raw'
    1415    AND rawExp.filter = distTarget.filter
    1516JOIN rcInterest USING(target_id)
    16 LEFT JOIN distRun ON distRun.stage_id = exp_id
    17     AND distRun.target_id = distTarget.target_id
    18     -- JOIN hook for magicked stuff %s
    19 WHERE distTarget.state = 'enabled'
     17LEFT JOIN distRun ON distRun.stage_id = exp_id AND distRun.target_id = distTarget.target_id
     18WHERE distRun.dist_id IS NULL           -- no existing distRun for this exposure
     19    AND distTarget.state = 'enabled'    -- target and intrest are enabled
    2020    AND rcInterest.state = 'enabled'
    21     AND distRun.dist_id IS NULL      -- no existing distRun
    22 
     21    AND magicDSRun.state = 'full'       -- destreaked files are available
Note: See TracChangeset for help on using the changeset viewer.