IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 17, 2009, 12:08:50 PM (17 years ago)
Author:
beaumont
Message:

merged with head

Location:
branches/cnb_branches/cnb_branch_20090301
Files:
13 edited
5 copied

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090301

  • branches/cnb_branches/cnb_branch_20090301/ippTools/share/Makefile.am

    r21521 r23352  
    8484     difftool_skyfile.sql \
    8585     difftool_todiffskyfile.sql \
     86     disttool_pendingcomponent.sql \
     87     disttool_processedcomponent.sql \
     88     disttool_revertrun_update.sql \
     89     disttool_revertrun_delete.sql \
     90     disttool_toadvance.sql \
    8691     faketool_change_exp_state.sql \
    8792     faketool_change_imfile_data_state.sql \
  • branches/cnb_branches/cnb_branch_20090301/ippTools/share/chiptool_change_imfile_data_state.sql

    r19527 r23352  
    77    chip_id = %lld
    88    AND class_id = '%s'
    9     -- only update if chipRun.state has the expected value
    10     AND (
    11         SELECT state from chipRun where chipRun.chip_id = chipProcessedImfile.chip_id
    12     ) = '%s'
    13    
    14 
  • branches/cnb_branches/cnb_branch_20090301/ippTools/share/chiptool_pendingcleanupimfile.sql

    r19527 r23352  
    1515    ((chipRun.state = 'goto_cleaned' AND chipProcessedImfile.data_state = 'full')
    1616OR
     17    (chipRun.state = 'goto_scrubbed' AND chipProcessedImfile.data_state = 'full')
     18OR
    1719    (chipRun.state = 'goto_purged' AND chipProcessedImfile.data_state != 'purged'))
  • branches/cnb_branches/cnb_branch_20090301/ippTools/share/chiptool_pendingcleanuprun.sql

    r19527 r23352  
    77USING (exp_id)
    88WHERE
    9     (chipRun.state = 'goto_cleaned' OR chipRun.state = 'goto_purged')
     9    (chipRun.state = 'goto_cleaned' OR chipRun.state = 'goto_scrubbed' OR chipRun.state = 'goto_purged')
  • branches/cnb_branches/cnb_branch_20090301/ippTools/share/dettool_processedimfile.sql

    r18561 r23352  
     1-- is this DISTINCT needed?
    12SELECT DISTINCT
    23  detRun.det_type,
  • branches/cnb_branches/cnb_branch_20090301/ippTools/share/dettool_residimfile.sql

    r19632 r23352  
    22   detRun.det_type,
    33   detRun.mode,
    4    detResidImfile.*,
    5    rawExp.exp_time
    6  FROM detResidImfile
    7  JOIN detRun
    8    USING(det_id, iteration)
    9  JOIN rawExp
    10    USING(exp_id)
     4   rawExp.exp_time,
     5   detResidImfile.*
     6FROM detResidImfile
     7JOIN detRun
     8  USING(det_id, iteration)
     9JOIN detInputExp
     10  ON detRun.det_id = detInputExp.det_id
     11  AND detRun.iteration = detInputExp.iteration
     12  AND detResidImfile.exp_id = detInputExp.exp_id
     13JOIN rawExp
     14  ON rawExp.exp_id = detResidImfile.exp_id
  • branches/cnb_branches/cnb_branch_20090301/ippTools/share/dettool_todetrunsummary.sql

    r14078 r23352  
    4040        AND detRunSummary.det_id IS NULL
    4141        AND detRunSummary.iteration IS NULL
     42        AND detResidExp.fault = 0
    4243    GROUP BY
    4344        detRun.det_id,
  • branches/cnb_branches/cnb_branch_20090301/ippTools/share/dettool_tonormalizedstat.sql

    r18118 r23352  
    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.exp_id    = detProcessedImfile.exp_id
     17    AND detResidImfile.class_id  = detProcessedImfile.class_id
     18    AND detResidImfile.iteration = detRun.iteration
     19LEFT JOIN detNormalizedStatImfile
     20    ON  detNormalizedStatImfile.det_id    = detRun.det_id   
     21    AND detNormalizedStatImfile.iteration = detRun.iteration
     22    AND detNormalizedStatImfile.class_id  = detProcessedImfile.class_id
     23WHERE
     24    detRun.state = 'run'
     25    AND detRun.mode = 'master'
     26    AND detNormalizedStatImfile.det_id IS NULL
     27    AND detNormalizedStatImfile.iteration IS NULL
     28    AND detNormalizedStatImfile.class_id IS NULL
     29GROUP BY
     30    detRun.iteration,
     31    detRun.det_id
     32HAVING
     33    COUNT(detProcessedImfile.class_id) = COUNT(detResidImfile.class_id)
     34    AND SUM(detResidImfile.fault) = 0
  • branches/cnb_branches/cnb_branch_20090301/ippTools/share/dettool_toresidexp.sql

    r19815 r23352  
    55-- id, detrend type, and whether the exposure was included in the stack for
    66-- this iteration.
     7
     8-- require the corresponding detNormalizedExp to complete before starting
    79
    810-- select detRun.det_id
     
    1820-- detResidImfile.{det_id, iteration, exp_id} is not in detResidExp
    1921
    20 SELECT DISTINCT
     22SELECT
    2123    det_id,
    2224    iteration,
     
    2830    workdir,
    2931    exp_tag
    30 FROM
    31     (SELECT DISTINCT
     32FROM 
     33(   SELECT
    3234        detRun.det_id AS det_id,
    3335        detRun.iteration,
    3436        detRun.det_type,
    3537        detRun.mode,
    36         detRun.workdir,
    3738        detInputExp.exp_id,
    3839        detInputExp.include,
    3940        rawExp.camera,
    40         rawExp.exp_tag,
    41         detResidImfile.class_id
     41        detRun.workdir,
     42        rawExp.exp_tag
     43    FROM detRun
     44    JOIN detNormalizedExp
     45        USING(det_id, iteration)
     46    JOIN detInputExp
     47        USING(det_id, iteration)
     48    JOIN rawExp
     49        ON detInputExp.exp_id = rawExp.exp_id
     50    JOIN rawImfile
     51        on rawExp.exp_id = rawImfile.exp_id
     52    LEFT JOIN detResidImfile
     53        ON detRun.det_id = detResidImfile.det_id
     54        AND detRun.iteration = detResidImfile.iteration
     55        AND detInputExp.exp_id = detResidImfile.exp_id
     56        AND rawImfile.class_id = detResidImfile.class_id
     57    LEFT JOIN detResidExp
     58        ON detResidImfile.det_id = detResidExp.det_id
     59        AND detResidImfile.iteration = detResidExp.iteration
     60        AND detResidImfile.exp_id = detResidExp.exp_id
     61    WHERE
     62        detRun.state = 'run'
     63        AND detRun.mode = 'master'
     64        AND detResidExp.det_id IS NULL
     65        AND detResidExp.iteration IS NULL
     66        AND detResidExp.exp_id IS NULL
     67    GROUP BY
     68        detInputExp.exp_id,
     69        detRun.iteration,
     70        detRun.det_id
     71    HAVING
     72        COUNT(rawImfile.class_id) = COUNT(detResidImfile.class_id)
     73        AND SUM(detResidImfile.fault) = 0
     74    UNION
     75    SELECT
     76        detRun.det_id AS det_id,
     77        detRun.iteration,
     78        detRun.det_type,
     79        detRun.mode,
     80        detInputExp.exp_id,
     81        detInputExp.include,
     82        rawExp.camera,
     83        detRun.workdir,
     84        rawExp.exp_tag
    4285    FROM detRun
    4386    JOIN detInputExp
     
    58101    WHERE
    59102        detRun.state = 'run'
     103        AND detRun.mode = 'verify'
    60104        AND detResidExp.det_id IS NULL
    61105        AND detResidExp.iteration IS NULL
     
    68112        COUNT(rawImfile.class_id) = COUNT(detResidImfile.class_id)
    69113        AND SUM(detResidImfile.fault) = 0
    70     ) AS toresidexp
     114) as temp
  • branches/cnb_branches/cnb_branch_20090301/ippTools/share/dettool_toresidimfile.sql

    r19816 r23352  
    1313    detProcessedImfile.class_id,
    1414    detProcessedImfile.uri,
    15     detNormalizedImfile.uri AS det_uri,
     15--  detNormalizedImfile.uri AS det_uri,
     16    detStackedImfile.uri AS det_uri,
    1617    detRun.det_id AS ref_det_id,
    1718    detRun.iteration AS ref_iter,
     
    2627    ON detRun.det_id = detProcessedImfile.det_id
    2728    AND detInputExp.exp_id = detProcessedImfile.exp_id
    28 JOIN detNormalizedImfile
    29     ON detRun.det_id = detNormalizedImfile.det_id
    30     AND detRun.iteration = detNormalizedImfile.iteration
    31     AND detProcessedImfile.class_id = detNormalizedImfile.class_id
    32 JOIN detNormalizedExp
    33     ON detRun.det_id = detNormalizedExp.det_id
    34     AND detRun.iteration = detNormalizedExp.iteration
     29JOIN detStackedImfile
     30    ON detRun.det_id = detStackedImfile.det_id
     31    AND detRun.iteration = detStackedImfile.iteration
     32    AND detProcessedImfile.class_id = detStackedImfile.class_id
     33-- EAM : replacing detNormalizedImfile with detStackedImfile to change the sequencing
     34-- JOIN detNormalizedImfile
     35--     ON detRun.det_id = detNormalizedImfile.det_id
     36--     AND detRun.iteration = detNormalizedImfile.iteration
     37--     AND detProcessedImfile.class_id = detNormalizedImfile.class_id
     38-- EAM : we there is no reason to wait for all stacks to complete before continuing
     39-- JOIN detNormalizedExp
     40--     ON detRun.det_id = detNormalizedExp.det_id
     41--     AND detRun.iteration = detNormalizedExp.iteration
    3542LEFT JOIN detResidImfile
    3643    ON detRun.det_id = detResidImfile.det_id
     
    4148    detRun.state = 'run'
    4249    AND detRun.mode = 'master'
    43     AND detNormalizedImfile.fault = 0
    44     AND detNormalizedExp.fault = 0
     50    AND detStackedImfile.fault = 0
     51--  AND detNormalizedImfile.fault = 0
     52--  AND detNormalizedExp.fault = 0
    4553    AND detResidImfile.det_id IS NULL
    4654    AND detResidImfile.iteration IS NULL
  • branches/cnb_branches/cnb_branch_20090301/ippTools/share/pxadmin_create_tables.sql

    r21308 r23352  
    737737    REFERENCES  detInputExp(det_id, iteration, exp_id),
    738738    FOREIGN KEY (det_id, exp_id, class_id)
    739     REFERENCES  detProcessedImfile(det_id, exp_id, class_id),
    740     FOREIGN KEY (ref_det_id, ref_iter)
    741     REFERENCES  detNormalizedExp(det_id, iteration)
     739    REFERENCES  detProcessedImfile(det_id, exp_id, class_id)
    742740) ENGINE=innodb DEFAULT CHARSET=latin1;
    743741
  • branches/cnb_branches/cnb_branch_20090301/ippTools/share/warptool_change_skyfile_data_state.sql

    r19521 r23352  
    99    AND skycell_id = '%s'
    1010    -- only update if chipRun.state has the expected value
    11     AND (
    12         SELECT state from warpRun where warpRun.warp_id = warpSkyfile.warp_id
    13     ) = '%s'
    14    
    15 
     11--    AND (
     12--        SELECT state from warpRun where warpRun.warp_id = warpSkyfile.warp_id
     13--    ) = '%s'
Note: See TracChangeset for help on using the changeset viewer.