Changeset 6727 for trunk/psphot/src/psphotReadout.c
- Timestamp:
- Mar 29, 2006, 11:08:05 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotReadout.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotReadout.c
r6715 r6727 1 1 # include "psphot.h" 2 2 3 // XXX 2006.02.07 : no leaks! 4 // XXX change 'config' to 'recipe' eventually 3 // XXX 2006.03.28 : no leaks! 5 4 bool psphotReadout (pmConfig *config, pmFPAview *view) { 6 5 … … 15 14 pmReadout *readout = pmFPAviewThisReadout (view, input->fpa); 16 15 17 sources = psphotFakeSources();18 status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY, "psphot sources", sources);19 psFree (sources);20 return true;21 22 16 // XXX does this need to invoke I/O? 23 17 pmReadoutSetWeights (readout); … … 25 19 // I have a valid mask, now mask in the analysis region of interest 26 20 psphotMaskReadout (readout, recipe); 21 22 // run a single-model test if desired 23 psphotModelTest (readout, recipe); 27 24 28 25 // generate a background model (median, smoothed image) … … 55 52 psphotReplaceUnfit (sources); 56 53 57 // find remaining peaks after first source subtraction pass54 // XXX find remaining peaks after first source subtraction pass 58 55 // psphotFindPeaks (); 59 56 … … 67 64 psphotMagnitudes (sources, recipe, psf); 68 65 69 // update the header with stats results 70 // XXX need to do this conditionally? 71 // XXX psMetadata *header = pmReadoutGetHeader (readout); 72 // XXX psphotUpdateHeader (header, config); 66 // create an output header with stats results 67 psMetadata *header = psphotDefineHeader (recipe); 73 68 74 // XXX make this an option?75 69 // replace background in residual image 76 70 psphotSkyReplace (config, view); 77 71 78 // need to do something with the sources, psf, and sky 79 status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY, "psphot sources", sources); 80 status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_DATA_UNKNOWN, "psphot psf", psf); 81 // XXX : replace? status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SKY.MEAN", PS_DATA_F32, "psphot sky mean", sky->sampleMean); 82 // XXX : replace? status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SKY.SIGMA", PS_DATA_F32, "psphot sky stdev", sky->sampleStdev); 72 // save the results of the analysis 73 status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY, "psphot sources", sources); 74 status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.HEADER", PS_DATA_METADATA, "header stats", header); 75 status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_DATA_UNKNOWN, "psphot psf", psf); 83 76 84 77 // free up the local copies of the data 85 78 psFree (psf); 79 psFree (header); 86 80 psFree (sources); 87 81 psFree (peaks); … … 89 83 } 90 84 91 92 // XXX Deprecate or allow these versions? 93 # if (0) 94 // select analysis method 95 char *FITMODE = psMetadataLookupStr (&status, config, "FITMODE"); 96 if (!strcasecmp(FITMODE, "ENSEMBLE")) { 97 psphotEnsemblePSF (readout, config, sources, psf); 98 } 99 100 if (!strcasecmp(FITMODE, "FULL")) { 101 psphotEnsemblePSF (readout, config, sources, psf); 102 psphotFullFit (readout, config, sources, psf); 103 psphotReplaceUnfit (sources); 104 psphotApResid (readout, sources, config, psf); 105 } 106 107 if (!strcasecmp(FITMODE, "BASIC")) { 108 psphotApplyPSF (readout, config, sources, psf); 109 psphotFitExtended (readout, config, sources); 110 } 111 112 113 114 psphotSaveImage (NULL, readout->image, "pixels.fits"); 115 psphotSaveImage (NULL, readout->weight, "weight.fits"); 116 psphotSaveImage (NULL, readout->mask, "mask.fits"); 117 exit (1); 118 119 # endif 85 # if (1) 86 fprintf (stderr, "making fake sources\n"); 87 sources = psphotFakeSources (); 88 psMetadata *tmp = psMetadataAlloc (); 89 status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY, "psphot sources", sources); 90 status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.HEADER", PS_DATA_METADATA, "header stats", tmp); 91 psFree (sources); 92 psFree (tmp); 93 return true; 94 # endif
Note:
See TracChangeset
for help on using the changeset viewer.
