- Timestamp:
- Jan 28, 2009, 1:36:37 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branch_20090113/psastro/src/psastroLoadRefstars.c
r20805 r21208 138 138 } 139 139 140 p sastroVisualPlotRefStars (refstars, recipe);140 pmAstromVisualPlotRefStars (refstars, recipe); 141 141 142 142 if (psTraceGetLevel("psastro.plot") > 0) { … … 239 239 pmFPAfile *input = psMetadataLookupPtr (NULL, config->files, "PSASTRO.INPUT"); 240 240 if (!input) { 241 psLogMsg ("psastro", PS_LOG_DETAIL, "no supplied reference header data");242 photcode = psStringCopy ("NONE");243 return photcode;241 psLogMsg ("psastro", PS_LOG_DETAIL, "no supplied reference header data"); 242 photcode = psStringCopy ("NONE"); 243 return photcode; 244 244 } 245 245 assert (input->fpa); … … 247 247 *maxRho = psMetadataLookupF32(&status, recipe, "DVO.GETSTAR.MAX.RHO"); 248 248 if (!status) { 249 psError(PSASTRO_ERR_CONFIG, false, "DVO.GETSTAR.MAX.RHO missing from recipe");250 return NULL;249 psError(PSASTRO_ERR_CONFIG, false, "DVO.GETSTAR.MAX.RHO missing from recipe"); 250 return NULL; 251 251 } 252 252 … … 266 266 if (!status) ESCAPE ("missing DVO.GETSTAR.MIN.MAG.INST"); 267 267 268 // PHOTCODE.DATA is a multi of metadata items 268 // PHOTCODE.DATA is a multi of metadata items 269 269 psListIterator *iter = psListIteratorAlloc(item->data.list, PS_LIST_HEAD, false); 270 270 271 271 psMetadataItem *refItem = NULL; 272 272 while ((refItem = psListGetAndIncrement (iter))) { 273 if (refItem->type != PS_DATA_METADATA) ESCAPE ("PHOTCODE.DATA entry is not a metadata folder");274 275 char *refFilter = psMetadataLookupStr (&status, refItem->data.md, "FILTER");276 if (!status) {277 psLogMsg ("psastro", PS_LOG_INFO, "a PHOTCODE.DATA recipe folder is missing FILTER");278 continue;279 }280 281 // does this entry match the current filter?282 if (strcmp (refFilter, filter)) continue;283 284 psLogMsg ("psastro", PS_LOG_DETAIL, "PHOTCODE.DATA found for filter %s", filter);285 286 float zeropt = psMetadataLookupF32 (&status, refItem->data.md, "ZEROPT");287 if (!status) {288 psLogMsg ("psastro", PS_LOG_INFO, "a PHOTCODE.DATA recipe folder is missing FILTER");289 continue;290 }291 photcode = psMetadataLookupStr (&status, refItem->data.md, "PHOTCODE");292 if (!status) {293 psLogMsg ("psastro", PS_LOG_INFO, "a PHOTCODE.DATA recipe folder is missing FILTER");294 continue;295 }296 297 // convert the minInst to a calibrated minimum magnitude298 *minMag = minInst + 2.5*log10(exptime) + zeropt;299 300 psFree (iter);301 return photcode;302 } 273 if (refItem->type != PS_DATA_METADATA) ESCAPE ("PHOTCODE.DATA entry is not a metadata folder"); 274 275 char *refFilter = psMetadataLookupStr (&status, refItem->data.md, "FILTER"); 276 if (!status) { 277 psLogMsg ("psastro", PS_LOG_INFO, "a PHOTCODE.DATA recipe folder is missing FILTER"); 278 continue; 279 } 280 281 // does this entry match the current filter? 282 if (strcmp (refFilter, filter)) continue; 283 284 psLogMsg ("psastro", PS_LOG_DETAIL, "PHOTCODE.DATA found for filter %s", filter); 285 286 float zeropt = psMetadataLookupF32 (&status, refItem->data.md, "ZEROPT"); 287 if (!status) { 288 psLogMsg ("psastro", PS_LOG_INFO, "a PHOTCODE.DATA recipe folder is missing FILTER"); 289 continue; 290 } 291 photcode = psMetadataLookupStr (&status, refItem->data.md, "PHOTCODE"); 292 if (!status) { 293 psLogMsg ("psastro", PS_LOG_INFO, "a PHOTCODE.DATA recipe folder is missing FILTER"); 294 continue; 295 } 296 297 // convert the minInst to a calibrated minimum magnitude 298 *minMag = minInst + 2.5*log10(exptime) + zeropt; 299 300 psFree (iter); 301 return photcode; 302 } 303 303 psFree (iter); 304 304 … … 306 306 photcode = psMetadataLookupStr(NULL, recipe, "DVO.GETSTAR.PHOTCODE"); 307 307 PS_ASSERT (photcode, NULL); 308 308 309 309 // give up and use fixed value 310 310 *minMag = psMetadataLookupF32(NULL, recipe, "DVO.GETSTAR.MIN.MAG");
Note:
See TracChangeset
for help on using the changeset viewer.
