Changeset 27648
- Timestamp:
- Apr 9, 2010, 4:40:56 PM (16 years ago)
- Location:
- branches/eam_branches/stackphot.20100406/psModules/src
- Files:
-
- 10 edited
-
camera/pmFPAfile.c (modified) (3 diffs)
-
camera/pmFPAfile.h (modified) (1 diff)
-
camera/pmFPAfileDefine.c (modified) (2 diffs)
-
camera/pmFPAfileDefine.h (modified) (1 diff)
-
objects/Makefile.am (modified) (2 diffs)
-
objects/pmPhotObj.c (modified) (2 diffs)
-
objects/pmPhotObj.h (modified) (1 diff)
-
objects/pmSource.c (modified) (1 diff)
-
objects/pmSource.h (modified) (1 diff)
-
psmodules.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/stackphot.20100406/psModules/src/camera/pmFPAfile.c
r27134 r27648 111 111 file->save = false; 112 112 113 file->index = fileNum++; 113 file->fileIndex = fileNum++; 114 file->fileID = 0; 114 115 115 116 file->imageId = 0; … … 372 373 // Number of the file in list 373 374 psString num = NULL; // Number to use 374 psStringAppend(&num, "%d", file-> index);375 psStringAppend(&num, "%d", file->fileIndex); 375 376 psStringSubstitute(&newRule, num, "{FILE.INDEX}"); 377 psFree(num); 378 } 379 380 if (strstr(newRule, "{FILE.ID}")) { 381 // Number of the file in list 382 psString num = NULL; // Number to use 383 psStringAppend(&num, "%03d", file->fileID); 384 psStringSubstitute(&newRule, num, "{FILE.ID}"); 376 385 psFree(num); 377 386 } … … 638 647 psFree(iter); 639 648 640 ps Error(PS_ERR_BAD_PARAMETER_VALUE, true, "Unable to find instance %d of file %s", num, name);649 psLogMsg("psModules.camera", PS_LOG_MINUTIA, "Unable to find instance %d of file %s", num, name); 641 650 return NULL; 642 651 } -
branches/eam_branches/stackphot.20100406/psModules/src/camera/pmFPAfile.h
r27134 r27648 111 111 psString formatName; // name of the camera format 112 112 113 int index; // Index of file 113 int fileIndex; // Index of file 114 int fileID; // internal sequence number 114 115 115 116 psS64 imageId, sourceId; // Image and source identifiers -
branches/eam_branches/stackphot.20100406/psModules/src/camera/pmFPAfileDefine.c
r27417 r27648 1271 1271 file->name = psStringCopy (name); 1272 1272 1273 // free a previously existing readout 1274 psFree(file->readout); 1273 1275 file->readout = readout; 1274 psMetadataAddPtr(files, PS_LIST_TAIL, name, PS_DATA_UNKNOWN, "", file); 1276 1277 // allow for multiple entries 1278 // XXX handle replace vs multiple? 1279 psMetadataAddPtr(files, PS_LIST_TAIL, name, PS_DATA_UNKNOWN | PS_META_DUPLICATE_OK, "", file); 1275 1280 psFree(file); 1276 1281 // we free this copy of file, but 'files' still has a copy … … 1313 1318 const char *name, // name of internal/external file 1314 1319 const pmFPA *fpa, // use this fpa to generate 1315 const psImageBinning *binning) { 1320 const psImageBinning *binning, 1321 int index) { 1316 1322 pmReadout *readout = NULL; 1317 1323 1318 bool status = true; 1319 pmFPAfile *file = psMetadataLookupPtr(&status, config->files, name); 1324 pmFPAfile *file = pmFPAfileSelectSingle(config->files, name, index); 1320 1325 1321 1326 // if the file does not exist, it is not being used as an I/O file: define an internal version 1322 1327 if (file == NULL) { 1323 readout = pmFPAfileDefineInternal (config->files, name, binning->nXruff, binning->nYruff, PS_TYPE_F32); 1324 return readout; 1328 // XXX currently, we do not guarantee that the defined file lands on entry 'index' 1329 psAssert (binning, "internal files must be supplied a psImageBinning for the output images size"); 1330 readout = pmFPAfileDefineInternal (config->files, name, binning->nXruff, binning->nYruff, PS_TYPE_F32); 1331 return readout; 1325 1332 } 1326 1333 -
branches/eam_branches/stackphot.20100406/psModules/src/camera/pmFPAfileDefine.h
r23354 r27648 172 172 const char *name, // name of internal/external file 173 173 const pmFPA *fpa, // use this fpa to generate 174 const psImageBinning *binning); 174 const psImageBinning *binning, 175 int index 176 ); 175 177 176 178 /// @} -
branches/eam_branches/stackphot.20100406/psModules/src/objects/Makefile.am
r27531 r27648 20 20 pmModelUtils.c \ 21 21 pmSource.c \ 22 pmPhotObj.c \ 22 23 pmSourceMasks.c \ 23 24 pmSourceMoments.c \ … … 80 81 pmModelUtils.h \ 81 82 pmSource.h \ 83 pmPhotObj.h \ 82 84 pmSourceMasks.h \ 83 85 pmSourceDiffStats.h \ -
branches/eam_branches/stackphot.20100406/psModules/src/objects/pmPhotObj.c
r26893 r27648 17 17 #include <pslib.h> 18 18 #include "pmPhotObj.h" 19 #include "pmSource.h" 19 20 20 21 static void pmPhotObjFree (pmPhotObj *tmp) … … 38 39 } 39 40 41 bool pmPhotObjAddSource(pmPhotObj *object, pmSource *source) { 42 43 psAssert (source, "programming error: NULL source"); 44 if (!source->peak) { 45 psError(PS_ERR_UNKNOWN, true, "source missing peak"); 46 return false; 47 } 48 if (!finite(source->peak->xf)) { 49 psError(PS_ERR_UNKNOWN, true, "NAN peak coordinate"); 50 return false; 51 } 52 if (!finite(source->peak->yf)) { 53 psError(PS_ERR_UNKNOWN, true, "NAN peak coordinate"); 54 return false; 55 } 56 57 // XXX we should probably use the fitted position if it exists 58 if (!object->sources) { 59 object->sources = psArrayAllocEmpty(1); 60 object->x = source->peak->xf; 61 object->y = source->peak->yf; 62 } 63 psArrayAdd (object->sources, 1, source); 64 return true; 65 } -
branches/eam_branches/stackphot.20100406/psModules/src/objects/pmPhotObj.h
r27626 r27648 34 34 */ 35 35 typedef struct { 36 int seq; ///< ID for output (generated on write OR set on read) 37 psArray *sources; 38 int flags; 36 int id; ///< ID for output (generated on write OR set on read) 37 psArray *sources; 38 int flags; 39 float x; 40 float y; 39 41 } pmPhotObj; 42 43 bool pmPhotObjAddSource(pmPhotObj *object, pmSource *source); 44 pmPhotObj *pmPhotObjAlloc(void); 40 45 41 46 /// @} 42 47 # endif /* PM_PHOT_OBJ_H */ 48 -
branches/eam_branches/stackphot.20100406/psModules/src/objects/pmSource.c
r27531 r27648 1065 1065 } 1066 1066 1067 // sort by X (ascending) 1068 int pmSourceSortByX (const void **a, const void **b) 1069 { 1070 pmSource *A = *(pmSource **)a; 1071 pmSource *B = *(pmSource **)b; 1072 1073 psF32 fA = (A->peak == NULL) ? 0 : A->peak->x; 1074 psF32 fB = (B->peak == NULL) ? 0 : B->peak->x; 1075 1076 psF32 diff = fA - fB; 1077 if (diff > FLT_EPSILON) return (+1); 1078 if (diff < FLT_EPSILON) return (-1); 1079 return (0); 1080 } 1081 1067 1082 // sort by Seq (ascending) 1068 1083 int pmSourceSortBySeq (const void **a, const void **b) -
branches/eam_branches/stackphot.20100406/psModules/src/objects/pmSource.h
r27626 r27648 246 246 int pmSourceSortBySN (const void **a, const void **b); 247 247 int pmSourceSortByY (const void **a, const void **b); 248 int pmSourceSortByX (const void **a, const void **b); 248 249 int pmSourceSortBySeq (const void **a, const void **b); 249 250 -
branches/eam_branches/stackphot.20100406/psModules/src/psmodules.h
r27531 r27648 124 124 #include <pmSourceMasks.h> 125 125 #include <pmSource.h> 126 #include <pmPhotObj.h> 126 127 #include <pmSourceUtils.h> 127 128 #include <pmSourceIO.h>
Note:
See TracChangeset
for help on using the changeset viewer.
