IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25013


Ignore:
Timestamp:
Aug 7, 2009, 10:51:43 AM (17 years ago)
Author:
bills
Message:

handle bothways (warp-warp) diffs separate from not bothways

Location:
trunk/ippTools/share
Files:
6 edited

Legend:

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

    r24937 r25013  
    66    camRun.cam_id,
    77    magicRun.label,
    8     magicRun.workdir
     8    magicRun.workdir,
     9    CAST(NULL AS SIGNED) AS inv_magic_id,
     10    CAST(NULL AS SIGNED) AS inv_exp_id
    911FROM magicRun
    1012    JOIN magicMask USING(magic_id)
  • trunk/ippTools/share/magicdstool_definebyquery_chip.sql

    r24937 r25013  
    66    camRun.cam_id,
    77    magicRun.label,
    8     magicRun.workdir
     8    magicRun.workdir,
     9    CAST(NULL AS SIGNED) AS inv_magic_id,
     10    CAST(NULL AS SIGNED) AS inv_exp_id
    911FROM magicRun
    1012    JOIN magicMask USING(magic_id)
  • trunk/ippTools/share/magicdstool_definebyquery_diff.sql

    r24937 r25013  
     1SELECT *
     2FROM (
    13SELECT
    24    magicRun.magic_id,
     
    68    0 AS cam_id,
    79    magicRun.label,
    8     magicRun.workdir
     10    magicRun.workdir,
     11    CAST(NULL AS SIGNED) AS inv_magic_id,
     12    CAST(NULL AS SIGNED) AS inv_exp_id
    913FROM magicRun
    1014    JOIN magicMask USING(magic_id)
     
    1519    AND ( -- rerun HOOK magicdstool sends "\n1 " if rerun else "\n0 " %s
    1620        OR magicDSRun.magic_ds_id IS NULL)
     21    AND diffRun.bothways = 0
    1722    AND diffRun.magicked  = 0
    1823    AND diffRun.state = 'full'
     24    -- WHERE hook %s
     25UNION
     26SELECT
     27    forwardRun.magic_id,
     28    forwardRun.exp_id,
     29    'diff' AS stage,
     30    forwardRun.diff_id AS stage_id,
     31    0 AS cam_id,
     32    forwardRun.label,
     33    forwardRun.workdir,
     34    inverseRun.magic_id AS inv_magic_id,
     35    inverseRun.exp_id AS inv_exp_id
     36FROM (
     37    SELECT
     38        magicRun.magic_id,
     39        exp_id,
     40        diff_id,
     41        magicRun.label,
     42        magicRun.workdir
     43    FROM magicRun
     44        JOIN magicMask USING(magic_id)
     45        JOIN diffRun USING(diff_id)
     46        LEFT JOIN magicDSRun ON magicRun.magic_id = magicDSRun.magic_id
     47                             AND magicDSRun.stage  = 'diff'
     48    WHERE magicRun.state = 'full'
     49        AND magicRun.inverse = 0
     50        AND ( -- rerun HOOK magicdstool sends "\n1 " if rerun else "\n0 " %s
     51            OR magicDSRun.magic_ds_id IS NULL)
     52        AND diffRun.state = 'full'
     53        AND diffRun.bothways
     54        AND diffRun.magicked  = 0
     55        -- WHERE hook %s
     56) AS forwardRun
     57JOIN (
     58    SELECT
     59        magic_id,
     60        exp_id,
     61        diff_id
     62    FROM magicRun
     63        JOIN magicMask USING(magic_id)
     64    WHERE magicRun.state = 'full'
     65        AND magicRun.inverse = 1
     66) AS inverseRun USING(diff_id)
    1967
     68) AS Foo
  • trunk/ippTools/share/magicdstool_definebyquery_raw.sql

    r24937 r25013  
    66    0 AS cam_id,
    77    magicRun.label,
    8     magicRun.workdir
     8    magicRun.workdir,
     9    CAST(NULL AS SIGNED) AS inv_magic_id,
     10    CAST(NULL AS SIGNED) AS inv_exp_id
    911FROM magicRun
    1012    JOIN magicMask USING(magic_id)
  • trunk/ippTools/share/magicdstool_definebyquery_warp.sql

    r24937 r25013  
    66    0 AS cam_id,
    77    magicRun.label,
    8     magicRun.workdir
     8    magicRun.workdir,
     9    CAST(NULL AS SIGNED) AS inv_magic_id,
     10    CAST(NULL AS SIGNED) AS inv_exp_id
    911FROM magicRun
    1012    JOIN magicMask USING(magic_id)
  • trunk/ippTools/share/magicdstool_todestreak.sql

    r24735 r25013  
    88    camera,
    99    magicMask.uri as streaks_uri,
     10    NULL AS inv_streaks_uri,
    1011    stage,
    1112    stage_id,
     
    4041    camera,
    4142    magicMask.uri as streaks_uri,
     43    NULL AS inv_streaks_uri,
    4244    stage,
    4345    stage_id,
     
    7779    camera,
    7880    magicMask.uri as streaks_uri,
     81    NULL AS inv_streaks_uri,
    7982    stage,
    8083    stage_id,
     
    115118    camera,
    116119    magicMask.uri as streaks_uri,
     120    NULL AS inv_streaks_uri,
    117121    stage,
    118122    stage_id,
     
    143147    AND magicDSFile.component IS NULL
    144148UNION
    145 -- diffSkyfiles
     149-- regular diffSkyfiles
    146150SELECT DISTINCT
    147151    magicDSRun.magic_ds_id,
     
    151155    rawExp.camera,
    152156    magicMask.uri as streaks_uri,
     157    NULL AS inv_streaks_uri,
    153158    stage,
    154159    magicRun.diff_id as stage_id,
     
    167172JOIN magicDSRun USING(magic_id)
    168173JOIN magicInputSkyfile USING(magic_id)
     174JOIN diffRun USING(diff_id)
    169175JOIN diffSkyfile
    170176    ON  magicRun.diff_id = diffSkyfile.diff_id
     
    176182    magicDSRun.state = 'new'
    177183    AND magicDSRun.stage = 'diff'
     184    AND diffRun.bothways = 0
    178185    AND diffSkyfile.fault = 0
    179186    AND diffSkyfile.quality = 0
    180187    AND magicDSFile.component IS NULL
     188-- bothways diffSkyfiles
     189UNION
     190SELECT DISTINCT
     191    magicDSRun.magic_ds_id,
     192    magicRun.magic_id,
     193    magicRun.exp_id,
     194    magicDSRun.label,
     195    rawExp.camera,
     196    magicMask.uri as streaks_uri,
     197    (SELECT uri from magicMask where magic_id = inv_magic_id) AS inv_streaks_uri,
     198    stage,
     199    magicRun.diff_id as stage_id,
     200    diffSkyfile.skycell_id as component,
     201    NULL AS uri,
     202    diffSkyfile.path_base,
     203    magicRun.inverse,
     204    NULL as cam_path_base,
     205    outroot,
     206    recoveryroot,
     207    re_place,
     208    remove
     209FROM rawExp
     210JOIN magicRun USING (exp_id)
     211JOIN magicMask USING (magic_id)
     212JOIN magicDSRun USING(magic_id)
     213JOIN magicInputSkyfile USING(magic_id)
     214JOIN diffRun USING(diff_id)
     215JOIN diffSkyfile
     216    ON  magicRun.diff_id = diffSkyfile.diff_id
     217    AND magicInputSkyfile.node = diffSkyfile.skycell_id
     218LEFT JOIN magicDSFile
     219    ON magicDSRun.magic_ds_id = magicDSFile.magic_ds_id
     220    AND magicDSFile.component = diffSkyfile.skycell_id
     221WHERE
     222    magicDSRun.state = 'new'
     223    AND magicDSRun.stage = 'diff'
     224    AND diffRun.bothways
     225    AND diffSkyfile.fault = 0
     226    AND diffSkyfile.quality = 0
     227    AND magicDSFile.component IS NULL
    181228) as Foo
Note: See TracChangeset for help on using the changeset viewer.