IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30063


Ignore:
Timestamp:
Dec 15, 2010, 11:40:52 PM (15 years ago)
Author:
watersc1
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-20101215/ippTools/share/regtool_pendingexp.sql

    r30049 r30063  
    11SELECT DISTINCT
    2     exp_id,
    3     tmp_exp_name,
    4     tmp_camera,
    5     tmp_telescope,
    6     state,
    7     workdir,
    8     workdir_state,
    9     reduction,
    10     dvodb,
    11     tess_id,
    12     end_stage,
    13     label,
    14     camera,
    15     filter,
    16     obs_mode,
    17     obs_group,
    18     epoch,
    19     dateobs
    20 FROM
    21     (SELECT
    22        newExp.*,
    23        newImfile.tmp_class_id,
    24        rawImfile.tmp_class_id as raw_tmp_class_id,
    25        rawImfile.camera,
    26        rawImfile.filter,
    27        rawImfile.dateobs,
    28        rawImfile.obs_mode,
    29        rawImfile.obs_group
    30     FROM newExp
    31     JOIN newImfile
    32        USING(exp_id)
    33     LEFT JOIN rawExp
    34        USING(exp_id)
    35     LEFT JOIN rawImfile
    36         ON newImfile.exp_id = rawImfile.exp_id
    37         AND newImfile.tmp_class_id = rawImfile.tmp_class_id
    38     WHERE
    39         newExp.state = 'run'
    40         AND rawExp.exp_id IS NULL
    41         AND rawImfile.data_state = 'full'
    42 -- where hook %s
    43     GROUP BY
    44         newExp.exp_id
    45     HAVING
    46         COUNT(newImfile.tmp_class_id) = COUNT(rawImfile.tmp_class_id)
    47         AND SUM(rawImfile.fault) = 0
     2     exp_id,
     3     tmp_exp_name,
     4     tmp_camera,
     5     tmp_telescope,
     6     state,
     7     workdir,
     8     workdir_state,
     9     reduction,
     10     dvodb,
     11     tess_id,
     12     end_stage,
     13     label,
     14     camera,
     15     filter,
     16     obs_mode,
     17     obs_group,
     18     epoch,
     19     dateobs
     20FROM
     21        (
     22        select DISTINCT * from
     23         (
     24          select newExp.*,count(newImfile.tmp_class_id) AS new_count
     25          from newExp
     26          LEFT JOIN newImfile USING (exp_id)
     27          LEFT JOIN rawExp USING (exp_id)
     28          where
     29           newExp.state = 'run' AND rawExp.exp_id IS NULL
     30          GROUP BY newExp.exp_id
     31         ) AS NEWEXPOSURES
     32         JOIN
     33         (
     34          select DISTINCT newExp.exp_id,
     35          rawImfile.camera,
     36          rawImfile.filter,
     37          rawImfile.dateobs,
     38          rawImfile.obs_mode,
     39          rawImfile.obs_group,
     40          count(rawImfile.tmp_class_id) AS raw_count
     41          from newExp
     42          LEFT JOIN rawExp USING (exp_id)
     43          LEFT JOIN rawImfile USING (exp_id)
     44          where
     45           newExp.state = 'run' AND rawExp.exp_id IS NULL
     46           AND rawImfile.data_state = 'full'
     47           -- where hook %s
     48          GROUP BY newExp.exp_id
     49          HAVING SUM(rawImfile.fault) = 0
     50         ) AS RAWEXPOSURES
     51         USING (exp_id)
     52        WHERE raw_count = new_count
     53    ) AS Foo
    4854-- limit hook %s
    49     ) as Foo
Note: See TracChangeset for help on using the changeset viewer.