Changeset 33690 for trunk/psphot
- Timestamp:
- Apr 3, 2012, 5:46:39 PM (14 years ago)
- Location:
- trunk/psphot/src
- Files:
-
- 1 added
- 8 edited
-
Makefile.am (modified) (1 diff)
-
psphot.h (modified) (1 diff)
-
psphotArguments.c (modified) (1 diff)
-
psphotKronIterate.c (modified) (2 diffs)
-
psphotParseCamera.c (modified) (2 diffs)
-
psphotSetNFrames.c (added)
-
psphotStackArguments.c (modified) (1 diff)
-
psphotStackImageLoop.c (modified) (3 diffs)
-
psphotStackParseCamera.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/Makefile.am
r32633 r33690 206 206 psphotPetrosianStats.c \ 207 207 psphotPetrosianVisual.c \ 208 psphotEfficiency.c 208 psphotEfficiency.c \ 209 psphotSetNFrames.c 209 210 210 211 # re-instate these -
trunk/psphot/src/psphot.h
r32695 r33690 481 481 bool psphotStackObjectsSelectForAnalysis (pmConfig *config, const pmFPAview *view, const char *filerule, psArray *objects); 482 482 483 bool psphotSetNFrames (pmConfig *config, const pmFPAview *view, const char *filerule); 484 bool psphotSetNFramesReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int index); 485 483 486 #endif -
trunk/psphot/src/psphotArguments.c
r31154 r33690 217 217 pmConfigFileSetsMD (config->arguments, &argc, argv, "PSPHOT.PSF", "-psf", "-psflist"); 218 218 pmConfigFileSetsMD (config->arguments, &argc, argv, "SRC", "-src", "-srclist"); 219 pmConfigFileSetsMD (config->arguments, &argc, argv, "EXPNUM", "-expnum", "-expnumlist"); 219 220 220 221 if (argc == 1) { -
trunk/psphot/src/psphotKronIterate.c
r33089 r33690 150 150 if (!psphotKronIterate_Threaded(job)) { 151 151 psError(PS_ERR_UNKNOWN, false, "Unable to guess model."); 152 psFree(AnalysisRegion);152 // psFree(AnalysisRegion); 153 153 return false; 154 154 } … … 222 222 float windowRadius = PS_MAX(RADIUS, maxWindow); 223 223 224 #ifdef notdef 225 fprintf(stderr, "Redefining pixels for source: %d %4d %4d new radius: %f\n", 226 i, source->peak->x, source->peak->y, windowRadius+2); 227 #endif 224 228 // re-allocate image, weight, mask arrays for each peak with box big enough to fit BIG_RADIUS 225 229 pmSourceRedefinePixels (source, readout, source->peak->x, source->peak->y, windowRadius + 2); -
trunk/psphot/src/psphotParseCamera.c
r29936 r33690 2 2 3 3 // define the needed / desired I/O files 4 5 4 6 bool psphotParseCamera (pmConfig *config) { 5 7 … … 40 42 } 41 43 44 pmFPAfileBindFromArgs (&status, input, config, "PSPHOT.EXPNUM", "EXPNUM"); 45 if (!status) { 46 psError (PS_ERR_UNKNOWN, false, "failed to load find definition"); 47 return NULL; 48 } 49 50 42 51 // define the additional input/output files associated with psphot 43 52 if (!psphotDefineFiles (config, input)) { -
trunk/psphot/src/psphotStackArguments.c
r31154 r33690 53 53 psMetadataAddStr (options, PS_LIST_TAIL, "BREAK_POINT", PS_META_REPLACE, "", argv[N]); 54 54 psArgumentRemove (N, &argc, argv); 55 } 56 if ((N = psArgumentGet (argc, argv, "-ds9regions"))) { 57 psArgumentRemove (N, &argc, argv); 58 pmSubtractionRegions(true); 55 59 } 56 60 -
trunk/psphot/src/psphotStackImageLoop.c
r33030 r33690 30 30 } 31 31 32 psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, PSPHOT_RECIPE); 33 bool useRaw = psMetadataLookupBool (NULL, recipe, "PSPHOT.STACK.USE.RAW"); 34 if (useRaw && inputRaw == NULL) { 35 psLogMsg ("psphot", 1, "PSPHOT.STACK.USE.RAW set but no raw input."); 36 useRaw = false; 37 } 38 32 39 pmFPAview *view = pmFPAviewAlloc (0); 33 40 34 // XXX for now, just load the full set of images up front 41 42 // XXX for now, just load the full set of images up front except for EXPNUM which we defer 43 pmFPAfileActivate (config->files, false, "PSPHOT.STACK.EXPNUM.RAW"); 35 44 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for fpa in psphot."); 36 45 … … 86 95 UpdateHeadersForChip(config, view); 87 96 88 // save output which is saved at the chip level 89 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE ("failed output for Chip in psphot."); 97 // Defer output until we have performed psphotSetNFrames() 98 pmFPAfileActivate (config->files, false, NULL); 99 100 // Iterate up 101 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE ("failed pmFPAfileIOChecks for Chip in psphot."); 90 102 } 91 103 psMemDump("doneloop"); … … 93 105 UpdateHeadersForFPA(config, view); 94 106 95 // save output which is saved at the fpa level 107 // Iterate up output which is saved at the fpa level 108 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE ("failed ouput pmFPAfileIOChecks FPA in psphot."); 109 110 // Load the appropriate EXPNUM image 111 pmFPAfileActivate (config->files, true, useRaw ? "PSPHOT.STACK.EXPNUM.RAW" : "PSPHOT.STACK.EXPNUM.CNV"); 112 113 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for fpa EXPNUM in psphot."); 114 115 // for psphot, we force data to be read at the chip level 116 while ((chip = pmFPAviewNextChip (view, input->fpa, 1)) != NULL) { 117 psLogMsg ("psphot", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 118 if (! chip->process || ! chip->file_exists) { continue; } 119 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for Chip EXPNUM in psphotStack."); 120 121 // there is now only a single chip (multiple readouts?). loop over it and process 122 while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) { 123 psLogMsg ("psphot", 5, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 124 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for Cell in psphotStack."); 125 126 // process each of the readouts 127 while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) { 128 psLogMsg ("psphot", 6, "Readout %d: %x %x\n", view->readout, cell->file_exists, cell->process); 129 if (! readout->data_exists) { continue; } 130 131 if (!psphotSetNFrames (config, view, useRaw ? inputRaw->name : inputCnv->name)) ESCAPE ("failed to setNFrames."); 132 } 133 } 134 // now activate all files to trigger final output 135 pmFPAfileActivate (config->files, true, NULL); 136 137 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE ("failed output for Chip in psphot."); 138 } 96 139 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE ("failed ouput for FPA in psphot."); 97 140 -
trunk/psphot/src/psphotStackParseCamera.c
r31154 r33690 59 59 } 60 60 } 61 psString expnum = psMetadataLookupStr(&status, input, "RAW:EXPNUM"); // Name of expnum image 62 if (expnum && strlen(expnum) > 0) { 63 if (!defineFile(config, rawInputFile, "PSPHOT.STACK.EXPNUM.RAW", expnum, PM_FPA_FILE_EXPNUM)) { 64 psError(PS_ERR_UNKNOWN, false, "Unable to define file from expnum %d (%s)", i, expnum); 65 return false; 66 } 67 } 61 68 nRaw ++; 62 69 } … … 81 88 if (!defineFile(config, cnvInputFile, "PSPHOT.STACK.VARIANCE.CNV", variance, PM_FPA_FILE_VARIANCE)) { 82 89 psError(PS_ERR_UNKNOWN, false, "Unable to define file from variance %d (%s)", i, variance); 90 return false; 91 } 92 } 93 psString expnum = psMetadataLookupStr(&status, input, "CNV:EXPNUM"); // Name of EXPNUM image 94 if (expnum && strlen(expnum) > 0) { 95 if (!defineFile(config, cnvInputFile, "PSPHOT.STACK.EXPNUM.CNV", expnum, PM_FPA_FILE_EXPNUM)) { 96 psError(PS_ERR_UNKNOWN, false, "Unable to define file from expnum %d (%s)", i, expnum); 83 97 return false; 84 98 }
Note:
See TracChangeset
for help on using the changeset viewer.
