- Timestamp:
- Apr 6, 2010, 1:36:51 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/stackphot.20100406/psphot/src/psphotStackChisqImage.c
r27547 r27625 12 12 psTimerStart ("psphot.chisq.image"); 13 13 14 pmFPAfile *chisqFile = pmFPAfileSelectSingle(config->files, "PSPHOT.CHISQ.OUTPUT", 0); 15 psAssert (chisqFile, "missing chisq image FPA?"); 16 17 pmCell *chisqCell = pmFPAviewThisCell(view, chisqFile->fpa); 18 14 19 // create a holder for the image 15 pmReadout *chiImage = pmReadoutAlloc(); 20 pmReadout *chiReadout = pmFPAviewThisReadout(view, chisqFile->fpa); 21 if (!chiReadout) { 22 chiReadout = pmReadoutAlloc(chisqCell); 23 } else { 24 psMemIncrRefCounter(chiReadout); 25 } 16 26 17 27 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); … … 20 30 // loop over the available readouts 21 31 for (int i = 0; i < num; i++) { 22 if (!psphotStackChisqImageAddReadout(config, view, chi Image, "PSPHOT.INPUT", i)) {32 if (!psphotStackChisqImageAddReadout(config, view, chiReadout, "PSPHOT.INPUT", i)) { 23 33 psError (PSPHOT_ERR_CONFIG, false, "failed to model background for PSPHOT.INPUT entry %d", i); 24 34 return false; … … 26 36 } 27 37 38 num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 39 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 40 41 psMetadataAddS32(config->arguments, PS_LIST_TAIL, "PSPHOT.CHISQ.NUM", PS_META_REPLACE, "", num); 42 num++; 43 psMetadataAddS32(config->arguments, PS_LIST_TAIL, "PSPHOT.INPUT.NUM", PS_META_REPLACE, "", num); 44 28 45 // need to save the resulting image somewhere (PSPHOT.INPUT?) 46 if (!psMetadataAddPtr(config->files, PS_LIST_TAIL, "PSPHOT.INPUT", PS_DATA_UNKNOWN | PS_META_DUPLICATE_OK, "", chisqFile)) { 47 psError(PM_ERR_CONFIG, false, "could not add chisqFPA to config files"); 48 return false; 49 } 29 50 30 51 psLogMsg ("psphot", PS_LOG_INFO, "built chisq image: %f sec\n", psTimerMark ("psphot.chisq.image")); 31 52 53 psFree (chiReadout); 32 54 return true; 33 55 } 34 56 35 57 bool psphotStackChisqImageAddReadout(const pmConfig *config, // Configuration 36 pmFPAview *view,58 const pmFPAview *view, 37 59 pmReadout *chiReadout, 38 60 char *filename,
Note:
See TracChangeset
for help on using the changeset viewer.
