Changeset 27883
- Timestamp:
- May 8, 2010, 10:16:06 AM (16 years ago)
- Location:
- branches/eam_branches/psphot.20100506/src
- Files:
-
- 1 added
- 8 edited
-
Makefile.am (modified) (1 diff)
-
psphot.h (modified) (3 diffs)
-
psphotStackArguments.c (modified) (1 diff)
-
psphotStackMatchPSFs.c (modified) (1 diff)
-
psphotStackMatchPSFsPrepare.c (modified) (5 diffs)
-
psphotStackMatchPSFsUtils.c (modified) (2 diffs)
-
psphotStackOptions.c (modified) (2 diffs)
-
psphotStackPSF.c (added)
-
psphotStackParseCamera.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/psphot.20100506/src/Makefile.am
r27876 r27883 95 95 psphotFitSourcesLinearStack.c \ 96 96 psphotSourceMatch.c \ 97 psphotStackMatchPSFs.c \ 98 psphotStackMatchPSFsUtils.c \ 97 psphotStackMatchPSFs.c \ 98 psphotStackMatchPSFsUtils.c \ 99 psphotStackMatchPSFsPrepare.c \ 100 psphotStackOptions.c \ 101 psphotStackPSF.c \ 99 102 psphotCleanup.c 100 103 -
branches/eam_branches/psphot.20100506/src/psphot.h
r27876 r27883 367 367 int pmPhotObjSortByX (const void **a, const void **b); 368 368 369 typedef enum { 370 PSPHOT_CNV_SRC_NONE, 371 PSPHOT_CNV_SRC_AUTO, 372 PSPHOT_CNV_SRC_CNV, 373 PSPHOT_CNV_SRC_RAW, 374 } psphotStackConvolveSource; 375 369 376 /// Options for stacking process 370 377 typedef struct { 371 378 // Setup 372 379 380 int numCols; // size of image (X) 381 int numRows; // size of image (Y) 382 373 383 int num; // Number of inputs 374 384 bool convolve; // Convolve images? 385 psphotStackConvolveSource convolveSource; 375 386 // psArray *convImages, *convMasks, *convVariances; // Filenames for the temporary convolved images 376 387 … … 420 431 bool psphotStackMatchPSFs (pmConfig *config, const pmFPAview *view); 421 432 bool psphotStackMatchPSFsReadout (pmConfig *config, const pmFPAview *view, psphotStackOptions *options, int index); 433 bool psphotStackMatchPSFsPrepare (pmConfig *config, const pmFPAview *view, psphotStackOptions *options, int index); 422 434 423 435 // psphotStackMatchPSFsUtils … … 437 449 bool readImage(psImage **target, const char *name, const pmConfig *config); 438 450 451 pmPSF *psphotStackPSF(const pmConfig *config, int numCols, int numRows, const psArray *psfs, const psVector *inputMask); 452 453 psphotStackOptions *psphotStackOptionsAlloc (int num); 454 psphotStackConvolveSource psphotStackConvolveSourceFromString (const char *string); 455 439 456 #endif -
branches/eam_branches/psphot.20100506/src/psphotStackArguments.c
r27876 r27883 1 1 # include "psphotStandAlone.h" 2 2 3 static void dumpTemplate(void); 3 4 static void usage(pmConfig *config, int exitCode); 4 5 static void writeHelpInfo(FILE* ofile); -
branches/eam_branches/psphot.20100506/src/psphotStackMatchPSFs.c
r27876 r27883 36 36 // Generate target PSF 37 37 if (options->convolve) { 38 options->psf = p pStackPSF(config, options->numCols, options->numRows, options->psfs, options->inputMask);38 options->psf = psphotStackPSF(config, options->numCols, options->numRows, options->psfs, options->inputMask); 39 39 if (!options->psf) { 40 40 psError(psErrorCodeLast(), false, "Unable to determine output PSF."); -
branches/eam_branches/psphot.20100506/src/psphotStackMatchPSFsPrepare.c
r27876 r27883 18 18 19 19 switch (options->convolveSource) { 20 case AUTO:20 case PSPHOT_CNV_SRC_AUTO: 21 21 fileSrc = fileCnv ? fileCnv : fileRaw; 22 22 break; 23 23 24 case RAW:24 case PSPHOT_CNV_SRC_RAW: 25 25 fileSrc = fileRaw; 26 26 break; 27 27 28 case CNV:28 case PSPHOT_CNV_SRC_CNV: 29 29 fileSrc = fileCnv; 30 30 break; … … 34 34 } 35 35 if (!fileSrc) { 36 psError(PSPHOT_ERR_CONFIG, "desired convolution source is missing (cnv : %llx, raw : %llx)", (long long) fileCnv, (long long) fileRaw);36 psError(PSPHOT_ERR_CONFIG, true, "desired convolution source is missing (cnv : %llx, raw : %llx)", (long long) fileCnv, (long long) fileRaw); 37 37 return false; 38 38 } … … 44 44 if (!psf) { 45 45 // XXX if we were not supplied a PSF, we should be able to generate one by calling psphot 46 psError(P PSTACK_ERR_PROG, false, "Unable to find PSF.");46 psError(PSPHOT_ERR_PROG, false, "Unable to find PSF."); 47 47 return false; 48 48 } … … 78 78 pmFPAfile *outputImage = pmFPAfileDefineOutput(config, NULL, "PSPHOT.STACK.OUTPUT.IMAGE"); 79 79 pmReadout *readout = pmFPAviewThisReadout(view, outputImage->fpa); // Readout with sources 80 detections = psMetadataLookupPtr(NULL, readout->analysis, "PSPHOT.DETECTIONS"); // Sources80 pmDetections *detections = psMetadataLookupPtr(NULL, readout->analysis, "PSPHOT.DETECTIONS"); // Sources 81 81 if (!detections || !detections->allSources) { 82 psWarning("No detections found for image %d --- rejecting.", i );83 options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i ] = PPSTACK_MASK_CAL;84 continue;82 psWarning("No detections found for image %d --- rejecting.", index); 83 options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[index] = 0x01; 84 return true; // XXX not an error: we continue processing other images 85 85 } 86 86 psAssert (detections->allSources, "missing sources?"); 87 options->sourceLists->data[i ] = psMemIncrRefCounter(detections->allSources);87 options->sourceLists->data[index] = psMemIncrRefCounter(detections->allSources); 88 88 } 89 89 … … 108 108 if (numFWHM == 0) { 109 109 options->inputSeeing->data.F32[index] = NAN; 110 options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[index] = PPSTACK_MASK_PSF;110 options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[index] = 0x02; 111 111 psLogMsg("ppStack", PS_LOG_INFO, "Unable to measure PSF FWHM for image %d --- rejected.", index); 112 112 } else { -
branches/eam_branches/psphot.20100506/src/psphotStackMatchPSFsUtils.c
r27876 r27883 180 180 // It implicitly assumes the output root name is the same between invocations. 181 181 182 # if (0) 182 183 bool loadKernel (pmConfig *config, pmReadout *readoutCnv, psphotStackOptions *options, int index) { 183 184 … … 228 229 return true; 229 230 } 231 # endif 230 232 231 233 bool dumpImage(pmReadout *readoutOut, pmReadout *readoutRef, int index, char *rootname) { -
branches/eam_branches/psphot.20100506/src/psphotStackOptions.c
r27876 r27883 1 1 # include "psphotInternal.h" 2 3 typedef enum {4 PSPHOT_CNV_SRC_NONE,5 PSPHOT_CNV_SRC_AUTO,6 PSPHOT_CNV_SRC_CNV,7 PSPHOT_CNV_SRC_RAW,8 } psphotStackConvolveSource;9 2 10 3 static void psphotStackOptionsFree (psphotStackOptions *options) { … … 35 28 options->psf = NULL; 36 29 options->convolve = false; 30 options->convolveSource = PSPHOT_CNV_SRC_NONE; 37 31 38 32 options->psfs = psArrayAlloc(num); -
branches/eam_branches/psphot.20100506/src/psphotStackParseCamera.c
r27876 r27883 113 113 } 114 114 outputImage->save = true; 115 out sources->fileID = i; // this is used to generate output names115 outputImage->fileID = i; // this is used to generate output names 116 116 117 117 pmFPAfile *outputMask = pmFPAfileDefineOutput(config, outputImage->fpa, "PSPHOT.STACK.OUTPUT.MASK");
Note:
See TracChangeset
for help on using the changeset viewer.
