Changeset 29914
- Timestamp:
- Dec 5, 2010, 2:23:08 PM (15 years ago)
- Location:
- branches/eam_branches/ipp-20101103/psphot
- Files:
-
- 1 added
- 9 edited
-
. (modified) (1 prop)
-
src/Makefile.am (modified) (1 diff)
-
src/psphot.h (modified) (3 diffs)
-
src/psphotEfficiency.c (modified) (1 diff)
-
src/psphotMergeSources.c (modified) (1 diff)
-
src/psphotOutput.c (modified) (3 diffs)
-
src/psphotParseCamera.c (modified) (1 diff)
-
src/psphotRadiusChecks.c (modified) (1 diff)
-
src/psphotReadout.c (modified) (1 diff)
-
src/psphotReadoutForcedKnownSources.c (added)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20101103/psphot
- Property svn:mergeinfo set to
-
branches/eam_branches/ipp-20101103/psphot/src/Makefile.am
r29904 r29914 125 125 psphotReadoutFindPSF.c \ 126 126 psphotReadoutKnownSources.c \ 127 psphotReadoutForcedKnownSources.c \ 127 128 psphotReadoutMinimal.c \ 128 129 psphotModelBackground.c \ -
branches/eam_branches/ipp-20101103/psphot/src/psphot.h
r29904 r29914 27 27 bool psphotReadoutFindPSF(pmConfig *config, const pmFPAview *view, const char *filerule, psArray *inSources); 28 28 bool psphotReadoutKnownSources(pmConfig *config, const pmFPAview *view, const char *filerule, psArray *inSources); 29 bool psphotReadoutForcedKnownSources(pmConfig *config, const pmFPAview *view, const char *filerule, psArray *inSources); 29 30 bool psphotReadoutMinimal(pmConfig *config, const pmFPAview *view, const char *filerule); 30 31 … … 312 313 int psphotFileruleCount(const pmConfig *config, const char *filerule); 313 314 315 bool psphotAddKnownSources (pmConfig *config, const pmFPAview *view, const char *filerule, psArray *inSources); 316 317 314 318 /**** psphotStack prototypes ****/ 315 319 … … 434 438 pmModel *psphotFitPCM (pmReadout *readout, pmSource *source, pmSourceFitOptions *fitOptions, pmModelType modelType, psImageMaskType maskVal, psImageMaskType markVal, int psfSize); 435 439 440 bool psphotCleanInputs (pmConfig *config, const pmFPAview *view, const char *filerule); 441 436 442 #endif -
branches/eam_branches/ipp-20101103/psphot/src/psphotEfficiency.c
r29904 r29914 511 511 psMetadataAddPtr(readout->analysis, PS_LIST_TAIL, PM_DETEFF_ANALYSIS, PS_META_REPLACE | PS_DATA_UNKNOWN, 512 512 "Detection efficiency", de); 513 psMetadataAddF32(readout->analysis, PS_LIST_TAIL, "DETEFF.MAGREF", 514 PS_META_REPLACE, "Magnitude reference", magLim); 515 513 516 psFree(de); 514 517 -
branches/eam_branches/ipp-20101103/psphot/src/psphotMergeSources.c
r29904 r29914 163 163 } 164 164 165 // copy the known sources (as external) to the detection list of the given filerule 166 bool psphotAddKnownSources (pmConfig *config, const pmFPAview *view, const char *filerule, psArray *inSources) { 167 168 bool status = false; 169 170 // select the appropriate recipe information 171 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE); 172 psAssert (recipe, "missing recipe?"); 173 174 // determine properties (sky, moments) of initial sources 175 float OUTER = psMetadataLookupF32 (&status, recipe, "SKY_OUTER_RADIUS"); 176 psAssert (status, "missing SKY_OUTER_RADIUS in recipe?"); 177 178 // XXX this seems like an arbitrary number... 179 OUTER = PS_MAX(OUTER, 20.0); // XXX Guarantee that we can encompass the max moments radius 180 181 // find the currently selected readout 182 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, 0); // File of interest 183 psAssert (file, "missing file?"); 184 185 pmReadout *readout = pmFPAviewThisReadout(view, file->fpa); 186 psAssert (readout, "missing readout?"); 187 188 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); 189 if (!detections) { 190 detections = pmDetectionsAlloc(); 191 detections->newSources = psArrayAllocEmpty (100); 192 // save detections on the readout->analysis 193 if (!psMetadataAddPtr (readout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_META_REPLACE | PS_DATA_UNKNOWN, "psphot detections", detections)) { 194 psError (PSPHOT_ERR_CONFIG, false, "problem saving detections on readout"); 195 return false; 196 } 197 } else { 198 psMemIncrRefCounter(detections); // so we can free the detections below 199 } 200 201 // copy the sources from inSources to the new detection structure 202 for (int i = 0; i < inSources->n; i++) { 203 pmSource *inSource = inSources->data[i]; 204 205 pmSource *newSource = pmSourceCopy(inSource); 206 newSource->mode |= PM_SOURCE_MODE_EXTERNAL; 207 208 // drop the loaded source modelPSF 209 psFree (newSource->modelPSF); 210 // source->modelPSF = NULL; check this! 211 212 // drop the references to the original image pixels: 213 pmSourceFreePixels (newSource); 214 215 // allocate image, weight, mask for the new image for each peak (square of radius OUTER) 216 pmSourceDefinePixels (newSource, readout, newSource->peak->x, newSource->peak->y, OUTER); 217 218 newSource->imageID = 0; 219 // XXX reset the source ID? raised questions about the meaning of this ID... 220 // P_PM_SOURCE_SET_ID(source, i); 221 222 psArrayAdd (detections->newSources, 100, newSource); 223 } 224 psLogMsg ("psphot", 3, "%ld known sources supplied", detections->newSources->n); 225 226 psFree (detections); 227 return true; 228 } 229 165 230 // extract the input sources corresponding to this readout 166 231 // XXX this function needs to be updated to work with the new context of psphot inputs -
branches/eam_branches/ipp-20101103/psphot/src/psphotOutput.c
r29904 r29914 9 9 psStringAppend(&name, "%s.NUM", filerule); 10 10 int num = psMetadataLookupS32 (&status, config->arguments, name); 11 psAssert (status, "programming error: must define %s", name); 11 if (!status) { 12 // we only explicitly define (filerule.NUM) if we have more than 1 13 num = 1; 14 } 12 15 psFree (name); 13 16 return num; … … 125 128 } 126 129 fclose (f); 130 return true; 131 } 132 133 bool psphotCleanInputsReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int index); 134 bool psphotCleanInputs (pmConfig *config, const pmFPAview *view, const char *filerule) { 135 136 int num = psphotFileruleCount(config, filerule); 137 138 // loop over the available readouts 139 for (int i = 0; i < num; i++) { 140 if (!psphotCleanInputsReadout (config, view, filerule, i)) { 141 psError (PSPHOT_ERR_CONFIG, false, "failed to clean inputs for %s entry %d", filerule, i); 142 return false; 143 } 144 } 145 return true; 146 } 147 148 bool psphotCleanInputsReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int index) { 149 150 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, index); // File of interest 151 PS_ASSERT (file, false); 152 153 pmReadout *readout = pmFPAviewThisReadout (view, file->fpa); 154 155 // XXX anything else to remove? 156 if (psMetadataLookup(readout->analysis, "PSPHOT.DETECTIONS")) { 157 psMetadataRemoveKey(readout->analysis, "PSPHOT.DETECTIONS"); 158 } 159 127 160 return true; 128 161 } … … 282 315 psMetadataItemSupplement (&status, header, analysis, "MSKY_NY"); 283 316 317 psMetadataItemSupplement (&status, header, analysis, "DETEFF.MAGREF"); 318 284 319 psMetadataAddF32 (header, PS_LIST_TAIL, "DT_PHOT", PS_META_REPLACE, "elapsed psphot time", psTimerMark ("psphotReadout")); 285 320 -
branches/eam_branches/ipp-20101103/psphot/src/psphotParseCamera.c
r26894 r29914 39 39 return NULL; 40 40 } 41 // specify the number of psphot input images42 psMetadataAddS32 (config->arguments, PS_LIST_TAIL, "PSPHOT.INPUT.NUM", PS_META_REPLACE, "number of inputs", 1);43 41 44 42 // define the additional input/output files associated with psphot -
branches/eam_branches/ipp-20101103/psphot/src/psphotRadiusChecks.c
r29004 r29914 135 135 EXT_FIT_MAX_RADIUS = psMetadataLookupF32 (&status, recipe, "EXT_FIT_MAX_RADIUS"); 136 136 137 float skyMean = psMetadataLookupF32 (&status, readout->analysis, "SKY_MEAN");138 137 float skyStdev = psMetadataLookupF32 (&status, readout->analysis, "SKY_STDEV"); 139 140 fprintf (stderr, "sky: %f +/- %f\n", skyMean, skyStdev);141 138 142 139 EXT_FIT_SKY_SIG = skyStdev; -
branches/eam_branches/ipp-20101103/psphot/src/psphotReadout.c
r29904 r29914 27 27 psAssert (breakPt, "configuration error: set BREAK_POINT"); 28 28 29 // remove cruft from the input analysis structure 30 if (!psphotCleanInputs (config, view, filerule)) { 31 psError (PSPHOT_ERR_PROG, false, "trouble setting up the inputs"); 32 return false; 33 } 34 29 35 // set the photcode for this image 30 36 if (!psphotAddPhotcode (config, view, filerule)) {
Note:
See TracChangeset
for help on using the changeset viewer.
