IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18577


Ignore:
Timestamp:
Jul 16, 2008, 9:25:45 AM (18 years ago)
Author:
Paul Price
Message:

Adding additional comments

Location:
trunk/ippTools/share
Files:
3 edited

Legend:

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

    r18574 r18577  
     1-- Define the inputs to a defined stack
    12INSERT INTO
    23        stackInputSkyfile(stack_id, warp_id)
    34SELECT
    4         @STACK_ID@,
     5        @STACK_ID@, -- This should be replaced with the stack_id
    56        warp_id
    67FROM warpSkyfile
  • trunk/ippTools/share/stacktool_definebyquery_insert_random.sql

    r18574 r18577  
     1-- Use a random set of warps for the inputs to a defined stack
    12INSERT INTO
    23        stackInputSkyfile(stack_id, warp_id)
    34SELECT
    4         @STACK_ID@,
     5        @STACK_ID@, -- This should be replaced with the stack_id
    56        warp_id
    67FROM (
    7 SELECT
    8         warpSkyfile.*,
    9         rand() AS rnd_num
    10 FROM warpSkyfile
    11 JOIN warpRun
    12     USING(warp_id, tess_id)
    13 JOIN fakeRun
    14     USING(fake_id, tess_id)
    15 JOIN camRun
    16     USING(cam_id, tess_id)
    17 JOIN chipRun
    18     USING(chip_id, tess_id)
    19 JOIN rawExp
    20     USING(exp_id, tess_id)
    21 WHERE
    22     skycell_id = '%s'
    23     AND tess_id = '%s'
    24     AND rawExp.filter = '%s'
    25     AND warpSkyfile.fault = 0
    26 ORDER BY rnd_num
    27 LIMIT %d
     8    -- Sub-select to get the random set of warps
     9    SELECT
     10            warpSkyfile.*,
     11            rand() AS rnd_num
     12    FROM warpSkyfile
     13    JOIN warpRun
     14        USING(warp_id, tess_id)
     15    JOIN fakeRun
     16        USING(fake_id, tess_id)
     17    JOIN camRun
     18        USING(cam_id, tess_id)
     19    JOIN chipRun
     20        USING(chip_id, tess_id)
     21    JOIN rawExp
     22        USING(exp_id, tess_id)
     23    WHERE
     24        skycell_id = '%s'
     25        AND tess_id = '%s'
     26        AND rawExp.filter = '%s'
     27        AND warpSkyfile.fault = 0
     28    -- Sort by the random number, and take the first N
     29    -- to get a random set of N.
     30    ORDER BY rnd_num
     31    LIMIT %d
    2832) AS randomWarps
  • trunk/ippTools/share/stacktool_definebyquery_select.sql

    r18574 r18577  
     1-- This is the SELECT part of the query to get a list of skycells with
     2-- warps that are ready to be stacked, along with the numbers of warps
     3-- ready to be stacked and already in stacks.  It needs to be
     4-- completed by a GROUP BY statement (see below).
     5
    16SELECT
    27    warpSkyfile.skycell_id,
     
    49    stackRun.stack_id,
    510    rawExp.filter,
    6     COUNT(warpSkyfile.skycell_id) AS num_avail,
    7     COUNT(stackRun.stack_id) AS num_extant
     11    COUNT(warpSkyfile.skycell_id) AS num_avail, -- number available to be stacked
     12    COUNT(stackRun.stack_id) AS num_extant -- number already in the stack
    813FROM warpRun
    914JOIN warpSkyfile
     
    2833    AND warpSkyfile.fault = 0
    2934-- Here should follow the SQL in stacktool_definebyquery_groupby.sql,
    30 -- after additional WHERE conditions have been added
     35-- after any additional WHERE conditions have been added
Note: See TracChangeset for help on using the changeset viewer.