Changeset 23394
- Timestamp:
- Mar 18, 2009, 10:23:43 AM (17 years ago)
- Location:
- trunk/ippTools
- Files:
-
- 3 edited
-
share/disttool_definebyquery_select.sql (modified) (3 diffs)
-
src (modified) (1 prop)
-
src/Makefile.am (modified) (3 diffs)
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 1 4 SELECT 2 5 stage, … … 5 8 clean 6 9 FROM ( 7 SELECT 10 SELECT DISTINCT -- we use distinct to handle multiple chip runs. Distribution will find right one 8 11 'raw' AS stage, 9 12 rawExp.exp_id AS stage_id, 10 chipRun.chip_id AS chip_id,11 13 rawExp.obs_mode, 12 14 distTarget.clean … … 16 18 JOIN rcInterest USING(target_id) 17 19 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 22 28 AND distRun.dist_id IS NULL -- no existing distRun 29 -- raw where hook %s 23 30 24 31 UNION 25 32 SELECT 33 'chip' as stage, 26 34 chipRun.chip_id as stage_id, 27 'chip' as stage,28 35 rawExp.obs_mode, 29 36 distTarget.clean 30 37 FROM chipRun 31 38 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 33 40 JOIN rcInterest USING(target_id) 34 41 LEFT JOIN distRun ON distTarget.stage = 'chip' AND distRun.stage_id = chipRun.chip_id 35 42 WHERE distTarget.state = 'enabled' 36 43 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'))39 44 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 40 53 41 54 UNION 42 55 SELECT 43 max(magic_ds_id) AS magic_ds_id, -- This assumes that the last destreak run is the best44 56 'cam' as stage, 45 57 camRun.cam_id as stage_id, 46 58 rawExp.obs_mode, 47 59 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) 51 62 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 53 64 JOIN rcInterest USING(target_id) 54 65 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' 61 68 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 63 78 64 79 UNION 65 -- we really don't require a magicDSRun for fake stage do we?66 80 SELECT 67 max(magic_ds_id) AS magic_ds_id, -- This assumes that the last destreak run is the best68 81 'fake' as stage, 69 82 fakeRun.fake_id as stage_id, 70 83 rawExp.obs_mode, 71 84 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) 76 88 JOIN rawExp USING(exp_id) 77 89 JOIN distTarget ON rawExp.obs_mode = distTarget.obs_mode AND distTarget.stage = 'fake' 78 90 JOIN rcInterest USING(target_id) 79 91 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 85 95 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 89 97 90 98 UNION 91 99 SELECT 92 max(magic_ds_id) AS magic_ds_id,93 100 'warp' as stage, 94 101 warpRun.warp_id AS stage_id, 95 obs_mode,102 rawExp.obs_mode, 96 103 distTarget.clean 97 FROM magicDSRun 98 JOIN warpRun ON warpRun.warp_id = magicDSRun.stage_id AND magicDSRun.stage = 'warp' 104 FROM warpRun 99 105 JOIN fakeRun USING(fake_id) 100 106 JOIN camRun ON fakeRun.cam_id = camRun.cam_id 101 107 JOIN chipRun USING(chip_id) 102 108 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 104 110 JOIN rcInterest USING(target_id) 105 LEFT JOIN distRun USING(stage, stage_id)106 WHERE magicDSRun.state = 'full'107 -- replace hook %s108 -- AND re_place > 0 -- if re_place is 0 we need to get destreaked image from backup109 -- if re_place is 1 we get it from the stageRun110 -- This is really an issue for development, not real operations111 AND ((warpRun.state = 'full') OR (distTarget.clean AND warpRun.state = 'cleaned'))112 AND distRun.dist_id IS NULL -- no existing distRun113 GROUP BY warpRun.warp_id114 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 116 122 ) as foo 117 123 118 124 119 125 120 -
trunk/ippTools/src
- Property svn:ignore
-
old new 32 32 flatcorr 33 33 pstamptool 34 disttool
-
- Property svn:ignore
-
trunk/ippTools/src/Makefile.am
r20789 r23394 6 6 dettool \ 7 7 difftool \ 8 disttool \ 8 9 flatcorr \ 9 10 magictool \ … … 45 46 dettool.h \ 46 47 difftool.h \ 48 disttool.h \ 47 49 flatcorr.h \ 48 50 faketool.h \ … … 152 154 difftoolConfig.c 153 155 156 disttool_CFLAGS = $(PSLIB_CFLAGS) $(PSMODULES_CFLAGS) $(IPPDB_CFLAGS) 157 disttool_LDADD = $(PSLIB_LIBS) $(PSMODULES_LIBS) $(IPPDB_LIBS) libpxtools.la 158 disttool_SOURCES = \ 159 disttool.c \ 160 disttoolConfig.c 161 154 162 stacktool_CFLAGS = $(PSLIB_CFLAGS) $(PSMODULES_CFLAGS) $(IPPDB_CFLAGS) 155 163 stacktool_LDADD = $(PSLIB_LIBS) $(PSMODULES_LIBS) $(IPPDB_LIBS) libpxtools.la
Note:
See TracChangeset
for help on using the changeset viewer.
