Changeset 21422 for trunk/psastro/src/psastroLoadRefstars.c
- Timestamp:
- Feb 9, 2009, 11:25:34 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/psastro/src/psastroLoadRefstars.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastroLoadRefstars.c
r21409 r21422 6 6 * 7 7 * @author IfA 8 * @version $Revision: 1.3 5$ $Name: not supported by cvs2svn $9 * @date $Date: 2009-02-0 7 02:03:34 $8 * @version $Revision: 1.36 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2009-02-09 21:25:34 $ 10 10 * Copyright 2009 Institute for Astronomy, University of Hawaii 11 11 */ … … 150 150 } 151 151 152 p sastroVisualPlotRefStars (refstars, recipe);152 pmAstromVisualPlotRefStars (refstars, recipe); 153 153 154 154 if (psTraceGetLevel("psastro.plot") > 0) { … … 251 251 pmFPAfile *input = psMetadataLookupPtr (NULL, config->files, "PSASTRO.INPUT"); 252 252 if (!input) { 253 psLogMsg ("psastro", PS_LOG_DETAIL, "no supplied reference header data");254 photcode = psStringCopy ("NONE");255 return photcode;253 psLogMsg ("psastro", PS_LOG_DETAIL, "no supplied reference header data"); 254 photcode = psStringCopy ("NONE"); 255 return photcode; 256 256 } 257 257 assert (input->fpa); … … 259 259 *maxRho = psMetadataLookupF32(&status, recipe, "DVO.GETSTAR.MAX.RHO"); 260 260 if (!status) { 261 psError(PSASTRO_ERR_CONFIG, false, "DVO.GETSTAR.MAX.RHO missing from recipe");262 return NULL;261 psError(PSASTRO_ERR_CONFIG, false, "DVO.GETSTAR.MAX.RHO missing from recipe"); 262 return NULL; 263 263 } 264 264 … … 278 278 if (!status) ESCAPE ("missing DVO.GETSTAR.MIN.MAG.INST"); 279 279 280 // PHOTCODE.DATA is a multi of metadata items 280 // PHOTCODE.DATA is a multi of metadata items 281 281 psListIterator *iter = psListIteratorAlloc(item->data.list, PS_LIST_HEAD, false); 282 282 283 283 psMetadataItem *refItem = NULL; 284 284 while ((refItem = psListGetAndIncrement (iter))) { 285 if (refItem->type != PS_DATA_METADATA) ESCAPE ("PHOTCODE.DATA entry is not a metadata folder");286 287 char *refFilter = psMetadataLookupStr (&status, refItem->data.md, "FILTER");288 if (!status) {289 psLogMsg ("psastro", PS_LOG_INFO, "a PHOTCODE.DATA recipe folder is missing FILTER");290 continue;291 }292 293 // does this entry match the current filter?294 if (strcmp (refFilter, filter)) continue;295 296 psLogMsg ("psastro", PS_LOG_DETAIL, "PHOTCODE.DATA found for filter %s", filter);297 298 float zeropt = psMetadataLookupF32 (&status, refItem->data.md, "ZEROPT");299 if (!status) {300 psLogMsg ("psastro", PS_LOG_INFO, "a PHOTCODE.DATA recipe folder is missing FILTER");301 continue;302 }303 photcode = psMetadataLookupStr (&status, refItem->data.md, "PHOTCODE");304 if (!status) {305 psLogMsg ("psastro", PS_LOG_INFO, "a PHOTCODE.DATA recipe folder is missing FILTER");306 continue;307 }308 309 // convert the minInst to a calibrated minimum magnitude310 *minMag = minInst + 2.5*log10(exptime) + zeropt;311 312 psFree (iter);313 return photcode;314 } 285 if (refItem->type != PS_DATA_METADATA) ESCAPE ("PHOTCODE.DATA entry is not a metadata folder"); 286 287 char *refFilter = psMetadataLookupStr (&status, refItem->data.md, "FILTER"); 288 if (!status) { 289 psLogMsg ("psastro", PS_LOG_INFO, "a PHOTCODE.DATA recipe folder is missing FILTER"); 290 continue; 291 } 292 293 // does this entry match the current filter? 294 if (strcmp (refFilter, filter)) continue; 295 296 psLogMsg ("psastro", PS_LOG_DETAIL, "PHOTCODE.DATA found for filter %s", filter); 297 298 float zeropt = psMetadataLookupF32 (&status, refItem->data.md, "ZEROPT"); 299 if (!status) { 300 psLogMsg ("psastro", PS_LOG_INFO, "a PHOTCODE.DATA recipe folder is missing FILTER"); 301 continue; 302 } 303 photcode = psMetadataLookupStr (&status, refItem->data.md, "PHOTCODE"); 304 if (!status) { 305 psLogMsg ("psastro", PS_LOG_INFO, "a PHOTCODE.DATA recipe folder is missing FILTER"); 306 continue; 307 } 308 309 // convert the minInst to a calibrated minimum magnitude 310 *minMag = minInst + 2.5*log10(exptime) + zeropt; 311 312 psFree (iter); 313 return photcode; 314 } 315 315 psFree (iter); 316 316 … … 318 318 photcode = psMetadataLookupStr(NULL, recipe, "DVO.GETSTAR.PHOTCODE"); 319 319 PS_ASSERT (photcode, NULL); 320 320 321 321 // give up and use fixed value 322 322 *minMag = psMetadataLookupF32(NULL, recipe, "DVO.GETSTAR.MIN.MAG");
Note:
See TracChangeset
for help on using the changeset viewer.
