IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23394


Ignore:
Timestamp:
Mar 18, 2009, 10:23:43 AM (17 years ago)
Author:
bills
Message:

add disttool to build

Location:
trunk/ippTools
Files:
3 edited

Legend:

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

    r23363 r23394  
     1-- Maybe it would be better to split the query into multiple modes
     2-- the way it is outstanding rawExp's to bundle will block other stages
     3-- from being processed
    14SELECT
    25    stage,
     
    58    clean
    69FROM (
    7     SELECT
     10    SELECT DISTINCT     -- we use distinct to handle multiple chip runs. Distribution will find right one
    811        'raw' AS stage,
    912        rawExp.exp_id AS stage_id,
    10         chipRun.chip_id AS chip_id,
    1113        rawExp.obs_mode,
    1214        distTarget.clean
     
    1618    JOIN rcInterest USING(target_id)
    1719    LEFT JOIN distRun ON distRun.stage = 'raw' AND distRun.stage_id = exp_id
    18     WHERE
    19         chipRun.state = 'full'                  -- XXX: we need a completed chip stage magicDSRun because we
    20 --        AND rawExp.magicked and chipRun.magicked    -- to support other cameras need to add this optionally
    21                                          -- need the mask file
     20    WHERE distTarget.state = 'enabled'
     21        AND rcInterest.state = 'enabled'
     22        AND chipRun.state = 'full'       -- XXX: we need a completed chip stage magicDSRun because we
     23                                         -- need the mask file to NAN masked pixels
     24        -- to support cameras that don't need magic disttool adds the magicked restriction
     25        -- \nAND rawExp.magicked AND chipRun.magicked here:
     26        AND rawExp.magicked AND chipRun.magicked
     27        -- raw magicked HOOK %s
    2228        AND distRun.dist_id IS NULL      -- no existing distRun
     29    -- raw where hook %s
    2330
    2431UNION
    2532    SELECT
     33        'chip' as stage,
    2634        chipRun.chip_id as stage_id,
    27         'chip' as stage,
    2835        rawExp.obs_mode,
    2936        distTarget.clean
    3037    FROM chipRun
    3138    JOIN rawExp USING(exp_id)
    32     JOIN distTarget ON rawExp.obs_mode = distTarget.obs_mode AND distTarget.stage = 'chip'
     39    JOIN distTarget ON distTarget.stage = 'chip' AND rawExp.obs_mode = distTarget.obs_mode
    3340    JOIN rcInterest USING(target_id)
    3441    LEFT JOIN distRun ON distTarget.stage = 'chip' AND distRun.stage_id = chipRun.chip_id
    3542    WHERE distTarget.state = 'enabled'
    3643        AND rcInterest.state = 'enabled'
    37         AND (chipRun.magicked > 0 OR rawExp.magicked > 0)
    38         AND ((chipRun.state = 'full') OR (distTarget.clean AND chipRun.state = 'cleaned'))
    3944        AND distRun.dist_id IS NULL      -- no existing distRun
     45        AND ((!distTarget.clean AND (chipRun.state = 'full')
     46            -- If camera requires files to be magicked before distibution
     47            -- the following gets added by disttool
     48            -- AND chipRun.magicked
     49            -- chip magicked HOOK %s
     50           )
     51           OR (distTarget.clean AND chipRun.state = 'cleaned'))
     52    -- chip where hook %s
    4053
    4154UNION
    4255    SELECT
    43         max(magic_ds_id) AS magic_ds_id,      -- This assumes that the last destreak run is the best
    4456        'cam' as stage,
    4557        camRun.cam_id as stage_id,
    4658        rawExp.obs_mode,
    4759        distTarget.clean
    48     FROM magicDSRun
    49     JOIN chipRun ON chipRun.chip_id = magicDSRun.stage_id AND magicDSRun.stage = 'chip'
    50     JOIN camRun USING(chip_id)
     60    FROM camRun
     61    JOIN chipRun USING(chip_id)
    5162    JOIN rawExp USING(exp_id)
    52     JOIN distTarget ON rawExp.obs_mode = distTarget.obs_mode AND distTarget.stage = 'cam'
     63    JOIN distTarget ON distTarget.stage = 'cam' AND rawExp.obs_mode = distTarget.obs_mode
    5364    JOIN rcInterest USING(target_id)
    5465    LEFT JOIN distRun ON distRun.stage = 'cam' AND camRun.cam_id = distRun.stage_id
    55     WHERE magicDSRun.state = 'full'
    56         -- replace hook %s
    57     --  AND re_place > 0                 -- if re_place is 0 we need to get destreaked image from backup
    58                                          -- if re_place is 1 we get it from the stageRun
    59                                          -- This is really an issue for development, not real operations
    60         AND ((camRun.state = 'full') OR (distTarget.clean AND camRun.state = 'cleaned'))
     66    WHERE distTarget.state = 'enabled'
     67        AND rcInterest.state = 'enabled'
    6168        AND distRun.dist_id IS NULL      -- no existing distRun
    62     GROUP BY chipRun.chip_id
     69        AND ((!distTarget.clean  AND camRun.state = 'full'
     70            -- need magicked chip run because camera mask are destreaked by chip destreaking
     71            -- the following line
     72            -- AND chipRun.magicked
     73            -- cam magicked HOOK %s
     74             )
     75            OR (distTarget.clean AND camRun.state = 'cleaned')
     76        )
     77    -- cam where hook %s
    6378
    6479UNION
    65     -- we really don't require a  magicDSRun for fake stage do we?
    6680    SELECT
    67         max(magic_ds_id) AS magic_ds_id,      -- This assumes that the last destreak run is the best
    6881        'fake' as stage,
    6982        fakeRun.fake_id as stage_id,
    7083        rawExp.obs_mode,
    7184        distTarget.clean
    72     FROM magicDSRun
    73     JOIN chipRun ON chipRun.chip_id = magicDSRun.stage_id AND magicDSRun.stage = 'chip'
    74     JOIN camRun USING(chip_id)
    75     JOIN fakeRun ON fakeRun.cam_id = camRun.cam_id
     85    FROM fakeRun
     86    JOIN camRun USING(cam_id)
     87    JOIN chipRun USING(chip_id)
    7688    JOIN rawExp USING(exp_id)
    7789    JOIN distTarget ON rawExp.obs_mode = distTarget.obs_mode AND distTarget.stage = 'fake'
    7890    JOIN rcInterest USING(target_id)
    7991    LEFT JOIN distRun ON distRun.stage = 'fake' AND camRun.cam_id = distRun.stage_id
    80     WHERE magicDSRun.state = 'full'
    81         -- replace hook %s
    82     --  AND re_place > 0                 -- if re_place is 0 we need to get destreaked image from backup
    83                                          -- if re_place is 1 we get it from the stageRun
    84                                          -- This is really an issue for development, not real operations
     92    WHERE distTarget.state = 'enabled'
     93        AND rcInterest.state = 'enabled'
     94        AND distRun.dist_id IS NULL      -- no existing distRun
    8595        AND ((fakeRun.state = 'full') OR (distTarget.clean AND fakeRun.state = 'cleaned'))
    86         AND distRun.dist_id IS NULL      -- no existing distRun
    87 
    88     GROUP BY chipRun.chip_id            -- by chip run to find the latest magicDSRun
     96    -- fake where hook %s
    8997
    9098UNION
    9199    SELECT
    92         max(magic_ds_id) AS magic_ds_id,
    93100        'warp' as stage,
    94101        warpRun.warp_id AS stage_id,
    95         obs_mode,
     102        rawExp.obs_mode,
    96103        distTarget.clean
    97     FROM magicDSRun
    98     JOIN warpRun ON warpRun.warp_id = magicDSRun.stage_id AND magicDSRun.stage = 'warp'
     104    FROM warpRun
    99105    JOIN fakeRun USING(fake_id)
    100106    JOIN camRun ON fakeRun.cam_id = camRun.cam_id
    101107    JOIN chipRun USING(chip_id)
    102108    JOIN rawExp USING(exp_id)
    103     JOIN distTarget USING(obs_mode, stage)
     109    JOIN distTarget ON distTarget.stage = 'warp' AND rawExp.obs_mode = distTarget.obs_mode
    104110    JOIN rcInterest USING(target_id)
    105     LEFT JOIN distRun USING(stage, stage_id)
    106     WHERE magicDSRun.state = 'full'
    107         -- replace hook %s
    108     --  AND re_place > 0                 -- if re_place is 0 we need to get destreaked image from backup
    109                                          -- if re_place is 1 we get it from the stageRun
    110                                          -- This is really an issue for development, not real operations
    111         AND ((warpRun.state = 'full') OR (distTarget.clean AND warpRun.state = 'cleaned'))
    112         AND distRun.dist_id IS NULL      -- no existing distRun
    113     GROUP BY warpRun.warp_id
    114 
    115 
     111    LEFT JOIN distRun ON distRun.stage = 'warp' AND (distRun.stage_id = warp_id)
     112    WHERE  distTarget.state = 'enabled'
     113        AND rcInterest.state = 'enabled'
     114        AND distRun.dist_id IS NULL
     115        AND ((warpRun.state = 'full'
     116            --  AND warpRun.magicked
     117            -- warp magicked hook %s
     118             )
     119            OR (distTarget.clean AND warpRun.state = 'cleaned')
     120        )
     121        -- warp where hook %s
    116122) as foo
    117123
    118124
    119125
    120 
  • trunk/ippTools/src

    • Property svn:ignore
      •  

        old new  
        3232flatcorr
        3333pstamptool
         34disttool
  • trunk/ippTools/src/Makefile.am

    r20789 r23394  
    66        dettool \
    77        difftool \
     8        disttool \
    89        flatcorr \
    910        magictool \
     
    4546        dettool.h \
    4647        difftool.h \
     48        disttool.h \
    4749        flatcorr.h \
    4850        faketool.h \
     
    152154    difftoolConfig.c
    153155
     156disttool_CFLAGS = $(PSLIB_CFLAGS) $(PSMODULES_CFLAGS) $(IPPDB_CFLAGS)
     157disttool_LDADD = $(PSLIB_LIBS) $(PSMODULES_LIBS) $(IPPDB_LIBS) libpxtools.la
     158disttool_SOURCES = \
     159    disttool.c \
     160    disttoolConfig.c
     161
    154162stacktool_CFLAGS = $(PSLIB_CFLAGS) $(PSMODULES_CFLAGS) $(IPPDB_CFLAGS)
    155163stacktool_LDADD = $(PSLIB_LIBS) $(PSMODULES_LIBS) $(IPPDB_LIBS) libpxtools.la
Note: See TracChangeset for help on using the changeset viewer.