Changeset 43014
- Timestamp:
- May 11, 2026, 3:09:36 PM (2 months ago)
- Location:
- branches/eam_branches/ipp-pstamp-20260421/ippTools/share
- Files:
-
- 38 edited
-
addtool_checkminidvodbaddrun.sql (modified) (1 diff)
-
addtool_find_minidvodbrun2.sql (modified) (1 diff)
-
bgtool_advancechip.sql (modified) (1 diff)
-
bgtool_advancewarp.sql (modified) (1 diff)
-
bgtool_towarp.sql (modified) (1 diff)
-
chiptool_coalesce_run.sql (modified) (1 diff)
-
chiptool_completely_processed_exp.sql (modified) (2 diffs)
-
detselect_search.sql (modified) (1 diff)
-
dettool_find_completed_runs.sql (modified) (1 diff)
-
dettool_todetrunsummary.sql (modified) (1 diff)
-
dettool_tonormalizedexp.sql (modified) (1 diff)
-
dettool_tonormalizedstat.sql (modified) (1 diff)
-
dettool_toprocessedexp.sql (modified) (1 diff)
-
dettool_tostacked.sql (modified) (1 diff)
-
diffphottool_advance.sql (modified) (1 diff)
-
difftool_completed_runs.sql (modified) (1 diff)
-
difftool_definewarpstack.sql (modified) (4 diffs)
-
difftool_definewarpstack_old.sql (modified) (2 diffs)
-
faketool_completely_processed_exp.sql (modified) (1 diff)
-
fftool_toadvance.sql (modified) (1 diff)
-
magictool_definebyquery_select_multidiff.sql (modified) (1 diff)
-
magictool_toprocess_runs.sql (modified) (1 diff)
-
pstamptool_addaccesslevel.sql (modified) (1 diff)
-
pstamptool_pendingdependent.sql (modified) (2 diffs)
-
pztool_find_completed_exp.sql (modified) (1 diff)
-
regtool_pendingexp.sql (modified) (1 diff)
-
releasetool_definerelgroup_select_data_group.sql (modified) (1 diff)
-
stacktool_tobkg.sql (modified) (1 diff)
-
stacktool_tosummary.sql (modified) (1 diff)
-
staticskytool_definebyquery_select.sql (modified) (1 diff)
-
staticskytool_definebyquery_select_by_dg.sql (modified) (2 diffs)
-
staticskytool_result.sql (modified) (1 diff)
-
staticskytool_todo.sql (modified) (1 diff)
-
warptool_finished_run_select.sql (modified) (1 diff)
-
warptool_towarped.sql (modified) (2 diffs)
-
warptool_towarped_labels.sql (modified) (2 diffs)
-
xcskytool_definebyquery_select_by_dg.sql (modified) (2 diffs)
-
xcskytool_result.sql (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/addtool_checkminidvodbaddrun.sql
r39528 r43014 1 1 -- this selects the minidvodbs that have complete addRuns 2 SELECT minidvodb_id, minidvodb_name, minidvodb_path, state, minidbg 3 AS minidvodb_group, (cnt - cnt2) as not_full, cnt as addRun_count 2 SELECT 3 minidvodb_id, 4 minidvodb_name, 5 minidvodb_path, 6 state, 7 minidbg AS minidvodb_group, 8 (cnt - cnt2) as not_full, 9 cnt as addRun_count 4 10 FROM minidvodbRun 5 JOIN 6 (SELECT minidvodb_name, count(state) as cnt2, cnt, minidbg, minidbn 7 FROM addRun LEFT JOIN 8 -- this select grabs (and counts) all the addRuns with any state 9 -- and groups them by the name 10 (SELECT minidvodb_group as minidbg, minidvodb_name as minidbn, count(state) 11 AS cnt 12 FROM addRun where minidvodb_group = '%s' 13 GROUP BY minidvodb_name ) 14 AS foo1 ON minidvodb_name = minidbn 15 -- the second select grabs and counts all the addRuns with state 16 -- of 'full' 17 WHERE addRun.state = 'full' and minidvodb_group = '%s' 18 GROUP BY minidvodb_name ) 11 JOIN ( 12 SELECT 13 minidvodb_name, 14 count(state) AS cnt2, 15 MIN(cnt) AS cnt, 16 MIN(minidbg) AS minidbg, 17 minidbn 18 FROM addRun 19 LEFT JOIN ( 20 -- this select grabs (and counts) all the addRuns with any state 21 -- and groups them by the name 22 SELECT 23 MIN(minidvodb_group) AS minidbg, 24 minidvodb_name AS minidbn, 25 count(state) AS cnt 26 FROM addRun 27 WHERE minidvodb_group = '%s' 28 GROUP BY minidvodb_name 29 ) 30 AS foo1 31 ON minidvodb_name = minidbn 32 -- the outer select grabs and counts all the addRuns with state 33 -- of 'full' 34 WHERE addRun.state = 'full' 35 AND minidvodb_group = '%s' 36 GROUP BY 37 minidvodb_name 38 ) 19 39 AS foo2 20 40 USING(minidvodb_name) -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/addtool_find_minidvodbrun2.sql
r33030 r43014 1 1 -- this selects the minidvodbs that have complete addRuns 2 SELECT minidvodb_name, minidvodb_path, state, minidbg 3 AS minidvodb_group 2 SELECT 3 minidvodb_name, 4 minidvodb_path, 5 state, 6 minidbg AS minidvodb_group 4 7 FROM minidvodbRun 5 JOIN 6 (SELECT minidvodb_name, count(state) as cnt2, cnt, minidbg, minidbn 7 FROM addRun LEFT JOIN 8 -- this select grabs (and counts) all the addRuns with any state 9 -- and groups them by the name 10 (SELECT minidvodb_group as minidbg, minidvodb_name as minidbn, count(state) 11 AS cnt 12 FROM addRun 13 GROUP BY minidvodb_name ) 14 AS foo1 ON minidvodb_name = minidbn 15 -- the second select grabs and counts all the addRuns with state 16 -- of 'full' 17 WHERE addRun.state = 'full' 18 GROUP BY minidvodb_name ) 8 JOIN ( 9 SELECT 10 minidvodb_name, 11 count(state) AS cnt2, 12 MIN(cnt) AS cnt, 13 MIN(minidbg) as minidbg, 14 minidbn 15 FROM addRun 16 LEFT JOIN ( 17 -- this select grabs (and counts) all the addRuns with any state 18 -- and groups them by the name 19 SELECT 20 MIN(minidvodb_group) AS minidbg, 21 minidvodb_name AS minidbn, 22 count(state) AS cnt 23 FROM addRun 24 GROUP BY minidvodb_name 25 ) 26 AS foo1 27 ON minidvodb_name = minidbn 28 -- the second select grabs and counts all the addRuns with state 29 -- of 'full' 30 WHERE addRun.state = 'full' 31 GROUP BY minidvodb_name 32 ) 19 33 AS foo2 20 34 USING(minidvodb_name) 21 35 WHERE cnt2 = cnt 22 -- the 3rd select only grabs the columns where the counts are the same23 -- (same number of 'full' and any state)36 -- the 3rd select only grabs the columns where the counts are the same 37 -- (same number of 'full' and any state) -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/bgtool_advancechip.sql
r35672 r43014 1 1 SELECT DISTINCT 2 2 chipBackgroundRun.chip_bg_id, 3 chipBackgroundImfile.magicked3 MIN(chipBackgroundImfile.magicked) AS magicked 4 4 FROM chipBackgroundRun 5 5 JOIN camRun using(cam_id) -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/bgtool_advancewarp.sql
r28486 r43014 1 1 SELECT DISTINCT 2 2 warpBackgroundRun.warp_bg_id, 3 warpBackgroundSkyfile.magicked3 MIN(warpBackgroundSkyfile.magicked) AS magicked 4 4 FROM warpBackgroundRun 5 5 JOIN warpSkyfile USING(warp_id) -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/bgtool_towarp.sql
r35134 r43014 4 4 skycell_id, 5 5 rawExp.exp_tag, 6 rawExp.camera 6 rawExp.camera, 7 -- EAM: this was missing, I think this was a legitimate error 8 priority 7 9 FROM warpBackgroundRun 8 10 JOIN warpRun USING(warp_id) -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/chiptool_coalesce_run.sql
r28043 r43014 1 select software_ver,maskfrac_npix,maskfrac_static,maskfrac_dynamic,maskfrac_magic,maskfrac_advisory from chipProcessedImfile where data_state = 'full' AND fault = 0 AND chip_id = %lld 1 -- select software_ver,maskfrac_npix,maskfrac_static,maskfrac_dynamic,maskfrac_magic,maskfrac_advisory from chipProcessedImfile where data_state = 'full' AND fault = 0 AND chip_id = %lld 2 select software_ver,maskfrac_npix,maskfrac_static,maskfrac_dynamic,maskfrac_magic,maskfrac_advisory from chipProcessedImfile where data_state = 'full' AND fault = 0 AND chip_id = 1 -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/chiptool_completely_processed_exp.sql
r35789 r43014 20 20 (SELECT 21 21 chipRun.*, 22 rawImfile.class_id as rawimfile_class_id, 23 chipProcessedImfile.class_id, 22 -- rawImfile.class_id and chipProcessedImfile.class_id are not aggregated 23 -- and cause problems given the GROUP BY 24 -- clause below. A solution is to explicitly select a single value, the MIN. 25 -- But this is not needed because the field is not used by the rest of the query 26 -- rawImfile.class_id as rawimfile_class_id, 27 -- chipProcessedImfile.class_id, 28 -- MIN(rawImfile.class_id) as rawimfile_class_id, 24 29 -- XXX using chipProcessedImfile assumes that all imfile's have 25 30 -- the same magicked value if that isn't right then more than one … … 28 33 -- We could use rawExp.magicked but that would make it possible for 29 34 -- the chipRun to have a different magicked value than the imfiles 30 chipProcessedImfile.magickedAS imfile_magicked35 MIN(chipProcessedImfile.magicked) AS imfile_magicked 31 36 FROM chipRun 32 37 JOIN rawImfile -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/detselect_search.sql
r27797 r43014 7 7 det_id, 8 8 good_iteration as iteration, 9 filelevel 9 filelevel, 10 registered 10 11 FROM 11 12 (SELECT DISTINCT -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/dettool_find_completed_runs.sql
r14023 r43014 6 6 detRun.det_id, 7 7 detRun.iteration, 8 detInputExp.exp_id8 MIN(detInputExp.exp_id) AS exp_id 9 9 FROM detRun 10 10 LEFT JOIN detInputExp -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/dettool_todetrunsummary.sql
r23122 r43014 22 22 detRun.mode, 23 23 detRun.workdir, 24 detInputExp.exp_id, 25 rawExp.camera 24 -- detInputExp.exp_id, 25 -- this chooses a specific value 26 -- for camera. unclear if multiple 27 -- camera were used 28 MIN(rawExp.camera) as camera 26 29 FROM detRun 27 30 JOIN detInputExp -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/dettool_tonormalizedexp.sql
r18561 r43014 1 1 -- this is used by both 'tonormalizedexp' and 'addnormalizedexp' 2 3 -- EAM : I believe the outer SELECT * FROM () as Bar can be removed. 2 4 3 5 SELECT 4 6 * 5 7 FROM (SELECT 6 * 7 FROM ( 8 det_id, 9 iteration, 10 MIN(det_type) as det_type, 11 MIN(workdir) as workdir, 12 MIN(camera) as camera, 13 MIN(telescope) as telescope, 14 MIN(exp_type) as exp_type, 15 MIN(norm_class_id) as norm_class_id, 16 MIN(fault) as fault, 17 MIN(stack_class_id) as stack_class_id 18 FROM ( 8 19 SELECT DISTINCT 9 20 detRun.det_id, -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/dettool_tonormalizedstat.sql
r40535 r43014 6 6 detRun.camera, 7 7 detRun.workdir, 8 detProcessedImfile.class_id,8 MIN(detProcessedImfile.class_id) AS class_id, 9 9 COUNT(detProcessedImfile.class_id), 10 10 COUNT(detResidImfile.class_id) -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/dettool_toprocessedexp.sql
r19621 r43014 27 27 detRun.det_type, 28 28 detRun.workdir, 29 detProcessedImfile.exp_id, 30 detProcessedImfile.class_id, 31 rawImfile.class_id as rawimfile_class_id, 29 MIN(detProcessedImfile.exp_id) AS exp_id, 30 -- not actually used and cause aggregation errors 31 -- detProcessedImfile.class_id, 32 -- rawImfile.class_id as rawimfile_class_id, 32 33 rawExp.camera, 33 34 rawExp.exp_tag -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/dettool_tostacked.sql
r15769 r43014 14 14 15 15 SELECT 16 detProcessedImfile.det_id, 16 -- why is this using detProcessedImfile.det_id and not detRun.det_id 17 -- MIN(detProcessedImfile.det_id) as det_id, 18 detRun.det_id, 17 19 detRun.iteration, 18 20 detRun.det_type, 19 21 detRun.workdir, 20 22 detRun.reduction, 21 detProcessedImfile.class_id, 22 rawExp.camera, 23 rawExp.exp_tag 23 -- detProcessedImfile.class_id could have NULLs given LEFT JOIN, 24 -- detProcessedImfile.class_id, 25 rawImfile.class_id, 26 MIN(rawExp.camera) AS camera 27 -- not needed in output? 28 -- rawExp.exp_tag 24 29 FROM detRun 25 30 JOIN detInputExp -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/diffphottool_advance.sql
r28488 r43014 1 1 SELECT 2 2 diff_phot_id, 3 diffPhotSkyfile.magicked3 MIN(diffPhotSkyfile.magicked) AS magicked 4 4 FROM diffPhotRun 5 5 JOIN diffSkyfile USING(diff_id) -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/difftool_completed_runs.sql
r25515 r43014 2 2 COUNT(diffInputSkyfile.skycell_id), 3 3 COUNT(diffSkyfile.skycell_id), 4 diffSkyfile.*, 4 diffInputSkyfile.diff_id, 5 MIN(diffSkyfile.magicked) AS magicked, 5 6 SUM(!diffSkyfile.magicked) = 0 as all_magicked 6 7 FROM diffRun -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/difftool_definewarpstack.sql
r37974 r43014 1 1 -- Get list of warp-stack pairs that can be diffed 2 2 -- and check results against existing diffs 3 -- EAM: the output of this query should be limited to 4 -- only the fields need otherwise we have aggregation errors 3 5 SELECT 4 6 exp_id, 5 7 warp_id, 6 filter,7 warpLabel,8 -- filter, 9 -- warpLabel, 8 10 warpDataGroup, 9 11 Inputs.tess_id, 10 12 Inputs.skycell_id, 11 stack_id, 12 stackLabel, 13 stackDataGroup, 14 diff_id, 15 diffLabel 13 stack_id 14 -- these are NOT needed as an output 15 -- stackLabel, -- only used in the whereClauseString 16 -- stackDataGroup, 17 -- diff_id, 18 -- diffLabel 16 19 FROM 17 20 ( 18 21 SELECT 19 exp_id, 20 warp_id, 21 rawExp.filter, 22 warpRun.label AS warpLabel, 23 warpRun.data_group AS warpDataGroup, 24 warpRun.tess_id, 25 warpSkyfile.skycell_id, 26 MAX(stack_id) AS stack_id, 27 stackRun.label AS stackLabel, 28 stackRun.data_group AS stackDataGroup 22 exp_id, -- KEEP 23 warp_id, -- KEEP 24 rawExp.filter, -- KEEP 25 -- warpRun.label AS warpLabel, -- DROP? 26 warpRun.data_group AS warpDataGroup, -- KEEP 27 warpRun.tess_id, -- KEEP 28 warpSkyfile.skycell_id, -- KEEP 29 MAX(stack_id) AS stack_id -- KEEP 30 -- these two fields are only used by the whereClauseString below 31 -- and do NOT need to be SELECTed 32 -- stackRun.label AS stackLabel, 33 -- stackRun.data_group AS stackDataGroup 29 34 FROM warpRun 30 35 JOIN fakeRun USING(fake_id) … … 46 51 AND stackSumSkyfile.quality = 0 47 52 AND exp_id IS NOT NULL 53 -- replaced by whereClauseString 48 54 -- %s 49 55 GROUP BY exp_id,warp_id,skycell_id … … 62 68 WHERE 63 69 diff_mode = 2 70 -- replaced by diffWhereClause 64 71 -- %s 65 72 ) AS Diffs ON … … 70 77 WHERE 71 78 1 72 -- %s 79 -- replaced by joinWhereClause 80 -- %s 73 81 -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/difftool_definewarpstack_old.sql
r40109 r43014 1 1 -- Get list of warp-stack pairs that can be diffed 2 2 -- and check results against existing diffs 3 -- EAM: the output of this query should be limited to 4 -- only the fields need otherwise we have aggregation errors 3 5 SELECT 4 exp_id, 5 warp_id, 6 rawExp.filter, 7 warpRun.label AS warpLabel, 8 warpRun.data_group AS warpDataGroup, 9 warpRun.tess_id, 10 warpSkyfile.skycell_id, 11 MAX(stack_id) AS stack_id, 12 stackRun.label AS stackLabel, 13 stackRun.data_group AS stackDataGroup, 14 diff_id, 15 diffRun.label AS diffLabel 6 exp_id, 7 warp_id, 8 -- rawExp.filter, 9 -- warpRun.label AS warpLabel, 10 warpRun.data_group AS warpDataGroup, 11 warpRun.tess_id, 12 warpSkyfile.skycell_id, 13 MAX(stack_id) AS stack_id 14 -- these are NOT needed as an output 15 -- MIN(stackRun.label) AS stackLabel, 16 -- MIN(stackRun.data_group) AS stackDataGroup, 17 -- diffRun.diff_id, 18 -- diffRun.label AS diffLabel 16 19 FROM warpRun 17 20 JOIN fakeRun USING(fake_id) … … 41 44 -- %s 42 45 GROUP BY exp_id,warp_id,skycell_id 46 47 -- the GROUP BY above, combined with the MAX(stack_id) selects the most recent stack_id 48 -- for a given exposure->warp->stack -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/faketool_completely_processed_exp.sql
r25835 r43014 17 17 FROM 18 18 (SELECT 19 fakeRun.*, 20 rawImfile.class_id as rawimfile_class_id, 21 fakeProcessedImfile.class_id 19 fakeRun.* 20 -- These two fields below are not required and cause 21 -- trouble with the GROUP BY below 22 -- rawImfile.class_id as rawimfile_class_id, 23 -- fakeProcessedImfile.class_id 22 24 FROM fakeRun 23 25 JOIN camRun -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/fftool_toadvance.sql
r36633 r43014 4 4 stackRun.skycell_id, 5 5 stackRun.filter, 6 rawExp.camera6 MIN(rawExp.camera) AS camera 7 7 FROM fullForceRun 8 8 JOIN fullForceInput USING(ff_id) -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/magictool_definebyquery_select_multidiff.sql
r32283 r43014 52 52 -- WHERE hook %s 53 53 GROUP BY chipRun.exp_id 54 55 -- EAM : magic is deprecated, I should not port this -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/magictool_toprocess_runs.sql
r28768 r43014 1 1 SELECT DISTINCT 2 magic _id,2 magicRun.magic_id, 3 3 IFNULL(priority, 10000) AS priority 4 4 FROM magicTree -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/pstamptool_addaccesslevel.sql
r38157 r43014 1 INSERT 2 INTO pstampAccessLevel 1 INSERT INTO pstampAccessLevel 3 2 SELECT proj_id, %d, %f, %f FROM pstampProject 4 3 WHERE name = '%s' -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/pstamptool_pendingdependent.sql
r38586 r43014 1 1 SELECT DISTINCT 2 2 pstampDependent.*, 3 pstampRequest.label,3 MIN(pstampRequest.label) as label, 4 4 MIN(req_id) as first_req_id, 5 5 concat( pstampDependent.outdir, '/checkdep.', dep_id, '.log') as logfile, 6 IFNULL(Label.priority, 10000) AS priority6 MIN(IFNULL(Label.priority, 10000)) AS priority 7 7 FROM pstampDependent 8 8 JOIN pstampJob USING(dep_id) … … 13 13 AND pstampRequest.state = 'run' 14 14 AND (Label.active OR Label.active IS NULL) 15 -- EAM TEST: 16 -- this is added in pstamptool, but is needed to test the SQL validity 17 -- GROUP BY dep_id ORDER BY priority DESC, MIN(req_id), dep_id 18 -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/pztool_find_completed_exp.sql
r31047 r43014 8 8 FROM ( 9 9 SELECT 10 pzDownloadImfile.*, 10 pzDownloadImfile.summit_id as summit_id, 11 MIN(pzDownloadImfile.exp_name) as exp_name, 12 MIN(pzDownloadImfile.camera) as camera, 13 MIN(pzDownloadImfile.telescope) as telescope, 11 14 pzDownloadExp.state, 12 15 summitExp.imfiles, -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/regtool_pendingexp.sql
r31043 r43014 33 33 JOIN 34 34 ( 35 select DISTINCT newExp.exp_id, 36 rawImfile.camera, 37 rawImfile.filter, 38 rawImfile.dateobs, 39 rawImfile.obs_mode, 40 rawImfile.obs_group, 35 select DISTINCT 36 MIN(newExp.exp_id) as exp_id, 37 MIN(rawImfile.camera) as camera, 38 MIN(rawImfile.filter) as filter, 39 MIN(rawImfile.dateobs) as dateobs, 40 MIN(rawImfile.obs_mode) as obs_mode, 41 MIN(rawImfile.obs_group) as obs_group, 41 42 count(rawImfile.tmp_class_id) AS raw_count 42 43 from newExp -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/releasetool_definerelgroup_select_data_group.sql
r35213 r43014 1 1 SELECT 2 ippRelease.rel_id,2 MIN(ippRelease.rel_id) AS rel_id, 3 3 count(exp_id) AS num_exposures 4 4 FROM ippRelease -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/stacktool_tobkg.sql
r35081 r43014 8 8 stackRun.state, 9 9 stackSumSkyfile.path_base, 10 rawExp.camera,10 MIN(rawExp.camera) as camera, 11 11 IFNULL(Label.priority, 10000) AS priority 12 12 FROM stackRun -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/stacktool_tosummary.sql
r35856 r43014 1 SELECT sass_id,camera,workdir,tess_id,state FROM 2 (SELECT sass_id,rawExp.camera,stackRun.workdir,stackRun.tess_id,stackRun.state, 3 sum((stackRun.state = 'full')) AS is_done, sum(1) AS is_defined 1 SELECT 2 sass_id, 3 camera, 4 workdir, 5 tess_id, 6 state 7 FROM 8 (SELECT sass_id, 9 MIN(rawExp.camera) AS camera, 10 MIN(stackRun.workdir) AS workdir, 11 MIN(stackRun.tess_id) AS tess_id, 12 MIN(stackRun.state) AS state, 13 SUM((stackRun.state = 'full')) AS is_done, 14 SUM(1) AS is_defined 4 15 FROM stackRun 5 16 JOIN stackInputSkyfile ON stackRun.stack_id = stackInputSkyfile.stack_id -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/staticskytool_definebyquery_select.sql
r33919 r43014 22 22 LEFT JOIN ( 23 23 SELECT DISTINCT sky_id, 24 stackRun.skycell_id,25 stackRun.tess_id,26 stackRun.data_group,24 MIN(stackRun.skycell_id) as skycell_id, 25 MIN(stackRun.tess_id) as tess_id, 26 MIN(stackRun.data_group) as data_group, 27 27 COUNT(stack_id) AS num_filter 28 28 FROM staticskyRun -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/staticskytool_definebyquery_select_by_dg.sql
r31687 r43014 8 8 tess_id, 9 9 skycell_id, 10 label,10 MIN(label) as label, 11 11 data_group, 12 12 COUNT(DISTINCT filter) AS num_filter … … 25 25 LEFT JOIN ( 26 26 SELECT DISTINCT sky_id, 27 stackRun.skycell_id,28 stackRun.tess_id,29 stackRun.data_group,27 MIN(stackRun.skycell_id) as skycell_id, 28 MIN(stackRun.tess_id) as tess_id, 29 MIN(stackRun.data_group) as data_group, 30 30 COUNT(stack_id) AS num_filter 31 31 FROM staticskyRun -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/staticskytool_result.sql
r34719 r43014 1 1 SELECT 2 staticskyResult.*, 3 staticskyRun.state, 4 staticskyRun.workdir, 5 staticskyRun.label, 6 stackRun.tess_id, 7 stackRun.skycell_id, 2 -- EAM only return values needed by supporting code 3 -- this query is used in dist_advancerun.pl & permcheck.pl 4 -- needed fields: workdir, skycell_id, path_base 5 MIN(staticskyResult.path_base) AS path_base, 6 MIN(staticskyRun.state) AS state, 7 MIN(staticskyRun.workdir) AS workdir, 8 MIN(staticskyRun.label) AS label, 9 MIN(stackRun.tess_id) AS tess_id, 10 MIN(stackRun.skycell_id) AS skycell_id, 8 11 count(stackRun.filter) AS num_filters, 9 TRUNCATE( skycell.radeg/15., 4) AS rahours,10 skycell.radeg,11 skycell.decdeg,12 skycell.glong,13 skycell.glat12 TRUNCATE(MIN(skycell.radeg)/15., 4) AS rahours, 13 MIN(skycell.radeg) AS radeg, 14 MIN(skycell.decdeg) AS decdeg, 15 MIN(skycell.glong) AS glong, 16 MIN(skycell.glat) AS glat 14 17 FROM staticskyRun 15 18 JOIN staticskyResult USING(sky_id) -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/staticskytool_todo.sql
r38296 r43014 5 5 staticskyRun.label, 6 6 staticskyRun.state, 7 stackRun.tess_id,8 stackRun.skycell_id,9 TRUNCATE( skycell.radeg/15., 4) as rahours,10 skycell.radeg,11 skycell.decdeg,12 skycell.glong,13 skycell.glat,7 MIN(stackRun.tess_id) as tess_id, 8 MIN(stackRun.skycell_id) as skycell_id, 9 TRUNCATE(MIN(skycell.radeg)/15., 4) as rahours, 10 MIN(skycell.radeg) AS radeg, 11 MIN(skycell.decdeg) AS decdeg, 12 MIN(skycell.glong) AS glong, 13 MIN(skycell.glat) AS glat, 14 14 staticskyResult.path_base, 15 15 IFNULL(Label.priority, 10000) AS priority -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/warptool_finished_run_select.sql
r26567 r43014 6 6 warpRun.warp_id, 7 7 warpRun.label as label, 8 warpSkyCellMap.warp_id as foo, 9 warpSkyfile.warp_id as bar, 10 warpSkyfile.magicked as magicked 8 -- these two fields are not used so we should not select for them 9 -- warpSkyCellMap.warp_id as foo, 10 -- warpSkyfile.warp_id as bar, 11 -- this field is not guaranteed to be unique in the set for a single warp_id 12 -- but the previous query version selected an arbitrary entry. select 13 -- the MIN to avoid trouble with the GROUP BY 14 MIN(warpSkyfile.magicked) as magicked 11 15 FROM warpRun 12 16 JOIN warpSkyCellMap -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/warptool_towarped.sql
r36529 r43014 74 74 warpImfile.warp_skyfile_id, 75 75 warpSkyCellMap.skycell_id, 76 warpSkyCellMap.tess_id,76 MIN(warpSkyCellMap.tess_id) as tess_id, 77 77 warpRun.fake_id, 78 78 warpRun.state, … … 84 84 warpRun.workdir, 85 85 MIN(chipProcessedImfile.magicked) AS magicked, 86 warpSkyfile.path_base,86 MIN(warpSkyfile.path_base) as past_base, 87 87 IFNULL(Label.priority, 10000) AS priority 88 88 FROM warpRun -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/warptool_towarped_labels.sql
r29888 r43014 3 3 Label.label AS label_label, 4 4 IFNULL(Label.priority, 10000) AS priority, 5 count(warpRun.warp_id) 5 count(warpRun.warp_id) AS N_warp 6 6 FROM warpRun 7 7 LEFT JOIN Label ON warpRun.label = Label.label … … 11 11 -- where hook %s 12 12 group by warpRun.label 13 ORDER BY priority DESC, warp_id 13 ORDER BY priority DESC, N_warp DESC 14 -- The old query had warp_id below which is nonsensical 15 -- ORDER BY priority DESC, warp_id -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/xcskytool_definebyquery_select_by_dg.sql
r42837 r43014 8 8 tess_id, 9 9 skycell_id, 10 label,10 MIN(label) as label, 11 11 data_group, 12 12 COUNT(DISTINCT filter) AS num_filter … … 25 25 LEFT JOIN ( 26 26 SELECT DISTINCT xcsky_id, 27 xcstackRun.skycell_id,28 xcstackRun.tess_id,29 xcstackRun.data_group,27 MIN(xcstackRun.skycell_id) as skycell_id, 28 MIN(xcstackRun.tess_id) as tess_id, 29 MIN(xcstackRun.data_group) as data_group, 30 30 COUNT(xcstack_id) AS num_filter 31 31 FROM xcskyRun -
branches/eam_branches/ipp-pstamp-20260421/ippTools/share/xcskytool_result.sql
r42837 r43014 1 1 SELECT 2 xcskyResult.*, 3 xcskyRun.state, 4 xcskyRun.workdir, 5 xcskyRun.label, 2 -- EAM only return values needed by supporting code 3 -- this query is used in dist_advancerun.pl & permcheck.pl 4 -- needed fields: workdir, skycell_id, path_base 5 MIN(xcskyResult.path_base) AS path_base, 6 MIN(xcskyRun.state) AS state, 7 MIN(xcskyRun.workdir) as workdir, 8 MIN(xcskyRun.label) as label, 6 9 MIN(xcstackRun.tess_id) as tess_id, -- we implicitly assume that all xcstackRuns used for a xcskyRun have the same tess_id 7 10 MIN(xcstackRun.skycell_id) as skycell_id, -- and skycell_id
Note:
See TracChangeset
for help on using the changeset viewer.
