IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 28, 2011, 6:41:17 PM (15 years ago)
Author:
watersc1
Message:

Majority of ippTools/SQL work should be complete now. Need to start queueing exposures, and testing the script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20110406/ippTools/share/laptool_exposures.sql

    r31396 r31407  
    44      W.*,IFNULL(diff1.diff_id,diff2.diff_id) AS diff_id FROM (
    55    SELECT DISTINCT
    6         lap_id,tess_id,projection_cell,filter,lapRun.state as lapRun_state, lapRun.registered, lapRun.fault, labRun.label,
     6        lap_id,lapRun.tess_id,projection_cell,filter,lapRun.state as lapRun_state, lapRun.registered, lapRun.fault, lapRun.label,
    77        lapExp.exp_id,lapExp.chip_id,lapExp.pair_id,private,pairwise,active,lapExp.data_state,
    88        chipRun.state as chipRun_state, sum(chipProcessedImfile.fault) as chip_faults, sum(chipProcessedImfile.quality) as chip_quality,
    9         camRun.state as camRun_state,   sum(camProcessedExp.fault) AS cam_faults, sum(camProcessedExp.quality) AS cam_quality,
    10         fakeRun.state as fakeRun_state, sum(fakeProcessedImfile.fault) as fake_faults,
    11         warpRun.state as warpRun_state, sum(warpSkyfile.fault) as warp_faults, sum(warpSkyfile.quality) as warp_quality,
     9        camRun.cam_id, camRun.state as camRun_state,   sum(camProcessedExp.fault) AS cam_faults, sum(camProcessedExp.quality) AS cam_quality,
     10        fakeRun.fake_id, fakeRun.state as fakeRun_state, sum(fakeProcessedImfile.fault) as fake_faults,
     11        warpRun.warp_id, warpRun.state as warpRun_state, sum(warpSkyfile.fault) as warp_faults, sum(warpSkyfile.quality) as warp_quality,
    1212        warpRun.magicked
    1313    FROM lapRun JOIN lapExp USING(lap_id)
    14     JOIN chipRun USING(chip_id,exp_id)
    15     FROM chipRun JOIN chipProcessedImfile USING(chip_id)
     14    LEFT JOIN chipRun USING(chip_id)
     15    LEFT JOIN chipProcessedImfile USING(chip_id)
    1616    LEFT JOIN camRun USING(chip_id) LEFT JOIN camProcessedExp USING(cam_id)
    1717    LEFT JOIN fakeRun USING(cam_id) LEFT JOIN fakeProcessedImfile USING(fake_id)
    1818    LEFT JOIN warpRun USING(fake_id) LEFT JOIN warpSkyfile USING(warp_id)
    19     @WHERE@
     19    WHERE    @WHERE@
    2020    AND warpSkyfile.quality != 8007 -- known cases where quality != 0, but everything's fine.
    2121    AND warpSkyfile.quality != 3006 -- known cases where quality != 0, but everything's fine.
    22 
     22    GROUP BY lap_id,exp_id
    2323    ) AS W
    2424-- This was unreasonably slow in testing, so that's why I'm using a subquery here.
     
    2727) AS D
    2828LEFT JOIN diffRun USING(diff_id)
    29 JOIN lapExp AS others ON (D.chip_id = lapExp.chip_id AND D.lap_id != lapExp.lap_id)
    30 GROUP BY chip_id
     29JOIN lapExp AS others ON (D.chip_id = others.chip_id AND D.lap_id != others.lap_id)
     30GROUP BY lap_id,exp_id
Note: See TracChangeset for help on using the changeset viewer.