Changeset 25299 for trunk/extsrc/gpcsw/gpcsrc/fits/burntool
- Timestamp:
- Sep 8, 2009, 5:32:55 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
-
. (modified) (1 prop)
-
extsrc/gpcsw/gpcsrc/fits/burntool/burnparams.h (modified) (1 diff)
-
extsrc/gpcsw/gpcsrc/fits/burntool/burntool.c (modified) (2 diffs)
-
extsrc/gpcsw/gpcsrc/fits/burntool/man/burntool.1 (modified) (3 diffs)
-
extsrc/gpcsw/gpcsrc/fits/burntool/persist_fits.c (modified) (6 diffs)
-
extsrc/gpcsw/gpcsrc/fits/burntool/persistio.c (modified) (4 diffs)
-
extsrc/gpcsw/gpcsrc/fits/burntool/trailfit.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/czw_branch/cleanup (added) merged: 25050-25051,25088,25143-25155,25157-25159,25161,25210-25212
- Property svn:mergeinfo changed
-
trunk/extsrc/gpcsw/gpcsrc/fits/burntool/burnparams.h
r23924 r25299 55 55 EXTERN int EXPIRE_TRAIL_TIME; /* Expire trails after this interval */ 56 56 57 EXTERN int PERSIST_RETAIN; /* Retain bad-slope persistence fits */ 58 57 59 #endif /* _INCLUDED_burnparams_ */ -
trunk/extsrc/gpcsw/gpcsrc/fits/burntool/burntool.c
r24391 r25299 100 100 EXPIRE_TRAIL_TIME = 2000; /* Expire a persist after this [sec] */ 101 101 102 PERSIST_RETAIN = 0; /* Retain persists with bad slopes? */ 103 102 104 /* Parse the args */ 103 105 cellxy = -1; … … 174 176 } else if(strncmp(argv[i], "infits=", 7) == 0) { /* infits=fname */ 175 177 persistfitsfile = argv[i] + 7; 178 179 /* Keep persistence streaks which had a bad slope? */ 180 } else if(strncmp(argv[i], "persist=", 8) == 0) {/* persist={t|f} */ 181 PERSIST_RETAIN = argv[i][8] == 'y' || argv[i][8] == '1' || argv[i][8] == 't'; 176 182 177 183 /* Output file for PSF gallery */ -
trunk/extsrc/gpcsw/gpcsrc/fits/burntool/man/burntool.1
r24391 r25299 53 53 power laws; downward burns as exponentials. 54 54 55 The fit to downward, persistence burns may have an unreasonable "slope" 56 (meaning exponential sign), increasing away from the burn origin. 57 These are discarded unless "persist=t" is invoked. It is possible 58 for the fit to be fooled by uncataloged stars, so the persistence 59 can be kept in the output file with "persist=t" (although no fit 60 correction is applied) and they will propagate from input to output 61 until they finally achieve a legal fit with negligible amplitude. 62 55 63 Burntool also identifies really blasted areas which are saturated from 56 64 top to bottom. These cannot be fitted, but are carried along for … … 231 239 'in' takes precedence. 232 240 241 persist={t|f} 242 Retain persistence streaks whose fit slope turned out to be 243 unreasonable. 244 233 245 out=fname 234 246 Output file for burn streaks … … 332 344 BUGS: 333 345 090224: Still in development 346 090810: Squished a few memory bugs 334 347 335 348 SEE ALSO: -
trunk/extsrc/gpcsw/gpcsrc/fits/burntool/persist_fits.c
r23924 r25299 222 222 for(k=0; k<cell[j].npersist; k++) 223 223 { 224 if(cell[j].persist[k].fiterr) continue; 225 if(cell[j].persist[k].nfit <= 0) continue; 224 if(PERSIST_RETAIN) { 225 /* Keep fits which have a dubious slope */ 226 if(cell[j].persist[k].fiterr != FIT_SLOPE_ERROR) { 227 if(cell[j].persist[k].fiterr) continue; 228 if(cell[j].persist[k].nfit <= 0) continue; 229 } 230 } else { 231 if(cell[j].persist[k].fiterr) continue; 232 if(cell[j].persist[k].nfit <= 0) continue; 233 } 226 234 num_areas++; 227 235 num_fits += cell[j].persist[k].nfit; … … 232 240 { 233 241 if(!cell[j].burn[k].burned) continue; 234 if(cell[j].burn[k].fiterr && 235 cell[j].burn[k].fiterr != FIT_TOP_ERROR) continue; 236 if(cell[j].burn[k].nfit <= 0) continue; 242 if(PERSIST_RETAIN) { 243 /* Keep fits which have a dubious slope */ 244 if(cell[j].burn[k].fiterr != FIT_SLOPE_ERROR) { 245 if(cell[j].burn[k].fiterr && 246 cell[j].burn[k].fiterr != FIT_TOP_ERROR) continue; 247 if(cell[j].burn[k].nfit <= 0) continue; 248 } 249 } else { 250 if(cell[j].burn[k].fiterr && 251 cell[j].burn[k].fiterr != FIT_TOP_ERROR) continue; 252 if(cell[j].burn[k].nfit <= 0) continue; 253 } 237 254 num_areas++; 238 255 num_fits += cell[j].burn[k].nfit; … … 329 346 for(k=0; k<cell[j].npersist; k++) 330 347 { 331 if(cell[j].persist[k].fiterr) continue; 332 if(cell[j].persist[k].nfit <= 0) continue; 348 if(PERSIST_RETAIN) { 349 /* Keep fits which have a dubious slope */ 350 if(cell[j].persist[k].fiterr != FIT_SLOPE_ERROR) { 351 if(cell[j].persist[k].fiterr) continue; 352 if(cell[j].persist[k].nfit <= 0) continue; 353 } 354 } else { 355 if(cell[j].persist[k].fiterr) continue; 356 if(cell[j].persist[k].nfit <= 0) continue; 357 } 333 358 334 359 result = write_area_row(hu, data, table, row++, &(cell[j].persist[k])); … … 340 365 { 341 366 if(!cell[j].burn[k].burned) continue; 342 if(cell[j].burn[k].fiterr && 343 cell[j].burn[k].fiterr != FIT_TOP_ERROR) continue; 344 if(cell[j].burn[k].nfit <= 0) continue; 367 if(PERSIST_RETAIN) { 368 /* Keep fits which have a dubious slope */ 369 if(cell[j].burn[k].fiterr != FIT_SLOPE_ERROR) { 370 if(cell[j].burn[k].fiterr && 371 cell[j].burn[k].fiterr != FIT_TOP_ERROR) continue; 372 if(cell[j].burn[k].nfit <= 0) continue; 373 } 374 } else { 375 if(cell[j].burn[k].fiterr && 376 cell[j].burn[k].fiterr != FIT_TOP_ERROR) continue; 377 if(cell[j].burn[k].nfit <= 0) continue; 378 } 345 379 346 380 result = write_area_row(hu, data, table, row++, &(cell[j].burn[k])); … … 426 460 for(k=0; k<cell[j].npersist; k++) 427 461 { 428 if(cell[j].persist[k].fiterr) continue; 462 if(PERSIST_RETAIN) { 463 /* Keep fits which have a dubious slope */ 464 if(cell[j].persist[k].fiterr != FIT_SLOPE_ERROR) { 465 if(cell[j].persist[k].fiterr) continue; 466 } 467 } else { 468 if(cell[j].persist[k].fiterr) continue; 469 } 429 470 for(i=0; i<cell[j].persist[k].nfit; i++) 430 471 { … … 441 482 { 442 483 if(!cell[j].burn[k].burned) continue; 443 if(cell[j].burn[k].fiterr && 444 cell[j].burn[k].fiterr != FIT_TOP_ERROR) continue; 484 if(PERSIST_RETAIN) { 485 /* Keep fits which have a dubious slope */ 486 if(cell[j].burn[k].fiterr != FIT_SLOPE_ERROR) { 487 if(cell[j].burn[k].fiterr && 488 cell[j].burn[k].fiterr != FIT_TOP_ERROR) continue; 489 } 490 } else { 491 if(cell[j].burn[k].fiterr && 492 cell[j].burn[k].fiterr != FIT_TOP_ERROR) continue; 493 } 445 494 446 495 for(i=0; i<cell[j].burn[k].nfit; i++) -
trunk/extsrc/gpcsw/gpcsrc/fits/burntool/persistio.c
r23924 r25299 51 51 &boxbuf[nbox].slope, &boxbuf[nbox].nfit, 52 52 &boxbuf[nbox].sxfit, &boxbuf[nbox].exfit); 53 if(boxbuf[nbox].nfit <= 0) continue; 54 boxbuf[nbox].zero = (double *)calloc(boxbuf[nbox].nfit, sizeof(double)); 55 boxbuf[nbox].xfit = (int *)calloc(boxbuf[nbox].nfit, sizeof(int)); 56 boxbuf[nbox].yfit = (int *)calloc(boxbuf[nbox].nfit, sizeof(int)); 57 for(i=0; i<boxbuf[nbox].nfit; i++) { 58 if(fgets(line, 1024, fp) == NULL) { 59 fprintf(stderr, "\rerror: short read of burn lines\n"); 60 return(-1); 61 } 62 sscanf(line, "%d %d %lf\n", &boxbuf[nbox].xfit[i], 63 &boxbuf[nbox].yfit[i], &boxbuf[nbox].zero[i]); 53 if(boxbuf[nbox].nfit > 0) { 54 boxbuf[nbox].zero = (double *)calloc(boxbuf[nbox].nfit, sizeof(double)); 55 boxbuf[nbox].xfit = (int *)calloc(boxbuf[nbox].nfit, sizeof(int)); 56 boxbuf[nbox].yfit = (int *)calloc(boxbuf[nbox].nfit, sizeof(int)); 57 for(i=0; i<boxbuf[nbox].nfit; i++) { 58 if(fgets(line, 1024, fp) == NULL) { 59 fprintf(stderr, "\rerror: short read of burn lines\n"); 60 return(-1); 61 } 62 sscanf(line, "%d %d %lf\n", &boxbuf[nbox].xfit[i], 63 &boxbuf[nbox].yfit[i], &boxbuf[nbox].zero[i]); 64 } 64 65 } 65 66 boxbuf[nbox].fiterr = 0; … … 147 148 for(kp=0; kp<n; kp++) { 148 149 k = boxid[kp]; 149 zk = box[k].zero[box[k].nfit/2]; 150 zk = 0.0; 151 if(box[k].nfit > 0) zk = box[k].zero[box[k].nfit/2]; 150 152 for(jp=kp+1; jp<n; jp++) { 151 153 j = boxid[jp]; 152 zj = box[j].zero[box[j].nfit/2]; 154 zj = 0.0; 155 if(box[j].nfit > 0) zj = box[j].zero[box[j].nfit/2]; 153 156 if(ABS(yctr[jp]-yctr[kp]) > DIFFERENT_STREAK) { 154 157 /* Trim back the feebler streak */ … … 238 241 /* First: patched up persists */ 239 242 for(k=0; k<cell[j].npersist; k++) { 240 if(cell[j].persist[k].fiterr) continue; 241 if(cell[j].persist[k].nfit <= 0) continue; 243 244 if(PERSIST_RETAIN) { 245 /* Keep fits which have a dubious slope */ 246 if(cell[j].persist[k].fiterr != FIT_SLOPE_ERROR) { 247 if(cell[j].persist[k].fiterr) continue; 248 if(cell[j].persist[k].nfit <= 0) continue; 249 } 250 } else { 251 if(cell[j].persist[k].fiterr) continue; 252 if(cell[j].persist[k].nfit <= 0) continue; 253 } 242 254 fprintf(fp, "%3d %7d %3d %3d %5d %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %1d %1d %9.6f %3d %3d %3d\n", 243 255 j, cell[j].persist[k].time, … … 262 274 for(k=0; k<cell[j].nburn; k++) { 263 275 if(!cell[j].burn[k].burned) continue; 264 if(cell[j].burn[k].fiterr && 265 cell[j].burn[k].fiterr != FIT_TOP_ERROR) continue; 266 if(cell[j].burn[k].nfit <= 0) continue; 276 if(PERSIST_RETAIN) { 277 /* Keep fits which have a dubious slope */ 278 if(cell[j].burn[k].fiterr != FIT_SLOPE_ERROR) { 279 if(cell[j].burn[k].fiterr && 280 cell[j].burn[k].fiterr != FIT_TOP_ERROR) continue; 281 if(cell[j].burn[k].nfit <= 0) continue; 282 } 283 } else { 284 if(cell[j].burn[k].fiterr && 285 cell[j].burn[k].fiterr != FIT_TOP_ERROR) continue; 286 if(cell[j].burn[k].nfit <= 0) continue; 287 } 267 288 268 289 i = (cell[j].burn[k].ex - cell[j].burn[k].sx + 1) / 2; -
trunk/extsrc/gpcsw/gpcsrc/fits/burntool/trailfit.c
r25070 r25299 226 226 /* FIXME: sanity check fits */ 227 227 if(slope >= FIT_MAX_SLOPE || slope < FIT_MIN_SLOPE) { 228 box->slope = slope; 229 box->nfit = 0; 228 230 box->fiterr = FIT_SLOPE_ERROR; 229 231 return(-1);
Note:
See TracChangeset
for help on using the changeset viewer.
