Changeset 36441 for trunk/psModules/src/objects/pmSourceIO_CFF.c
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312 (added) merged: 36383,36386,36388-36396,36406-36407,36409-36412,36415-36420,36422-36427,36433,36436-36439
- Property svn:mergeinfo changed
-
trunk/psModules
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/psModules (added) merged: 36389,36412,36422-36424
- Property svn:mergeinfo changed
-
trunk/psModules/src/objects/pmSourceIO_CFF.c
r36375 r36441 65 65 int modelType = pmModelClassGetType ("PS_MODEL_GAUSS"); 66 66 67 // Read lookup table for model classes (if defined) 68 pmModelClassReadHeader(header); 69 67 70 char *PSF_NAME = psMetadataLookupStr (&status, header, "PSFMODEL"); 68 71 if (PSF_NAME != NULL) { … … 111 114 float theta = psMetadataLookupF32 (&status, row, "THETA"); 112 115 113 // XXX: we need to put a lookup table in the cff header to define the correspondence of the114 // model type values in the cff with our models. (We want to use an interger for efficiency115 // but the value for each model type is set on the organization of the the array in pmModelClass.c116 // For now use the input values verbatim and trust the user that this is valid value117 116 int galaxyModelType = psMetadataLookupS32(&status, row, "MODEL_TYPE"); 117 if (status) { 118 galaxyModelType = pmModelClassGetLocalType(galaxyModelType); 119 } else { 120 galaxyModelType = -1; 121 } 118 122 float Sindex = psMetadataLookupF32 (&status, row, "INDEX"); // Should this be PAR_07 not sersic index 119 123 … … 123 127 source->type = PM_SOURCE_TYPE_STAR; // XXX this should be added to the flags 124 128 125 // XXX we can set this in general, but for a specific image, we need to weed out SATSTARS 129 // XXX we can set this in general, but for a specific image, we need to weed out SATSTARS and 130 // stars that are masked 126 131 if (psfStar) { 127 132 source->tmpFlags |= PM_SOURCE_TMPF_CANDIDATE_PSFSTAR; … … 180 185 } 181 186 182 // XXX: should use < 0 as invalid galaxyModelType 183 184 if (fitGalaxy && galaxyModelType > 0) { 187 if (fitGalaxy && galaxyModelType >= 0) { 185 188 source->modelFits = psArrayAllocEmpty (1); 186 189 pmModel *model = pmModelAlloc(galaxyModelType); … … 235 238 PS_ASSERT(mdok, false); 236 239 240 // write the definition of the model class type values to the header 241 psMetadata *outputHeader = psMetadataAlloc(); 242 pmModelClassWriteHeader(outputHeader); 243 237 244 psArray *table = psArrayAllocEmpty(sources->n); 238 245 … … 246 253 psS32 modelType = 0; 247 254 bool fitGalaxy = false; 248 bool psfStar = false;255 bool psfStar = (source->mode & PM_SOURCE_MODE_PSFSTAR) ? true : false; 249 256 psF32 sersicIndex = 0; 250 if (source->modelFits == NULL) { 257 // For now only perform galaxy fits on extended objects 258 if (source->modelEXT == NULL) { 251 259 pmModel *model = source->modelPSF; 252 260 if (model == NULL) continue; … … 260 268 yPos = model->params->data.F32[PM_PAR_YPOS]; 261 269 flux = source->psfFlux; 262 psfStar = (source->mode & PM_SOURCE_MODE_PSFSTAR) ? true : false;263 270 rMajor = 0; 264 271 rMinor = 0; … … 329 336 330 337 psArrayAdd(table, 100, row); 338 psFree(row); 331 339 } 332 340 333 if (!psFitsWriteTable(fits, NULL, table, extname)) {341 if (!psFitsWriteTable(fits, outputHeader, table, extname)) { 334 342 psError(psErrorCodeLast(), false, "writing ext data %s\n", extname); 335 343 psFree(table); 336 psFree( header);344 psFree(outputHeader); 337 345 return false; 338 346 } 339 347 psFree(table); 340 // psFree(header);348 psFree(outputHeader); 341 349 342 350 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
