IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 8, 2009, 4:50:46 PM (17 years ago)
Author:
eugene
Message:

merging changes from branches/eam_branches/eam_branch_20090303 (detrend normalization resequence, cleanup error state changes; SVN_VERSION from psbuild)

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/ippTools/share/dettool_tonormalizedstat.sql

    r18118 r23229  
    1 -- select detRun.det_id (det_id)
    2 -- select detRun.iteration
    3 -- by:
    4 -- find the current iteration bassed on det_id
    5 -- find all exp_ids in the current det_id/iteration from detInputExp
    6 -- sort to detInputExp.imfiles to find the largest value per det_id/iter
    7 -- compare imfiles to the number of detStackedImfiles by class_id
    8 -- and:
    9 -- ???
    10 -- det_id is not in detStackedImfile;
    11 -- iteration is not in detStackedImfile;
    12 
    13 SELECT
    14     det_id,
    15     det_type,
    16     iteration,
    17     camera,
    18     workdir,
    19     class_id
    20 FROM
    21     (SELECT DISTINCT
    22         detRun.det_id,
    23         detRun.det_type,
    24         detRun.iteration,
    25         detRun.workdir,
    26         rawExp.camera,
    27         detStackedImfile.class_id,
    28         rawImfile.class_id as rawimfile_class_id
    29     FROM detRun
    30     JOIN detInputExp
    31         ON detRun.det_id = detInputExp.det_id
    32         AND detRun.iteration = detInputExp.iteration
    33     JOIN rawExp
    34         ON detInputExp.exp_id = rawExp.exp_id
    35     JOIN rawImfile
    36         ON rawExp.exp_id = rawImfile.exp_id
    37     LEFT JOIN detStackedImfile
    38         ON detInputExp.det_id = detStackedImfile.det_id
    39         AND detInputExp.iteration = detStackedImfile.iteration
    40         AND rawImfile.class_id = detStackedImfile.class_id
    41     LEFT JOIN detNormalizedStatImfile
    42         ON detStackedImfile.det_id = detNormalizedStatImfile.det_id
    43         AND detStackedImfile.iteration = detNormalizedStatImfile.iteration
    44         AND detStackedImfile.class_id = detNormalizedStatImfile.class_id
    45     WHERE
    46         detRun.state = 'run'
    47         AND detRun.mode = 'master'
    48         AND detNormalizedStatImfile.det_id IS NULL
    49         AND detNormalizedStatImfile.iteration IS NULL
    50         AND detNormalizedStatImfile.class_id IS NULL
    51     GROUP BY
    52 --        rawExp.exp_id,
    53         detRun.iteration,
    54         detRun.det_id
    55     HAVING
    56         COUNT(rawImfile.class_id) = COUNT(detStackedImfile.class_id)
    57         AND SUM(detStackedImfile.fault) = 0
    58     ) as tonormalizedstat
     1-- a det_run + iteration is ready for normstat when: all detResidImfile entries for that iteration corresponding to all detProcessedImfile entries are available
     2SELECT
     3  detRun.det_id,
     4  detRun.det_type,
     5  detRun.iteration,
     6  detRun.camera,
     7  detRun.workdir,
     8  detProcessedImfile.class_id,
     9  COUNT(detProcessedImfile.class_id),
     10  COUNT(detResidImfile.class_id)
     11FROM detRun
     12JOIN detProcessedImfile
     13    ON  detProcessedImfile.det_id    = detRun.det_id
     14LEFT JOIN detResidImfile
     15    ON  detResidImfile.det_id    = detProcessedImfile.det_id
     16    AND detResidImfile.class_id  = detProcessedImfile.class_id
     17    AND detResidImfile.iteration = detRun.iteration
     18LEFT JOIN detNormalizedStatImfile
     19    ON  detNormalizedStatImfile.det_id    = detRun.det_id   
     20    AND detNormalizedStatImfile.iteration = detRun.iteration
     21    AND detNormalizedStatImfile.class_id  = detProcessedImfile.class_id
     22WHERE
     23    detRun.state = 'run'
     24    AND detRun.mode = 'master'
     25    AND detNormalizedStatImfile.det_id IS NULL
     26    AND detNormalizedStatImfile.iteration IS NULL
     27    AND detNormalizedStatImfile.class_id IS NULL
     28GROUP BY
     29    detRun.iteration,
     30    detRun.det_id
     31HAVING
     32    COUNT(detProcessedImfile.class_id) = COUNT(detResidImfile.class_id)
     33    AND SUM(detResidImfile.fault) = 0
Note: See TracChangeset for help on using the changeset viewer.