Changeset 14059
- Timestamp:
- Jul 6, 2007, 4:50:21 PM (19 years ago)
- Location:
- trunk/ippTools
- Files:
-
- 2 added
- 7 edited
-
scripts/regtest.sh (modified) (2 diffs)
-
share/Makefile.am (modified) (1 diff)
-
share/dettool_tonormalizedexp.sql (added)
-
share/dettool_tonormalizedstat.sql (added)
-
share/dettool_toprocessedexp.sql (modified) (2 diffs)
-
share/dettool_toresidexp.sql (modified) (3 diffs)
-
src/dettool.c (modified) (4 diffs)
-
src/regtool.c (modified) (2 diffs)
-
src/regtoolConfig.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/scripts/regtest.sh
r14037 r14059 33 33 $regtool -pendingexp|| exit 1 34 34 35 $regtool -addprocessedexp -exp_id $exp_id1 -exp_name t10 -i mfiles 4 -inst gpc -telescope ps1 -exp_tag batman.t10 -filelevel OTA -filter r -airmass 10 -ra 1 -decl 2 -exp_type bias -exp_time 0 -bg 10 -bg_stdev 1 -bg_mean_stdev 10 -alt 10 -az 10 -ccd_temp 45 -posang 10 -object dog -dateobs "2006-10-20T10:10:10Z" -label foobar $* || exit 135 $regtool -addprocessedexp -exp_id $exp_id1 -exp_name t10 -inst gpc -telescope ps1 -exp_tag batman.t10 -filelevel OTA -filter r -airmass 10 -ra 1 -decl 2 -exp_type bias -exp_time 0 -bg 10 -bg_stdev 1 -bg_mean_stdev 10 -alt 10 -az 10 -ccd_temp 45 -posang 10 -object dog -dateobs "2006-10-20T10:10:10Z" -label foobar $* || exit 1 36 36 37 37 $regtool -pendingimfile || exit 1 … … 43 43 $regtool -pendingexp|| exit 1 44 44 45 $regtool -addprocessedexp -exp_id $exp_id2 -exp_name t11 -i mfiles 4 -inst gpc -telescope ps1 -exp_tag batman.t11 -filelevel OTA -filter r -airmass 11 -ra 1 -decl 2 -exp_type bias -exp_time 0 -bg 11 -bg_stdev 1 -bg_mean_stdev 11 -alt 11 -az 11 -ccd_temp 45 -posang 11 -object dog -dateobs 2006-10-20T10:10:10Z -label foobar $* || exit 145 $regtool -addprocessedexp -exp_id $exp_id2 -exp_name t11 -inst gpc -telescope ps1 -exp_tag batman.t11 -filelevel OTA -filter r -airmass 11 -ra 1 -decl 2 -exp_type bias -exp_time 0 -bg 11 -bg_stdev 1 -bg_mean_stdev 11 -alt 11 -az 11 -ccd_temp 45 -posang 11 -object dog -dateobs 2006-10-20T10:10:10Z -label foobar $* || exit 1 -
trunk/ippTools/share/Makefile.am
r14045 r14059 14 14 dettool_find_completed_runs.sql \ 15 15 dettool_raw.sql \ 16 dettool_tonormalizedexp.sql \ 17 dettool_tonormalizedstat.sql \ 18 dettool_toprocessedexp.sql \ 16 19 dettool_toprocessedimfile.sql \ 17 dettool_toprocessedexp.sql \ 20 dettool_toresidexp.sql \ 21 dettool_toresidimfile.sql \ 18 22 dettool_tostacked.sql \ 19 dettool_toresidimfile.sql \20 dettool_toresidexp.sql \21 23 difftool_inputskyfile.sql \ 22 24 difftool_skyfile.sql \ -
trunk/ippTools/share/dettool_toprocessedexp.sql
r14045 r14059 29 29 detProcessedImfile.exp_id, 30 30 detProcessedImfile.class_id, 31 rawImfile.class_id as rawimfile_class_id, 31 32 rawExp.camera, 32 33 rawExp.exp_tag … … 56 57 detRun.det_id 57 58 HAVING 58 COUNT(detProcessedImfile.class_id) = rawExp.imfiles59 COUNT(detProcessedImfile.class_id) = COUNT(rawImfile.class_id) 59 60 ) AS detProcessedExp 60 61 -
trunk/ippTools/share/dettool_toresidexp.sql
r14045 r14059 36 36 detInputExp.include, 37 37 rawExp.camera, 38 rawExp.imfiles,39 38 rawExp.exp_tag, 40 39 detResidImfile.class_id … … 44 43 JOIN rawExp 45 44 ON detInputExp.exp_id = rawExp.exp_id 46 JOIN detResidImfile 45 JOIN rawImfile 46 on rawExp.exp_id = rawImfile.exp_id 47 LEFT JOIN detResidImfile 47 48 ON detRun.det_id = detResidImfile.det_id 48 49 AND detRun.iteration = detResidImfile.iteration 49 50 AND detInputExp.exp_id = detResidImfile.exp_id 51 AND rawImfile.class_id = detResidImfile.class_id 50 52 LEFT JOIN detResidExp 51 53 ON detResidImfile.det_id = detResidExp.det_id … … 63 65 detRun.det_id 64 66 HAVING 65 rawExp.imfiles= COUNT(detResidImfile.class_id)67 COUNT(rawImfile.class_id) = COUNT(detResidImfile.class_id) 66 68 ) AS toresidexp -
trunk/ippTools/src/dettool.c
r14047 r14059 3228 3228 } 3229 3229 3230 // select detRun.det_id (det_id) 3231 // select detRun.iteration 3232 // by: 3233 // find the current iteration bassed on det_id 3234 // find all exp_ids in the current det_id/iteration from detInputExp 3235 // sort to detInputExp.imfiles to find the largest value per det_id/iter 3236 // compare imfiles to the number of detStackedImfiles by class_id 3237 // and: 3238 // ??? 3239 // det_id is not in detStackedImfile; 3240 // iteration is not in detStackedImfile; 3241 // class_id is not in detStackedImfile; 3242 3243 psString query = psStringCopy( 3244 "SELECT" 3245 " det_id," 3246 " det_type," 3247 " iteration," 3248 " camera," 3249 " workdir" 3250 " FROM" 3251 "(SELECT DISTINCT" 3252 " detRun.det_id," 3253 " detRun.det_type," 3254 " detRun.iteration," 3255 " detRun.workdir," 3256 " rawExp.camera," 3257 " rawExp.imfiles," 3258 " detStackedImfile.class_id" 3259 " FROM detRun" 3260 " JOIN detInputExp" 3261 " ON detRun.det_id = detInputExp.det_id" 3262 " AND detRun.iteration = detInputExp.iteration" 3263 " JOIN rawExp" 3264 " ON detInputExp.exp_id = rawExp.exp_id" 3265 " JOIN detStackedImfile" 3266 " ON detInputExp.det_id = detStackedImfile.det_id" 3267 " AND detInputExp.iteration = detStackedImfile.iteration" 3268 " LEFT JOIN detNormalizedStatImfile" 3269 " ON detStackedImfile.det_id = detNormalizedStatImfile.det_id" 3270 " AND detStackedImfile.iteration = detNormalizedStatImfile.iteration" 3271 " AND detStackedImfile.class_id = detNormalizedStatImfile.class_id" 3272 " WHERE" 3273 " detRun.state = 'run'" 3274 " AND detRun.mode = 'master'" 3275 " AND detStackedImfile.fault = 0" 3276 " AND detNormalizedStatImfile.det_id IS NULL" 3277 " AND detNormalizedStatImfile.iteration IS NULL" 3278 " AND detNormalizedStatImfile.class_id IS NULL" 3279 " GROUP BY" 3280 " rawExp.exp_id," 3281 " detRun.iteration," 3282 " detRun.det_id" 3283 " HAVING MAX(rawExp.imfiles) = COUNT(detStackedImfile.class_id)" 3284 ") as tonormalizedstat" 3285 ); 3230 psString query = pxDataGet("dettool_tonormalizedstat.sql"); 3231 if (!query) { 3232 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 3233 return false; 3234 } 3286 3235 3287 3236 // XXX does it make sense to accept any search params? … … 3803 3752 } 3804 3753 3805 psString query = psStringCopy( 3806 " SELECT DISTINCT" 3807 " detRun.det_id as det_id," 3808 " detRun.iteration," 3809 " detRun.det_type," 3810 " detRun.workdir," 3811 " rawExp.camera," 3812 " rawExp.telescope," 3813 " rawExp.exp_type," 3814 " rawExp.imfiles" 3815 " FROM detRun" 3816 " JOIN detInputExp" 3817 " ON detRun.det_id = detInputExp.det_id" 3818 " AND detRun.iteration = detInputExp.iteration" 3819 " JOIN rawExp" 3820 " ON detInputExp.exp_id = rawExp.exp_id" 3821 " JOIN detNormalizedImfile" 3822 " ON detInputExp.det_id = detNormalizedImfile.det_id" 3823 " AND detInputExp.iteration = detNormalizedImfile.iteration" 3824 " LEFT JOIN rawImfile" 3825 " ON detInputExp.exp_id = rawImfile.exp_id" 3826 " AND detNormalizedImfile.class_id = rawImfile.class_id" 3827 " LEFT JOIN detNormalizedExp" 3828 " ON detInputExp.det_id = detNormalizedExp.det_id" 3829 " AND detInputExp.iteration = detNormalizedExp.iteration" 3830 " WHERE" 3831 " detRun.state = 'run'" 3832 " AND detRun.mode = 'master'" 3833 " AND detNormalizedImfile.fault = 0" 3834 " AND detNormalizedExp.det_id IS NULL" 3835 " AND detNormalizedExp.iteration IS NULL" 3836 " AND detInputExp.include = 1" 3837 " GROUP BY" 3838 " detNormalizedImfile.iteration," 3839 " detRun.det_id" 3840 " HAVING" 3841 " COUNT(detNormalizedImfile.class_id) = COUNT(rawImfile.class_id)" 3842 ); 3754 psString query = pxDataGet("dettool_tonormalizedexp.sql"); 3755 if (!query) { 3756 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 3757 return false; 3758 } 3843 3759 3844 3760 // XXX does it make sense to accept any search params? … … 3993 3909 } 3994 3910 3995 psString query = psStringCopy( 3996 " SELECT DISTINCT" 3997 " detRun.det_id as det_id," 3998 " detRun.iteration," 3999 " detRun.det_type," 4000 " rawExp.camera," 4001 " rawExp.telescope," 4002 " rawExp.exp_type," 4003 " rawExp.imfiles" 4004 " FROM detRun" 4005 " JOIN detInputExp" 4006 " ON detRun.det_id = detInputExp.det_id" 4007 " AND detRun.iteration = detInputExp.iteration" 4008 " JOIN rawExp" 4009 " ON detInputExp.exp_id = rawExp.exp_id" 4010 " JOIN detNormalizedImfile" 4011 " ON detInputExp.det_id = detNormalizedImfile.det_id" 4012 " AND detInputExp.iteration = detNormalizedImfile.iteration" 4013 " LEFT JOIN rawImfile" 4014 " ON detInputExp.exp_id = rawImfile.exp_id" 4015 " AND detNormalizedImfile.class_id = rawImfile.class_id" 4016 " LEFT JOIN detNormalizedExp" 4017 " ON detInputExp.det_id = detNormalizedExp.det_id" 4018 " AND detInputExp.iteration = detNormalizedExp.iteration" 4019 " WHERE" 4020 " detRun.state = 'run'" 4021 " AND detRun.mode = 'master'" 4022 " AND detNormalizedExp.det_id IS NULL" 4023 " AND detNormalizedExp.iteration IS NULL" 4024 " AND detInputExp.include = 1" 4025 " AND detRun.det_id = %s" 4026 " AND detNormalizedImfile.iteration = %d" 4027 " GROUP BY" 4028 " detNormalizedImfile.iteration," 4029 " detRun.det_id" 4030 " HAVING" 4031 " COUNT(detNormalizedImfile.class_id) = COUNT(rawImfile.class_id)" 4032 ); 4033 4034 if (!p_psDBRunQuery(config->dbh, query, det_id, iteration)) { 3911 psString query = pxDataGet("dettool_tonormalizedexp.sql"); 3912 if (!query) { 3913 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 3914 return false; 3915 } 3916 3917 psStringAppend(&query, 3918 "WHERE det_id = %s" 3919 " AND iteration = %d", det_id, iteration); 3920 3921 3922 if (!p_psDBRunQuery(config->dbh, query)) { 4035 3923 psError(PS_ERR_UNKNOWN, false, "database error"); 4036 3924 psFree(query); … … 4993 4881 // detResidImfile.{det_id, iteration, exp_id} is not in detResidExp 4994 4882 4995 psString query = psStringCopy( 4996 "SELECT DISTINCT" 4997 " det_id," 4998 " iteration," 4999 " exp_id," 5000 " include" 5001 " FROM" 5002 " (SELECT DISTINCT" 5003 " detRun.det_id AS det_id," 5004 " detRun.iteration," 5005 " detRun.det_type," 5006 " detInputExp.exp_id," 5007 " detInputExp.include," 5008 " rawExp.imfiles" 5009 " FROM detRun" 5010 " JOIN detInputExp" 5011 " USING(det_id, iteration)" 5012 " JOIN rawExp" 5013 " ON detInputExp.exp_id = rawExp.exp_id" 5014 " JOIN detResidImfile" 5015 " ON detRun.det_id = detResidImfile.det_id" 5016 " AND detRun.iteration = detResidImfile.iteration" 5017 " AND detInputExp.exp_id = detResidImfile.exp_id" 5018 " LEFT JOIN detResidExp" 5019 " ON detResidImfile.det_id = detResidExp.det_id" 5020 " AND detResidImfile.iteration = detResidExp.iteration" 5021 " AND detResidImfile.exp_id = detResidExp.exp_id" 5022 " WHERE" 5023 " detRun.state = 'run'" 5024 " AND detResidExp.det_id IS NULL" 5025 " AND detResidExp.iteration IS NULL" 5026 " AND detResidExp.exp_id IS NULL" 5027 " GROUP BY" 5028 " detInputExp.exp_id," 5029 " detRun.iteration," 5030 " detRun.det_id" 5031 " HAVING" 5032 " rawExp.imfiles = COUNT(detResidImfile.class_id)" 5033 " ) AS toresidexp" 5034 ); 4883 psString query = pxDataGet("dettool_toresidexp.sql"); 4884 if (!query) { 4885 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 4886 return false; 4887 } 5035 4888 5036 4889 { -
trunk/ippTools/src/regtool.c
r14024 r14059 897 897 } 898 898 899 psS32 imfiles = psMetadataLookupS32(&status, config->args, "-imfiles");900 if (!status) {901 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -imfiles");902 return false;903 }904 if (!imfiles) {905 psError(PS_ERR_UNKNOWN, true, "-imfiles is required");906 return false;907 }908 909 899 psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag"); 910 900 if (!status) { … … 1074 1064 exp_tag, 1075 1065 exp_type, 1076 imfiles,1077 1066 filelevel, 1078 1067 exp->workdir, -
trunk/ippTools/src/regtoolConfig.c
r14023 r14059 153 153 psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-exp_type", 0, 154 154 "search by exposure type", NULL); 155 psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-imfiles", 0,156 "search for exps with N imfiles", NULL);157 155 psMetadataAddU64(pendingexpArgs, PS_LIST_TAIL, "-limit", 0, 158 156 "limit result set to N items", 0); … … 176 174 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-exp_type", 0, 177 175 "define exposure type", NULL); 178 psMetadataAddS32(addprocessedexpArgs, PS_LIST_TAIL, "-imfiles", 0,179 "define the number of imfiles in this exp (required)", 0);180 176 psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-filelevel", 0, 181 177 "define the data partitioning level of this file", NULL); … … 307 303 addWhereStr(telescope); 308 304 addWhereStr(exp_type); 309 {310 int imfiles = 0;311 bool status = false;312 if ((imfiles = psMetadataLookupS32(&status, config->args, "-imfiles"))) {313 if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "imfiles", 0, "==", imfiles)) {314 psError(PXTOOLS_ERR_PROG, false, "failed to add item imfiles");315 psFree(config);316 return NULL;317 }318 }319 }320 305 addWhereStr(class); 321 306 addWhereStr(class_id);
Note:
See TracChangeset
for help on using the changeset viewer.
