Changeset 17010
- Timestamp:
- Mar 17, 2008, 12:04:27 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmSourceIO.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSourceIO.c
r16819 r17010 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.5 4$ $Name: not supported by cvs2svn $6 * @date $Date: 2008-03- 05 01:08:08$5 * @version $Revision: 1.55 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2008-03-17 22:04:27 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 278 278 // a SPLIT format : only one header and object table per file 279 279 hdu = pmFPAviewThisHDU (view, file->fpa); 280 if (!hdu) { 281 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find HDU to write sources."); 282 return false; 283 } 280 284 281 285 // copy the header to an output header, add the output header data … … 310 314 // get the current header 311 315 hdu = pmFPAviewThisHDU (view, file->fpa); 312 313 // determine the output table format 314 psMetadata *recipe = psMetadataLookupMetadata(&status, config->recipes, "PSPHOT"); 315 if (!status) { 316 psError(PS_ERR_UNKNOWN, true, "missing recipe PSPHOT in config data"); 317 return false; 318 } 319 320 // if this is not TRUE, the output files only contain the psf measurements. 321 bool XSRC_OUTPUT = psMetadataLookupBool(&status, recipe, "SAVE.XSRC"); 322 bool XFIT_OUTPUT = psMetadataLookupBool(&status, recipe, "SAVE.XFIT"); 316 if (!hdu) { 317 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find HDU to write sources."); 318 return false; 319 } 320 321 // determine the output table format 322 psMetadata *recipe = psMetadataLookupMetadata(&status, config->recipes, "PSPHOT"); 323 if (!status) { 324 psError(PS_ERR_UNKNOWN, true, "missing recipe PSPHOT in config data"); 325 return false; 326 } 327 328 // if this is not TRUE, the output files only contain the psf measurements. 329 bool XSRC_OUTPUT = psMetadataLookupBool(&status, recipe, "SAVE.XSRC"); 330 bool XFIT_OUTPUT = psMetadataLookupBool(&status, recipe, "SAVE.XFIT"); 323 331 324 332 // define the EXTNAME values for the different data segments: … … 350 358 dataname = pmFPAfileNameFromRule (rule, file, view); 351 359 352 if (XSRC_OUTPUT) {353 // EXTNAME for extended source data table354 rule = psMetadataLookupStr(&status, menu, "CMF.XSRC");355 if (!rule) {360 if (XSRC_OUTPUT) { 361 // EXTNAME for extended source data table 362 rule = psMetadataLookupStr(&status, menu, "CMF.XSRC"); 363 if (!rule) { 356 364 psError(PS_ERR_UNKNOWN, true, "missing entry for CMF.XSRC in EXTNAME.RULES in camera.config"); 357 365 return false; 358 }359 xsrcname = pmFPAfileNameFromRule (rule, file, view);360 }361 if (XFIT_OUTPUT) {362 // EXTNAME for extended source data table363 rule = psMetadataLookupStr(&status, menu, "CMF.XFIT");364 if (!rule) {366 } 367 xsrcname = pmFPAfileNameFromRule (rule, file, view); 368 } 369 if (XFIT_OUTPUT) { 370 // EXTNAME for extended source data table 371 rule = psMetadataLookupStr(&status, menu, "CMF.XFIT"); 372 if (!rule) { 365 373 psError(PS_ERR_UNKNOWN, true, "missing entry for CMF.XFIT in EXTNAME.RULES in camera.config"); 366 374 return false; 367 }368 xfitname = pmFPAfileNameFromRule (rule, file, view);369 }375 } 376 xfitname = pmFPAfileNameFromRule (rule, file, view); 377 } 370 378 } 371 379 … … 416 424 psFree (exttype); 417 425 418 // if we request XSRC output, add the XSRC name to this header419 if (xsrcname) {420 psMetadataAddStr (outhead, PS_LIST_TAIL, "XSRCNAME", PS_META_REPLACE, "name of XSRC table extension", xsrcname);421 }422 if (xfitname) {423 psMetadataAddStr (outhead, PS_LIST_TAIL, "XFITNAME", PS_META_REPLACE, "name of XFIT table extension", xfitname);424 }426 // if we request XSRC output, add the XSRC name to this header 427 if (xsrcname) { 428 psMetadataAddStr (outhead, PS_LIST_TAIL, "XSRCNAME", PS_META_REPLACE, "name of XSRC table extension", xsrcname); 429 } 430 if (xfitname) { 431 psMetadataAddStr (outhead, PS_LIST_TAIL, "XFITNAME", PS_META_REPLACE, "name of XFIT table extension", xfitname); 432 } 425 433 426 434 // XXX these are case-sensitive since the EXTYPE is case-sensitive … … 435 443 status = pmSourcesWrite_PS1_DEV_1 (file->fits, sources, file->header, outhead, dataname, xsrcname); 436 444 } 437 if (xsrcname) {438 if (!strcmp (exttype, "PS1_DEV_1")) {445 if (xsrcname) { 446 if (!strcmp (exttype, "PS1_DEV_1")) { 439 447 status = pmSourcesWrite_PS1_DEV_1_XSRC (file->fits, sources, xsrcname); 440 }441 }442 if (xfitname) {443 if (!strcmp (exttype, "PS1_DEV_1")) {448 } 449 } 450 if (xfitname) { 451 if (!strcmp (exttype, "PS1_DEV_1")) { 444 452 status = pmSourcesWrite_PS1_DEV_1_XFIT (file->fits, sources, xfitname); 445 }446 }453 } 454 } 447 455 if (!status) { 448 456 psError(PS_ERR_IO, false, "writing CMF data to %s with format %s\n", file->filename, exttype);
Note:
See TracChangeset
for help on using the changeset viewer.
