Changeset 28338
- Timestamp:
- Jun 15, 2010, 1:12:26 PM (16 years ago)
- Location:
- branches/czw_branch/20100519
- Files:
-
- 34 edited
- 1 copied
-
. (modified) (1 prop)
-
Ohana (modified) (1 prop)
-
Ohana/src/addstar/test (modified) (1 prop)
-
Ohana/src/addstar/test/dvomerge.dvo (modified) (5 diffs)
-
Ohana/src/dvomerge/src/LoadCatalog.c (modified) (1 diff)
-
Ohana/src/dvomerge/src/dvomerge.c (modified) (1 diff)
-
Ohana/src/dvomerge/src/dvomergeUpdate.c (modified) (5 diffs)
-
Ohana/src/dvomerge/src/merge_catalogs_old.c (modified) (8 diffs)
-
Ohana/src/libdvo/src/SavePhotcodesText.c (modified) (1 diff)
-
Ohana/src/opihi/cmd.data/create.c (modified) (1 diff)
-
Ohana/src/opihi/cmd.data/help/histogram (modified) (1 diff)
-
Ohana/src/opihi/cmd.data/help/imhist (copied) (copied from trunk/Ohana/src/opihi/cmd.data/help/imhist )
-
Ohana/src/opihi/dvo/gstar.c (modified) (3 diffs)
-
Ohana/src/opihi/pcontrol/StartJob.c (modified) (1 diff)
-
Ohana/src/photdbc/include/photdbc.h (modified) (1 diff)
-
Ohana/src/photdbc/src/ConfigInit.c (modified) (1 diff)
-
Ohana/src/photdbc/src/copy_images.c (modified) (2 diffs)
-
Ohana/src/photdbc/src/make_subcatalog.c (modified) (2 diffs)
-
Ohana/src/photdbc/src/photdbc.c (modified) (2 diffs)
-
ippScripts/scripts/automate_stacks.pl (modified) (1 diff)
-
ippScripts/scripts/minidvodb_merge.pl (modified) (1 diff)
-
ippTasks/nightly_stacks.pro (modified) (1 diff)
-
ippTasks/stack.pro (modified) (1 diff)
-
ippTools/share/chiptool_processedimfile.sql (modified) (1 diff)
-
ippTools/share/pubtool_definerun.sql (modified) (3 diffs)
-
ippTools/share/pubtool_pending.sql (modified) (2 diffs)
-
ippTools/src/pstamptool.c (modified) (2 diffs)
-
ippTools/src/pstamptoolConfig.c (modified) (1 diff)
-
ippTools/src/pubtool.c (modified) (4 diffs)
-
ippTools/src/pubtoolConfig.c (modified) (2 diffs)
-
ippTools/src/pxtools.c (modified) (2 diffs)
-
ippconfig/recipes/nightly_science.config (modified) (1 diff)
-
magic/remove/src/streaksio.c (modified) (1 diff)
-
psModules/src/imcombine/pmPSFEnvelope.c (modified) (3 diffs)
-
pstamp/src/ppstampMakeStamp.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20100519
- Property svn:mergeinfo changed
/trunk merged: 28308-28311,28313,28317,28319-28332,28335-28337
- Property svn:mergeinfo changed
-
branches/czw_branch/20100519/Ohana
- Property svn:mergeinfo changed
/trunk/Ohana merged: 28317,28324-28331,28335-28337
- Property svn:mergeinfo changed
-
branches/czw_branch/20100519/Ohana/src/addstar/test
- Property svn:ignore
-
old new 4 4 test.in.txt 5 5 catdir.test 6 catdir.test1 7 catdir.test2 8 catdir.test3 6 9 .dvo 7 10 relphot.airmass.png
-
- Property svn:ignore
-
branches/czw_branch/20100519/Ohana/src/addstar/test/dvomerge.dvo
r27435 r28338 105 105 end 106 106 107 # create 2 populated catdirs, each with a couple of cmf files 108 macro test.dvomerge. create109 110 tapPLAN 21107 # create 2 populated catdirs, each with a couple of cmf files -- force some unmatched objects 108 macro test.dvomerge.update.extras 109 110 tapPLAN 51 111 111 112 112 exec rm -rf catdir.test1 … … 124 124 exec addstar -D CATDIR catdir.test1 -D CAMERA simtest test.cmf 125 125 126 # generate a few extra unmatched sources 127 mkinput.extras 126 128 exec mkcmf test.in.txt test.cmf -date 2008/1/1 -time 03:00:00 -radec $RA $DEC 127 129 exec addstar -D CATDIR catdir.test2 -D CAMERA simtest test.cmf … … 130 132 exec addstar -D CATDIR catdir.test2 -D CAMERA simtest test.cmf 131 133 132 exec dvomerge catdir.test1 and catdir.test2 to catdir.test3 134 exec rsync -auc catdir.test2/ catdir.test3/ 135 136 exec dvomerge catdir.test1 into catdir.test3 133 137 134 138 catdir catdir.test3 … … 205 209 end 206 210 211 # create 2 populated catdirs, each with a couple of cmf files 212 macro test.dvomerge.create 213 214 tapPLAN 21 215 216 exec rm -rf catdir.test1 217 exec rm -rf catdir.test2 218 exec rm -rf catdir.test3 219 220 $RA = 10.0 221 $DEC = 20.0 222 223 mkinput 224 exec mkcmf test.in.txt test.cmf -date 2008/1/1 -time 01:00:00 -radec $RA $DEC 225 exec addstar -D CATDIR catdir.test1 -D CAMERA simtest test.cmf 226 227 exec mkcmf test.in.txt test.cmf -date 2008/1/1 -time 02:00:00 -radec $RA $DEC 228 exec addstar -D CATDIR catdir.test1 -D CAMERA simtest test.cmf 229 230 exec mkcmf test.in.txt test.cmf -date 2008/1/1 -time 03:00:00 -radec $RA $DEC 231 exec addstar -D CATDIR catdir.test2 -D CAMERA simtest test.cmf 232 233 exec mkcmf test.in.txt test.cmf -date 2008/1/1 -time 04:00:00 -radec $RA $DEC 234 exec addstar -D CATDIR catdir.test2 -D CAMERA simtest test.cmf 235 236 exec dvomerge catdir.test1 and catdir.test2 to catdir.test3 237 238 catdir catdir.test3 239 skyregion {$RA-1} {$RA+1} {$DEC-1} {$DEC+1} 240 mextract ra dec mag 241 create n 0 ra[] 242 subset r0 = ra if (n % 4 == 0) 243 subset r1 = ra if (n % 4 == 1) 244 subset r2 = ra if (n % 4 == 2) 245 subset r3 = ra if (n % 4 == 3) 246 247 catdir catdir.test1/ 248 mextract RA DEC MAG 249 create N 0 RA[] 250 subset R0 = RA if (N % 2 == 0) 251 subset R1 = RA if (N % 2 == 1) 252 253 set dr0 = r0 - R0 254 vstat -q dr0 255 tapOK {abs($MEAN) < 0.001} "ra (in - 0) vs ra (out - 0) (MEAN)" 256 tapOK {abs($SIGMA) < 0.001} "ra (in - 0) vs ra (out - 0) (SIGMA)" 257 258 set dr1 = r1 - R1 259 vstat -q dr1 260 tapOK {abs($MEAN) < 0.001} "ra (in - 0) vs ra (out - 0) (MEAN)" 261 tapOK {abs($SIGMA) < 0.001} "ra (in - 0) vs ra (out - 0) (SIGMA)" 262 263 catdir catdir.test2/ 264 mextract RA DEC MAG 265 create N 0 RA[] 266 subset R2 = RA if (N % 2 == 0) 267 subset R3 = RA if (N % 2 == 1) 268 269 set dr2 = r2 - R2 270 vstat -q dr2 271 tapOK {abs($MEAN) < 0.001} "ra (in - 0) vs ra (out - 0) (MEAN)" 272 tapOK {abs($SIGMA) < 0.001} "ra (in - 0) vs ra (out - 0) (SIGMA)" 273 274 set dr3 = r3 - R3 275 vstat -q dr3 276 tapOK {abs($MEAN) < 0.001} "ra (in - 0) vs ra (out - 0) (MEAN)" 277 tapOK {abs($SIGMA) < 0.001} "ra (in - 0) vs ra (out - 0) (SIGMA)" 278 279 # check on updates to imageID 280 catdir catdir.test3 281 imextract imageID 282 sort imageID 283 tapOK {imageID[] == 4} "image IDs exist" 284 tapOK {imageID[0] == 1} "updated image IDs" 285 tapOK {imageID[1] == 2} "updated image IDs" 286 tapOK {imageID[2] == 3} "updated image IDs" 287 tapOK {imageID[3] == 4} "updated image IDs" 288 289 catdir catdir.test3 290 mextract imageID, time 291 set id = imageID 292 set t = time 293 imextract imageID, time 294 295 for i 0 time[] 296 subset T = t if (id == imageID[$i]) 297 set dT = T - time[$i] 298 vstat -q dT 299 tapOK {abs($MEAN) < 0.00001} "time for measure ID $i (MEAN)" 300 tapOK {abs($SIGMA) < 0.00001} "time for measure ID $i (SIGMA)" 301 end 302 303 # exec rm test.in.txt test.cmf 304 # exec rm -rf catdir.test1 305 # exec rm -rf catdir.test2 306 # exec rm -rf catdir.test3 307 308 tapDONE 309 end 310 207 311 # make a simple input file for mkcmf 208 312 macro mkinput.alt … … 225 329 for i 10 1024 100 226 330 for j 10 1024 100 331 fprintf " %4d %4d %6.2f" $i $j {-15.0 + 2.5*($i + $j)/1000.0} 332 end 333 end 334 output stdout 335 end 336 337 # make a simple input file for mkcmf 338 macro mkinput.extras 339 exec rm -f test.in.txt 340 341 output test.in.txt 342 for i 10 1024 100 343 for j 10 1024 100 344 fprintf " %4d %4d %6.2f" $i $j {-15.0 + 2.5*($i + $j)/1000.0} 345 end 346 end 347 for i 20 1024 500 348 for j 20 1024 500 227 349 fprintf " %4d %4d %6.2f" $i $j {-15.0 + 2.5*($i + $j)/1000.0} 228 350 end -
branches/czw_branch/20100519/Ohana/src/dvomerge/src/LoadCatalog.c
r24745 r28338 7 7 catalog[0].Nsecfilt = GetPhotcodeNsecfilt (); 8 8 9 if (!strcmp (mode, "w")) { 10 catalog[0].catflags = LOAD_NONE; 11 } else { 12 catalog[0].catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF; 13 } 9 // always load all of the data (if any exists) 10 catalog[0].catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF; 14 11 15 12 catalog[0].catformat = dvo_catalog_catformat (CATFORMAT); // set the default catformat from config data -
branches/czw_branch/20100519/Ohana/src/dvomerge/src/dvomerge.c
r27583 r28338 7 7 ConfigInit (&argc, argv); 8 8 dvomerge_args (&argc, argv); 9 10 // XXX require both inputs to be sorted? 9 11 10 12 if (argc == 6) dvomergeCreate (argc, argv); -
branches/czw_branch/20100519/Ohana/src/dvomerge/src/dvomergeUpdate.c
r27583 r28338 16 16 output = argv[3]; 17 17 18 // the first input defines the photcode table & db layout 19 sprintf (filename, "%s/Photcodes.dat", input); 18 // since we are merging the input db into the output db, the output defines the photcode 19 // table & db layout but, this requires the output to exist. if it does not, instead use the 20 // input. 21 sprintf (filename, "%s/Photcodes.dat", output); 20 22 if (!LoadPhotcodes (filename, NULL, FALSE)) { 21 fprintf (stderr, "error loading photcode table %s\n", filename); 22 exit (1); 23 sprintf (filename, "%s/Photcodes.dat", input); 24 if (!LoadPhotcodes (filename, NULL, FALSE)) { 25 fprintf (stderr, "error loading photcode table: tried %s/Photcodes.dat and %s/Photcodes.dat\n", output, input); 26 exit (1); 27 } 23 28 } 24 29 … … 27 32 // load the sky table for the existing database 28 33 insky = SkyTableLoadOptimal (input, NULL, NULL, FALSE, SKY_DEPTH_HST, VERBOSE); 34 if (!insky) { 35 Shutdown ("can't read SkyTable for %s", input); 36 } 29 37 SkyTableSetFilenames (insky, input, "cpt"); 30 38 31 39 // generate an output table populated at the desired depth 32 outsky = SkyTableLoadOptimal (output, NULL, NULL, TRUE, SKY_DEPTH, VERBOSE); 40 outsky = SkyTableLoadOptimal (output, NULL, GSCFILE, TRUE, SKY_DEPTH, VERBOSE); 41 if (!outsky) { 42 Shutdown ("can't read or create SkyTable for %s", output); 43 } 33 44 SkyTableSetFilenames (outsky, output, "cpt"); 34 45 … … 43 54 if (VERBOSE) fprintf (stderr, "output: %s\n", outsky[0].regions[i].name); 44 55 45 // load / create output catalog 46 LoadCatalog (&outcatalog, &outsky[0].regions[i], outsky[0].filename[i], " a");56 // load / create output catalog (if catalog does not exist, it will be created) 57 LoadCatalog (&outcatalog, &outsky[0].regions[i], outsky[0].filename[i], "w"); 47 58 48 59 // combine only tables at equal or larger depth … … 102 113 // load the image table 103 114 if (inDB.dbstate == LCK_EMPTY) { 104 Shutdown ("can't find input (1)image catalog %s", inDB.filename);115 Shutdown ("can't find input image catalog %s", inDB.filename); 105 116 } 106 117 if (!dvo_image_load (&inDB, VERBOSE, TRUE)) { 107 Shutdown ("can't read input (1)image catalog %s", inDB.filename);118 Shutdown ("can't read input image catalog %s", inDB.filename); 108 119 } 109 120 … … 117 128 /* load the image table */ 118 129 if (outDB.dbstate == LCK_EMPTY) { 119 Shutdown ("can't find input (2) image catalog %s", outDB.filename); 120 } 121 if (!dvo_image_load (&outDB, VERBOSE, TRUE)) { 122 Shutdown ("can't read input (2) image catalog %s", outDB.filename); 130 dvo_image_create (&outDB, GetZeroPoint()); 131 } else { 132 if (!dvo_image_load (&outDB, VERBOSE, TRUE)) { 133 Shutdown ("can't read output image catalog %s", outDB.filename); 134 } 123 135 } 124 136 -
branches/czw_branch/20100519/Ohana/src/dvomerge/src/merge_catalogs_old.c
r28304 r28338 63 63 tcoords.Npolyterms = 1; 64 64 strcpy (tcoords.ctype, "RA---ARC"); 65 66 if (VERBOSE) fprintf (stderr, "merging %s into %s\n", input[0].filename, output[0].filename); 65 67 66 68 /* build spatial index (RA sort) referencing input array sequence */ … … 161 163 REALLOCATE (output[0].measure, Measure, NMEAS); 162 164 } 165 166 // 4) average properties from the input and the output db need to be properly merged. 163 167 164 168 /** add ALL measurements for this input average object **/ … … 209 213 } 210 214 215 // update the average properties to reflect the incoming entries: 216 // if the original value is NAN but the input value is not, accept the input: 217 for (j = 0; j < Nsecfilt; j++) { 218 if ( isfinite(output[0].secfilt[n*Nsecfilt+j].M)) continue; 219 if (!isfinite( input[0].secfilt[N*Nsecfilt+j].M)) continue; 220 output[0].secfilt[n*Nsecfilt+j].M = input[0].secfilt[N*Nsecfilt+j].M; 221 output[0].secfilt[n*Nsecfilt+j].dM = input[0].secfilt[N*Nsecfilt+j].dM; 222 output[0].secfilt[n*Nsecfilt+j].Xm = input[0].secfilt[N*Nsecfilt+j].Xm; 223 output[0].secfilt[n*Nsecfilt+j].M_20 = input[0].secfilt[N*Nsecfilt+j].M_20; 224 output[0].secfilt[n*Nsecfilt+j].M_80 = input[0].secfilt[N*Nsecfilt+j].M_80; 225 output[0].secfilt[n*Nsecfilt+j].Ncode = input[0].secfilt[N*Nsecfilt+j].Ncode; 226 output[0].secfilt[n*Nsecfilt+j].Nused = input[0].secfilt[N*Nsecfilt+j].Nused; 227 } 228 211 229 /* Nm is updated, but not written out in -update mode (for existing entries) 212 230 Nm is recalculated in build_meas_links if loaded table is not sorted */ … … 242 260 if (!IN_REGION (input[0].average[N].R, input[0].average[N].D)) continue; 243 261 262 // XXX should we accept the input measurements for the fields? 263 244 264 output[0].average[Nave].R = input[0].average[N].R; 245 265 output[0].average[Nave].D = input[0].average[N].D; … … 247 267 output[0].average[Nave].dD = 0; 248 268 249 output[0].average[Nave].Nmeasure = 1;269 output[0].average[Nave].Nmeasure = 0; // this value is update as the measurements are associated with this entry below 250 270 output[0].average[Nave].Nmissing = 0; 251 271 output[0].average[Nave].Nextend = 0; … … 282 302 283 303 for (j = 0; j < Nsecfilt; j++) { 284 output[0].secfilt[Nave*Nsecfilt+j].M = NAN; 285 output[0].secfilt[Nave*Nsecfilt+j].dM = NAN; 286 output[0].secfilt[Nave*Nsecfilt+j].Xm = NAN_S_SHORT; 287 output[0].secfilt[Nave*Nsecfilt+j].M_20 = NAN_S_SHORT; 288 output[0].secfilt[Nave*Nsecfilt+j].M_80 = NAN_S_SHORT; 289 output[0].secfilt[Nave*Nsecfilt+j].Ncode = 0; 290 output[0].secfilt[Nave*Nsecfilt+j].Nused = 0; 304 if (isfinite(input[0].secfilt[N*Nsecfilt+j].M)) { 305 output[0].secfilt[Nave*Nsecfilt+j].M = input[0].secfilt[N*Nsecfilt+j].M; 306 output[0].secfilt[Nave*Nsecfilt+j].dM = input[0].secfilt[N*Nsecfilt+j].dM; 307 output[0].secfilt[Nave*Nsecfilt+j].Xm = input[0].secfilt[N*Nsecfilt+j].Xm; 308 output[0].secfilt[Nave*Nsecfilt+j].M_20 = input[0].secfilt[N*Nsecfilt+j].M_20; 309 output[0].secfilt[Nave*Nsecfilt+j].M_80 = input[0].secfilt[N*Nsecfilt+j].M_80; 310 output[0].secfilt[Nave*Nsecfilt+j].Ncode = input[0].secfilt[N*Nsecfilt+j].Ncode; 311 output[0].secfilt[Nave*Nsecfilt+j].Nused = input[0].secfilt[N*Nsecfilt+j].Nused; 312 } else { 313 output[0].secfilt[Nave*Nsecfilt+j].M = NAN; 314 output[0].secfilt[Nave*Nsecfilt+j].dM = NAN; 315 output[0].secfilt[Nave*Nsecfilt+j].Xm = NAN_S_SHORT; 316 output[0].secfilt[Nave*Nsecfilt+j].M_20 = NAN_S_SHORT; 317 output[0].secfilt[Nave*Nsecfilt+j].M_80 = NAN_S_SHORT; 318 output[0].secfilt[Nave*Nsecfilt+j].Ncode = 0; 319 output[0].secfilt[Nave*Nsecfilt+j].Nused = 0; 320 } 291 321 } 292 322 … … 304 334 output[0].measure[Nmeas].catID = output[0].catID; 305 335 306 /* next[Nmeas] should always be -1 in this context (it is always the only 307 measurement for the star) */ 336 // as we add measurements, update Nmeasure to match 337 output[0].average[Nave].Nmeasure ++; 338 339 /* we set next[Nmeas] to -1 here, and update correctly below */ 308 340 input[0].found[N] = Nmeas; 309 341 next_meas[Nmeas] = -1; … … 327 359 # endif 328 360 329 # define NOSORT FALSE361 # define NOSORT 0 330 362 if (NOSORT) { 331 363 output[0].sorted = FALSE; -
branches/czw_branch/20100519/Ohana/src/libdvo/src/SavePhotcodesText.c
r17190 r28338 69 69 type, 70 70 table[0].code[i].C*SCALE, 71 table[0].code[i].K *SCALE,71 table[0].code[i].K, 72 72 table[0].code[i].dC*SCALE); 73 73 -
branches/czw_branch/20100519/Ohana/src/opihi/cmd.data/create.c
r27817 r28338 4 4 5 5 int i, N, INT; 6 float start, end, delta;6 opihi_flt start, end, delta; 7 7 Vector *vec; 8 8 -
branches/czw_branch/20100519/Ohana/src/opihi/cmd.data/help/histogram
r4688 r28338 1 1 2 histogram < buffer> <x> <y> [-region sx sy nx ny] [-range min max]2 histogram <invec> <outvec> <start> <end> [<delta>] [-range <dx_outvec>] 3 3 4 calculate a histogram of the image pixel values in the given 5 buffer, optionally constrained to the given region, with optional 6 max and min values. the results are placed in the vectors x and y, 7 which contain the pixel values and the number of occurences. 4 calculate a histogram of the <invec> values and store the 5 occurrences count in the <outvec> buffer. Optionally constrained to 6 the given <start>-<end> region with <delta> step value (default 7 step is 1). The optional '-range <dx_outvec>' parameter allows storing 8 the range <start>-<end> values with <delta> increment 8 9 10 Sample code usage: 11 12 # create a vector ('x') containing arbitrary values [0.:1.] range 13 create y 0 100 1; set x = sin(y) 14 15 # build histogram from x from 0. to 1. with 0.1 delta step 16 histogram x xhist 0. 1. .1 -range dx 17 18 # plot corresponding histogram 19 limits dx xhist; clear; box; plot dx xhist -x 1 -
branches/czw_branch/20100519/Ohana/src/opihi/dvo/gstar.c
r28304 r28338 165 165 gprint (GP_LOG, "%3d ", catalog.average[k].Nmeasure); 166 166 gprint (GP_LOG, "%4.1f ", 0.01*catalog.average[k].Xp); 167 gprint (GP_LOG, "%5d ", catalog.average[k].flags); 167 gprint (GP_LOG, "%5x ", catalog.average[k].flags); 168 gprint (GP_LOG, "%x ", catalog.average[k].objID); 169 gprint (GP_LOG, "%x ", catalog.average[k].catID); 168 170 169 171 if (FULL_OUTPUT) { … … 176 178 gprint (GP_LOG, "%f ", catalog.average[k].P); 177 179 gprint (GP_LOG, "%f ", catalog.average[k].dP); 178 gprint (GP_LOG, "%x ", catalog.average[k].objID);179 gprint (GP_LOG, "%x ", catalog.average[k].catID);180 180 } 181 181 … … 244 244 gprint (GP_LOG, "%f ", catalog.measure[m].crNsigma); 245 245 gprint (GP_LOG, "%f ", catalog.measure[m].extNsigma); 246 gprint (GP_LOG, "%f ", 0.01*catalog.measure[m].FWx);247 gprint (GP_LOG, "%f ", 0.01*catalog.measure[m].FWy);248 246 gprint (GP_LOG, "%f ", (360.0/(float)0xffff)*catalog.measure[m].theta); 249 247 } -
branches/czw_branch/20100519/Ohana/src/opihi/pcontrol/StartJob.c
r28304 r28338 36 36 } 37 37 38 fprintf (stderr, "command: %s\n", line);38 // fprintf (stderr, "command: %s\n", line); 39 39 40 40 status = PclientCommand (host, line, PCLIENT_PROMPT, PCONTROL_RESP_START_JOB); -
branches/czw_branch/20100519/Ohana/src/photdbc/include/photdbc.h
r27435 r28338 52 52 double CHISQ_MAX; 53 53 double SIGMA_MAX; 54 double AVE_SIGMA_LIM; 54 55 int NMEAS_MIN; 55 56 double ZERO_POINT; -
branches/czw_branch/20100519/Ohana/src/photdbc/src/ConfigInit.c
r25757 r28338 42 42 43 43 ScanConfig (config, "SIGMA_MAX", "%lf", 0, &SIGMA_MAX); 44 ScanConfig (config, "AVE_SIGMA_LIM", "%lf", 0, &AVE_SIGMA_LIM); 44 45 ScanConfig (config, "NMEAS_MIN", "%d", 0, &NMEAS_MIN); 45 46 -
branches/czw_branch/20100519/Ohana/src/photdbc/src/copy_images.c
r28334 r28338 6 6 off_t Nimage; 7 7 char *ImageOut; 8 unsigned int imageID; 8 9 FITS_DB in; 9 10 FITS_DB out; … … 47 48 dvo_image_addrows (&out, image, Nimage); 48 49 50 // note that imageID is unsigned int 51 status = gfits_scan (&in.header, "IMAGEID", "%u", 1, &imageID); 52 if (!status) { 53 status = gfits_scan (&in.header, "NIMAGES", "%u", 1, &imageID); 54 imageID++; 55 } 56 status = gfits_modify (&out.header, "IMAGEID", "%u", 1, imageID); 57 49 58 dvo_image_update (&out, VERBOSE); 50 59 dvo_image_unlock (&out); -
branches/czw_branch/20100519/Ohana/src/photdbc/src/make_subcatalog.c
r28334 r28338 8 8 off_t NAVERAGE, NMEASURE, Naverage, Nmeasure, Nm, Nsecfilt; 9 9 double mag, minMag; 10 10 int keep; 11 11 12 Nsecfilt = GetPhotcodeNsecfilt (); 12 13 assert (catalog[0].Nsecfilt == Nsecfilt); … … 25 26 // exclude stars with too few measurements 26 27 if (NMEAS_MIN && (catalog[0].average[i].Nmeasure < NMEAS_MIN)) continue; 28 29 if (AVE_SIGMA_LIM) { 30 // if all of the average magnitude errors are >AVE_SIGMA_LIM, drop the object 31 keep = FALSE; 32 for (j = 0; !keep && (j < Nsecfilt); j++) { 33 if (catalog[0].secfilt[Nsecfilt*i+j].dM < AVE_SIGMA_LIM) { 34 keep = TRUE; 35 } 36 } 37 if (!keep) continue; 38 } 27 39 28 40 /* assign average and secfilt values */ -
branches/czw_branch/20100519/Ohana/src/photdbc/src/photdbc.c
r28334 r28338 21 21 skylist = SkyListByPatch (sky, -1, ®ION); 22 22 for (i = 0; i < skylist[0].Nregions; i++) { 23 if ( i % 100 == 0) fprintf (stderr, "%s\n", skylist[0].regions[i][0].name);23 if (VERBOSE) fprintf (stderr, "%s\n", skylist[0].regions[i][0].name); 24 24 25 25 // set the parameters which guide catalog open/load/create … … 56 56 } 57 57 58 // the output catalog needs to have the same values for 'objID' and 'sorted' as the input 59 outcatalog.objID = incatalog.objID; 60 outcatalog.sorted = incatalog.sorted; 61 if (!incatalog.sorted) { 62 fprintf (stderr, "ERROR: input db must be sorted: %s\n", incatalog.filename); 63 exit (2); 64 } 65 58 66 /* limit number of measures based on selections */ 59 67 make_subcatalog (&outcatalog, &incatalog); -
branches/czw_branch/20100519/ippScripts/scripts/automate_stacks.pl
r28304 r28338 674 674 675 675 my $cmd = "$dettool"; 676 $cmd .= " -pretend ";676 # $cmd .= " -pretend "; 677 677 $cmd .= " -simple -dbname $dbname -definebyquery -det_type $det_type "; 678 678 $cmd .= " -mode verify -ref_det_id $ref_det_id -ref_iter $ref_iter "; -
branches/czw_branch/20100519/ippScripts/scripts/minidvodb_merge.pl
r28304 r28338 171 171 if ($this_is_the_first) { 172 172 173 $merge_command = " cp -rp$minidvodb/* $mergedvodb";173 $merge_command = "rsync -rvat $minidvodb/* $mergedvodb"; 174 174 } else { 175 175 $merge_command = "$dvomerge $minidvodb into $mergedvodb"; -
branches/czw_branch/20100519/ippTasks/nightly_stacks.pro
r28304 r28338 214 214 periods -exec $LOADEXEC 215 215 periods -timeout 30 216 trange 23:00:00 2 4:00:00-nmax 1216 trange 23:00:00 23:59:59 -nmax 1 217 217 npending 1 218 active false 218 219 219 220 task.exec -
branches/czw_branch/20100519/ippTasks/stack.pro
r28334 r28338 426 426 periods -exec $LOADEXEC 427 427 periods -timeout 1200 428 trange 07:00:00 08:00:00 428 429 npending 1 429 430 -
branches/czw_branch/20100519/ippTools/share/chiptool_processedimfile.sql
r27880 r28338 29 29 rawImfile.magicked AS raw_magicked, 30 30 rawImfile.burntool_state, 31 magicDSRun.state AS dsRun_state 31 magicDSRun.state AS dsRun_state, 32 magicDSRun.magic_ds_id 32 33 FROM chipRun 33 34 JOIN chipImfile -
branches/czw_branch/20100519/ippTools/share/pubtool_definerun.sql
r27041 r28338 6 6 FROM ( 7 7 -- Get diffs to publish 8 SELECT 8 SELECT DISTINCT 9 9 client_id, 10 10 diff_id AS stage_id, 11 label AS src_label11 diffRun.label AS src_label 12 12 FROM publishClient 13 13 JOIN diffRun 14 JOIN diffInputSkyfile USING(diff_id) 15 JOIN warpRun ON warpRun.warp_id = diffInputSkyfile.warp1 -- Only JOINing input, not reference! 16 JOIN fakeRun USING(fake_id) 17 JOIN camRun USING(cam_id) 18 JOIN chipRun USING(chip_id) 19 JOIN rawExp USING(exp_id) 14 20 WHERE publishClient.stage = 'diff' 15 21 AND publishClient.active = 1 16 AND diffRun.state = 'full'22 AND diffRun.state IN ('full', 'cleaned', 'goto_cleaned') 17 23 AND (diffRun.magicked > 0 OR diffRun.diff_mode = 4 OR publishClient.magicked = 0) 18 24 -- WHERE hook %s … … 22 28 client_id, 23 29 cam_id AS stage_id, 24 label AS src_label30 camRun.label AS src_label 25 31 FROM publishClient 26 32 JOIN camRun 33 JOIN chipRun USING(chip_id) 34 JOIN rawExp USING(exp_id) 27 35 WHERE publishClient.stage = 'camera' 28 36 AND publishClient.active = 1 29 AND camRun.state = 'full'37 AND camRun.state IN ('full', 'cleaned', 'goto_cleaned') 30 38 AND (camRun.magicked > 0 OR publishClient.magicked = 0) 31 39 -- WHERE hook %s … … 33 41 -- Only get stuff that hasn't been published 34 42 LEFT JOIN publishRun USING(client_id, stage_id) 35 WHERE publishRun.client_id IS NULL -
branches/czw_branch/20100519/ippTools/share/pubtool_pending.sql
r27052 r28338 26 26 AND publishClient.active = 1 27 27 AND publishRun.state = 'new' 28 AND diffRun.state = 'full'28 AND diffRun.state IN ('full', 'cleaned', 'goto_cleaned') 29 29 AND (diffRun.magicked > 0 OR diffRun.diff_mode = 4 OR publishClient.magicked = 0) 30 30 -- WHERE hook %s … … 47 47 AND publishClient.active = 1 48 48 AND publishRun.state ='new' 49 AND camRun.state = 'full'49 AND camRun.state IN ('full', 'cleaned', 'goto_cleaned') 50 50 AND (camRun.magicked > 0 OR publishClient.magicked = 0) 51 51 -- WHERE hook %s -
branches/czw_branch/20100519/ippTools/src/pstamptool.c
r28334 r28338 870 870 871 871 PXOPT_LOOKUP_S64(job_id, config->args, "-job_id", false, false); 872 PXOPT_LOOKUP_S64(req_id, config->args, "-req_id", false, false); 872 873 PXOPT_LOOKUP_S64(dep_id, config->args, "-dep_id", false, false); 873 874 874 if (!job_id && ! dep_id) {875 psError(PS_ERR_UNKNOWN, true, "at least -job_id or -dep_id is required");875 if (!job_id && !req_id && !dep_id) { 876 psError(PS_ERR_UNKNOWN, true, "at least one of -job_id -req_id or -dep_id is required"); 876 877 return false; 877 878 } … … 888 889 889 890 PXOPT_COPY_S64(config->args, where, "-job_id", "job_id", "=="); 891 PXOPT_COPY_S64(config->args, where, "-req_id", "req_id", "=="); 890 892 PXOPT_COPY_S64(config->args, where, "-dep_id", "dep_id", "=="); 893 PXOPT_COPY_STR(config->args, where, "-state", "pstampJob.state", "=="); 891 894 892 895 psString query = pxDataGet("pstamptool_updatejob.sql"); -
branches/czw_branch/20100519/ippTools/src/pstamptoolConfig.c
r28334 r28338 160 160 // -updatejob 161 161 psMetadata *updatejobArgs = psMetadataAlloc(); 162 psMetadataAddS64(updatejobArgs, PS_LIST_TAIL, "-job_id", 0, "req_id for which to change state", 0); 163 psMetadataAddS64(updatejobArgs, PS_LIST_TAIL, "-dep_id", 0, "dep_id for which to change state", 0); 162 psMetadataAddS64(updatejobArgs, PS_LIST_TAIL, "-req_id", 0, "req_id of jobs to update", 0); 163 psMetadataAddS64(updatejobArgs, PS_LIST_TAIL, "-job_id", 0, "job_id of jobs to update", 0); 164 psMetadataAddS64(updatejobArgs, PS_LIST_TAIL, "-dep_id", 0, "dep_id of jobs to update", 0); 165 psMetadataAddStr(updatejobArgs, PS_LIST_TAIL, "-state", 0, "current state of jobs to update", 0); 164 166 psMetadataAddStr(updatejobArgs, PS_LIST_TAIL, "-set_state", 0, "new state", NULL); 165 167 psMetadataAddS16(updatejobArgs, PS_LIST_TAIL, "-set_fault", 0, "new result", 0); -
branches/czw_branch/20100519/ippTools/src/pubtool.c
r27071 r28338 151 151 PS_ASSERT_PTR_NON_NULL(config, false); 152 152 153 psMetadata *where = psMetadataAlloc(); // WHERE conditions 153 psMetadata *diffWhere = psMetadataAlloc(); // WHERE conditions for diffs 154 psMetadata *camWhere = psMetadataAlloc(); // WHERE conditions for cams 154 155 155 156 // required 156 157 157 158 // optional 158 PXOPT_COPY_S64(config->args, where, "-client_id", "client_id", "=="); 159 pxAddLabelSearchArgs(config, where, "-label", "label", "=="); // define using newExp label 159 PXOPT_COPY_S64(config->args, diffWhere, "-client_id", "client_id", "=="); 160 pxAddLabelSearchArgs(config, diffWhere, "-label", "diffRun.label", "=="); 161 pxAddLabelSearchArgs(config, diffWhere, "-data_group", "diffRun.data_group", "LIKE"); 162 PXOPT_COPY_TIME(config->args, diffWhere, "-dateobs_begin", "rawExp.dateobs", ">="); 163 PXOPT_COPY_TIME(config->args, diffWhere, "-dateobs_end", "rawExp.dateobs", "<="); 164 PXOPT_COPY_STR(config->args, diffWhere, "-filter", "rawExp.filter", "LIKE"); 165 PXOPT_COPY_STR(config->args, diffWhere, "-obs_mode", "rawExp.obs_mode", "LIKE"); 166 167 PXOPT_COPY_S64(config->args, camWhere, "-client_id", "client_id", "=="); 168 pxAddLabelSearchArgs(config, camWhere, "-label", "camRun.label", "=="); 169 pxAddLabelSearchArgs(config, camWhere, "-data_group", "camRun.data_group", "LIKE"); 170 PXOPT_COPY_TIME(config->args, camWhere, "-dateobs_begin", "rawExp.dateobs", ">="); 171 PXOPT_COPY_TIME(config->args, camWhere, "-dateobs_end", "rawExp.dateobs", "<="); 172 PXOPT_COPY_STR(config->args, camWhere, "-filter", "rawExp.filter", "LIKE"); 173 PXOPT_COPY_STR(config->args, camWhere, "-obs_mode", "rawExp.obs_mode", "LIKE"); 174 175 PXOPT_LOOKUP_BOOL(rerun, config->args, "-rerun", false); 176 PXOPT_LOOKUP_BOOL(pretend, config->args, "-pretend", false); 177 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 178 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 160 179 161 180 psString query = pxDataGet("pubtool_definerun.sql"); // Query to run 162 181 if (!query) { 163 182 psError(PXTOOLS_ERR_SYS, false, "Failed to retreive SQL statement"); 164 psFree(where); 165 return false; 183 psFree(diffWhere); 184 psFree(camWhere); 185 return false; 186 } 187 188 if (!rerun) { 189 psStringAppend(&query, "\nWHERE publishRun.client_id IS NULL"); 190 } 191 192 if (limit) { 193 psString limitString = psDBGenerateLimitSQL(limit); 194 psStringAppend(&query, "\n%s", limitString); 195 psFree(limitString); 166 196 } 167 197 168 198 if (!psDBTransaction(config->dbh)) { 169 199 psError(PS_ERR_UNKNOWN, false, "Database error"); 170 psFree(where); 171 return false; 172 } 173 174 psString whereClause = psStringCopy(""); // Additional constraints to add to query 175 if (psListLength(where->list)) { 176 psString clause = psDBGenerateWhereConditionSQL(where, NULL); 177 psStringAppend(&whereClause, "\n AND %s", clause); 200 psFree(diffWhere); 201 psFree(camWhere); 202 return false; 203 } 204 205 psString whereDiff = psStringCopy(""); // Additional constraints to add to query 206 if (psListLength(diffWhere->list)) { 207 psString clause = psDBGenerateWhereConditionSQL(diffWhere, NULL); 208 psStringAppend(&whereDiff, "\n AND %s", clause); 178 209 psFree(clause); 179 210 } 180 psFree(where); 181 182 if (!p_psDBRunQueryF(config->dbh, query, whereClause, whereClause)) { 211 psFree(diffWhere); 212 213 psString whereCam = psStringCopy(""); // Additional constraints to add to query 214 if (psListLength(camWhere->list)) { 215 psString clause = psDBGenerateWhereConditionSQL(camWhere, NULL); 216 psStringAppend(&whereCam, "\n AND %s", clause); 217 psFree(clause); 218 } 219 psFree(camWhere); 220 221 if (!p_psDBRunQueryF(config->dbh, query, whereDiff, whereCam)) { 183 222 psError(PS_ERR_UNKNOWN, false, "Database error"); 184 223 psFree(query); 185 psFree(whereClause); 224 psFree(whereDiff); 225 psFree(whereCam); 186 226 if (!psDBRollback(config->dbh)) { 187 227 psError(PS_ERR_UNKNOWN, false, "Database error"); … … 190 230 } 191 231 psFree(query); 192 psFree(whereClause); 232 psFree(whereDiff); 233 psFree(whereCam); 193 234 194 235 psArray *output = p_psDBFetchResult(config->dbh); // Output of SELECT statement … … 202 243 if (!psArrayLength(output)) { 203 244 psTrace("pubtool", PS_LOG_INFO, "No rows found"); 245 psFree(output); 246 return true; 247 } 248 249 if (pretend) { 250 if (!ippdbPrintMetadatas(stdout, output, "publishRun", !simple)) { 251 psError(psErrorCodeLast(), false, "Failed to print array"); 252 psFree(output); 253 return false; 254 } 204 255 psFree(output); 205 256 return true; … … 241 292 PXOPT_COPY_STR(config->args, where, "-stage", "publishClient.stage", "=="); 242 293 PXOPT_COPY_STR(config->args, where, "-comment", "publishClient.comment", "LIKE"); 243 PXOPT_COPY_STR(config->args, where, "-label", "publishRun.label", "==");294 pxAddLabelSearchArgs(config, where, "-label", "label", "=="); 244 295 245 296 // optional -
branches/czw_branch/20100519/ippTools/src/pubtoolConfig.c
r27311 r28338 64 64 psMetadataAddS64(definerunArgs, PS_LIST_TAIL, "-client_id", 0, "search by client_id", 0); 65 65 psMetadataAddStr(definerunArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "set and search by label", NULL); 66 psMetadataAddStr(definerunArgs, PS_LIST_TAIL, "-data_group", PS_META_DUPLICATE_OK, "search by data_group", NULL); 67 psMetadataAddTime(definerunArgs, PS_LIST_TAIL, "-dateobs_begin", 0, "search for exposures by time (>=)", NULL); 68 psMetadataAddTime(definerunArgs, PS_LIST_TAIL, "-dateobs_end", 0, "search for exposures by time (<=)", NULL); 69 psMetadataAddStr(definerunArgs, PS_LIST_TAIL, "-filter", 0, "search for filter", NULL); 70 psMetadataAddStr(definerunArgs, PS_LIST_TAIL, "-obs_mode", 0, "search by observation mode", NULL); 71 psMetadataAddBool(definerunArgs, PS_LIST_TAIL, "-rerun", 0, "Re-run publish?", false); 72 psMetadataAddBool(definerunArgs, PS_LIST_TAIL, "-pretend", 0, "Pretend to define?", false); 73 psMetadataAddBool(definerunArgs, PS_LIST_TAIL, "-simple", 0, "use simple output format?", false); 74 psMetadataAddU64(definerunArgs, PS_LIST_TAIL, "-limit", 0, "limit result set", 0); 66 75 67 76 // -pending … … 70 79 psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-stage", 0, "search on source", NULL); 71 80 psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-comment", 0, "search on comment (LIKE)", NULL); 72 psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-label", 0, "search on label", NULL);81 psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search on label", NULL); 73 82 psMetadataAddBool(pendingArgs, PS_LIST_TAIL, "-simple", 0, "use simple output format?", false); 74 83 psMetadataAddU64(pendingArgs, PS_LIST_TAIL, "-limit", 0, "limit result set", 0); -
branches/czw_branch/20100519/ippTools/src/pxtools.c
r28304 r28338 250 250 psMetadataItem *item = NULL; 251 251 while ((item = psListGetAndIncrement(iter))) { 252 psMetadataItem *new = psMetadataItemCopy(item); 252 253 // need to change the name and comment 253 psFree ( item->name);254 item->name = psStringCopy (field);255 psFree ( item->comment);256 item->comment = psStringCopy (op);257 if (!psMetadataAddItem(where, item, PS_LIST_TAIL, PS_META_DUPLICATE_OK)) {254 psFree (new->name); 255 new->name = psStringCopy (field); 256 psFree (new->comment); 257 new->comment = psStringCopy (op); 258 if (!psMetadataAddItem(where, new, PS_LIST_TAIL, PS_META_DUPLICATE_OK)) { 258 259 psError(psErrorCodeLast(), false, "failed to add item %s", field); 259 260 psFree(where); … … 261 262 } 262 263 } 263 psFree (iter);264 psFree(iter); 264 265 } 265 266 return true; -
branches/czw_branch/20100519/ippconfig/recipes/nightly_science.config
r28304 r28338 121 121 # COMMENT STR Stellar Transit% 122 122 STACKABLE BOOL FALSE 123 NOCLEAN BOOL TRUE 123 124 END 124 125 TARGETS METADATA -
branches/czw_branch/20100519/magic/remove/src/streaksio.c
r27474 r28338 1294 1294 } 1295 1295 } 1296 sfiles->maskMask = ~convPoor; 1296 // preserve pixels that are only suspect 1297 psU32 suspect = (double) psMetadataLookupU32(&status, masks, "SUSPECT"); 1298 if (!status) { 1299 psError(PM_ERR_CONFIG, false, "failed to lookup mask value for SUSPECT in recipes\n"); 1300 streaksExit("", PS_EXIT_CONFIG_ERROR); 1301 } 1302 1303 sfiles->maskMask = ~(convPoor | suspect); 1297 1304 } 1298 1305 -
branches/czw_branch/20100519/psModules/src/imcombine/pmPSFEnvelope.c
r27331 r28338 33 33 34 34 35 // #define TESTING // Enable test output35 //#define TESTING // Enable test output 36 36 // #define PEAK_NORM // Normalise peaks? 37 37 #define PEAK_FLUX 1.0e4 // Peak flux for each source … … 235 235 236 236 // Get the radius 237 pmModel *model = pmModelFromPSFforXY(psf, x, y, PEAK_FLUX); // Model for source237 pmModel *model = pmModelFromPSFforXY(psf, source->peak->xf, source->peak->yf, PEAK_FLUX); // Model for source 238 238 if (!model || (model->flags & MODEL_MASK)) { 239 239 continue; … … 321 321 numFakes = fakes->n; 322 322 323 if (numFakes == 0 .0) {323 if (numFakes == 0) { 324 324 psError(PS_ERR_UNKNOWN, false, "No fake sources are suitable for PSF fitting."); 325 325 psFree(fakes); -
branches/czw_branch/20100519/pstamp/src/ppstampMakeStamp.c
r27989 r28338 688 688 } 689 689 } 690 psU32 maskMask = ~convPoor; 690 psU32 suspect = psMetadataLookupU32(&status, masks, "SUSPECT"); 691 if (!status) { 692 psError(PM_ERR_CONFIG, false, "failed to lookup mask value for SUSPECT in recipes\n"); 693 return false; 694 } 695 psU32 maskMask = ~(convPoor | suspect); 691 696 692 697 double exciseValue;
Note:
See TracChangeset
for help on using the changeset viewer.
