Changeset 24244 for branches/cnb_branches/cnb_branch_20090301/pswarp/src
- Timestamp:
- May 26, 2009, 1:59:32 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 1 deleted
- 9 edited
- 2 copied
-
. (modified) (1 prop)
-
pswarp/src (modified) (1 prop)
-
pswarp/src/Makefile.am (modified) (2 diffs)
-
pswarp/src/pswarp.h (modified) (1 diff)
-
pswarp/src/pswarpArguments.c (modified) (3 diffs)
-
pswarp/src/pswarpErrorCodes.dat (modified) (2 diffs)
-
pswarp/src/pswarpErrorCodes.h.in (modified) (1 diff)
-
pswarp/src/pswarpLoop.c (modified) (7 diffs)
-
pswarp/src/pswarpPixelFraction.c (deleted)
-
pswarp/src/pswarpPixelsLit.c (copied) (copied from trunk/pswarp/src/pswarpPixelsLit.c )
-
pswarp/src/pswarpVersion.c (modified) (2 diffs)
-
pswarp/src/pswarpVersionDefinitions.h.in (copied) (copied from trunk/pswarp/src/pswarpVersionDefinitions.h.in )
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
- Property svn:mergeinfo changed
-
branches/cnb_branches/cnb_branch_20090301/pswarp/src
- Property svn:ignore
-
old new 13 13 config.h.in 14 14 stamp-h1 15 pswarpVersionDefinitions.h
-
- Property svn:ignore
-
branches/cnb_branches/cnb_branch_20090301/pswarp/src/Makefile.am
r23352 r24244 1 1 bin_PROGRAMS = pswarp 2 2 3 PSWARP_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 4 PSWARP_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi` 5 PSWARP_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 3 if HAVE_SVNVERSION 4 PSWARP_VERSION=`$(SVNVERSION) ..` 5 else 6 PSWARP_VERSION="UNKNOWN" 7 endif 8 9 if HAVE_SVN 10 PSWARP_BRANCH=`$(SVN) info .. | $(SED) -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'` 11 PSWARP_SOURCE=`$(SVN) info | $(SED) -n -e 's/Repository UUID: // p'` 12 else 13 PSWARP_BRANCH="UNKNOWN" 14 PSWARP_SOURCE="UNKNOWN" 15 endif 6 16 7 17 # Force recompilation of pswarpVersion.c, since it gets the version information 8 pswarpVersion.c: FORCE 9 touch pswarpVersion.c 18 pswarpVersion.c: pswarpVersionDefinitions.h 19 pswarpVersionDefinitions.h: pswarpVersionDefinitions.h.in FORCE 20 -$(RM) pswarpVersionDefinitions.h 21 $(SED) -e "s|@PSWARP_VERSION@|\"$(PSWARP_VERSION)\"|" -e "s|@PSWARP_BRANCH@|\"$(PSWARP_BRANCH)\"|" -e "s|@PSWARP_SOURCE@|\"$(PSWARP_SOURCE)\"|" pswarpVersionDefinitions.h.in > pswarpVersionDefinitions.h 10 22 FORCE: ; 11 23 12 pswarp_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PPSTATS_CFLAGS) $(PSPHOT_CFLAGS) $(PSWARP_CFLAGS) -DPSWARP_VERSION=\"$(PSWARP_VERSION)\" -DPSWARP_BRANCH=\"$(PSWARP_BRANCH)\" -DPSWARP_SOURCE=\"$(PSWARP_SOURCE)\"24 pswarp_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PPSTATS_CFLAGS) $(PSPHOT_CFLAGS) $(PSWARP_CFLAGS) 13 25 pswarp_LDFLAGS = $(PSLIB_LIBS) $(PSMODULE_LIBS) $(PPSTATS_LIBS) $(PSPHOT_LIBS) $(PSWARP_LIBS) 14 26 … … 24 36 pswarpMatchRange.c \ 25 37 pswarpParseCamera.c \ 26 pswarpPixel Fraction.c \38 pswarpPixelsLit.c \ 27 39 pswarpSetMaskBits.c \ 28 40 pswarpSetThreads.c \ -
branches/cnb_branches/cnb_branch_20090301/pswarp/src/pswarp.h
r23594 r24244 102 102 const char *filename, const char *argname); 103 103 104 /// Check to see if the readout has a minimum fraction of "lit"pixels105 bool pswarpPixel Fraction(const pmReadout *readout, ///< Readout to inspect106 psMetadata *stats, ///< Statistics to update with the result107 const pmConfig *config ///< Configuration104 /// Get the range of lit pixels 105 bool pswarpPixelsLit(const pmReadout *readout, ///< Readout to inspect 106 psMetadata *stats, ///< Statistics to update with the result 107 const pmConfig *config ///< Configuration 108 108 ); 109 109 -
branches/cnb_branches/cnb_branch_20090301/pswarp/src/pswarpArguments.c
r23352 r24244 163 163 } 164 164 165 float acceptFrac = psMetadataLookupF32(&status, recipe, "ACCEPT.FRAC"); ///< Min fraction of good pixels166 if (!status) {167 acceptFrac = 0.0;168 psWarning("ACCEPT.FRAC is not set in the %s recipe --- defaulting to %f.", PSWARP_RECIPE, poorFrac);169 }170 171 165 // Set recipe values in the recipe (since we've possibly altered some) 172 166 psMetadataAddS32(recipe, PS_LIST_TAIL, "GRID.NX", PS_META_REPLACE, … … 180 174 psMetadataAddF32(recipe, PS_LIST_TAIL, "POOR.FRAC", PS_META_REPLACE, 181 175 "Fraction of bad flux for a pixel to be marked as poor", poorFrac); 182 psMetadataAddF32(recipe, PS_LIST_TAIL, "ACCEPT.FRAC", PS_META_REPLACE,183 "Minimum fraction of good pixels for result to be accepted", acceptFrac);184 176 185 177 // Set recipe values in the arguments … … 194 186 psMetadataAddF32(config->arguments, PS_LIST_TAIL, "POOR.FRAC", 0, 195 187 "Fraction of bad flux for a pixel to be marked as poor", poorFrac); 196 psMetadataAddF32(config->arguments, PS_LIST_TAIL, "ACCEPT.FRAC", 0,197 "Minimum fraction of good pixels for result to be accepted", acceptFrac);198 188 199 189 psTrace("pswarp", 1, "Done with pswarpArguments...\n"); -
branches/cnb_branches/cnb_branch_20090301/pswarp/src/pswarpErrorCodes.dat
r11268 r24244 2 2 # This file is used to generate pswarpErrorClasses.h 3 3 # 4 BASE = 800 First value we use; lower values belong to psLib5 UNKNOWN Unknown P Merror code4 BASE = 8000 First value we use; lower values belong to psLib 5 UNKNOWN Unknown PSWARP error code 6 6 NOT_IMPLEMENTED Desired feature is not yet implemented 7 7 ARGUMENTS Incorrect arguments … … 9 9 IO Problem in FITS I/O 10 10 DATA Problem in data values 11 NO_OVERLAP No overlap between input and skycell -
branches/cnb_branches/cnb_branch_20090301/pswarp/src/pswarpErrorCodes.h.in
r21323 r24244 21 21 */ 22 22 typedef enum { 23 PSWARP_ERR_BASE = 600,23 PSWARP_ERR_BASE = 8000, 24 24 PSWARP_ERR_${ErrorCode}, 25 25 PSWARP_ERR_NERROR -
branches/cnb_branches/cnb_branch_20090301/pswarp/src/pswarpLoop.c
r23352 r24244 142 142 psFree(resolved); 143 143 stats = psMetadataAlloc(); 144 psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", 0, "No problems", 0); 144 145 } 145 146 … … 273 274 } 274 275 276 if (!output->data_exists) { 277 psWarning("No overlap between input and skycell."); 278 if (stats) { 279 psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE, 280 "No overlap between input and skycell", PSWARP_ERR_NO_OVERLAP); 281 } 282 psphotFilesActivate(config, false); 283 psFree(cells); 284 psFree(view); 285 goto DONE; 286 } 287 275 288 pmCell *outCell = output->parent; ///< Output cell 276 289 pmChip *outChip = outCell->parent; ///< Output chip 277 290 pmFPA *outFPA = outChip->parent; ///< Output FP 278 291 279 if (!pswarpPixelFraction(output, stats, config)) { 280 // Don't write output images, and don't bother about anything else 281 output->data_exists = outCell->data_exists = outChip->data_exists = false; 292 if (!pswarpPixelsLit(output, stats, config)) { 293 psError(PS_ERR_UNKNOWN, false, "Unable to calculate pixel regions."); 282 294 psFree(cells); 283 295 psFree(view); 284 goto COMPLETED;296 return false; 285 297 } 286 298 287 299 // Set variance factor 288 300 { 289 float varFactor = psMetadataLookupF32(NULL, output->analysis, PSWARP_ANALYSIS_VARFACTOR); 290 psAssert(isfinite(varFactor), "Should be something here."); 291 long goodPix = psMetadataLookupS64(NULL, output->analysis, PSWARP_ANALYSIS_GOODPIX); 292 psAssert(goodPix > 0, "Should be something here."); 301 bool mdok; // Status of MD lookup 302 float varFactor = psMetadataLookupF32(&mdok, output->analysis, PSWARP_ANALYSIS_VARFACTOR); 303 long goodPix = psMetadataLookupS64(&mdok, output->analysis, PSWARP_ANALYSIS_GOODPIX); 293 304 varFactor /= goodPix; 294 305 … … 364 375 fileActivation(config, independentFiles, false); 365 376 366 // We need a new PSF model for the warped frame. It would be good to generate this analytically, but that's going to be tricky.367 // We have a list of sources, so we use those to redetermine the PSF model.377 // We need a new PSF model for the warped frame. It would be good to generate this analytically, but 378 // that's going to be tricky. We have a list of sources, so we use those to redetermine the PSF model. 368 379 369 380 if (psMetadataLookupBool(&mdok, config->arguments, "PSF")) { … … 394 405 // measure the PSF using these sources 395 406 if (!psphotReadoutFindPSF(config, view, sources)) { 396 psError(PS_ERR_UNKNOWN, false, "Unable to determine PSF for warped image."); 397 return false; 407 // This is likely a data quality issue 408 // XXX Split into multiple cases using error codes? 409 psErrorStackPrint(stderr, "Unable to determine PSF"); 410 psWarning("Unable to determine PSF --- suspect bad data quality."); 411 if (stats && psMetadataLookupS32(NULL, stats, "QUALITY") == 0) { 412 psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE, 413 "Unable to determine PSF", psErrorCodeLast()); 414 } 415 psErrorClear(); 416 psphotFilesActivate(config, false); 398 417 } 399 418 … … 448 467 // Now done with the skycell side of things 449 468 450 COMPLETED: 469 DONE: 470 451 471 // Write out summary statistics 452 472 if (stats) { … … 464 484 psFree((void*)statsMDC); 465 485 fclose(statsFile); 486 pmConfigRunFilenameAddWrite(config, "STATS", statsName); 466 487 467 488 psFree(stats); … … 471 492 psString dump_file = psMetadataLookupStr(&status, config->arguments, "DUMP_CONFIG"); 472 493 if (dump_file) { 473 pmFPAfile *input = psMetadataLookupPtr(NULL, config->files, "PSWARP.INPUT"); // Input file 474 pmConfigDump(config, input->fpa, dump_file); 494 pmConfigDump(config, dump_file); 475 495 } 476 496 -
branches/cnb_branches/cnb_branch_20090301/pswarp/src/pswarpVersion.c
r24243 r24244 20 20 #include <ppStats.h> 21 21 22 psString pswarpVersion(void) 23 { 22 #include "pswarp.h" 23 #include "pswarpVersionDefinitions.h" 24 24 25 #ifndef PSWARP_VERSION 25 26 #error "PSWARP_VERSION is not set" … … 28 29 #error "PSWARP_BRANCH is not set" 29 30 #endif 30 return psStringCopy(PSWARP_BRANCH "@" PSWARP_VERSION); 31 #ifndef PSWARP_SOURCE 32 #error "PSWARP_SOURCE is not set" 33 #endif 34 35 psString pswarpVersion(void) 36 { 37 char *value = NULL; 38 psStringAppend(&value, "%s@%s", PSWARP_BRANCH, PSWARP_VERSION); 39 return value; 31 40 } 32 41 33 42 psString pswarpSource(void) 34 43 { 35 #ifndef PSWARP_SOURCE36 #error "PSWARP_SOURCE is not set"37 #endif38 44 return psStringCopy(PSWARP_SOURCE); 39 45 }
Note:
See TracChangeset
for help on using the changeset viewer.
