- Timestamp:
- May 3, 2010, 8:41:49 AM (16 years ago)
- Location:
- branches/tap_branches
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/tap_branches
- Property svn:mergeinfo changed
-
branches/tap_branches/psModules
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk/psModules merged eligible /branches/eam_branches/stackphot.20100406/psModules 27623-27653 /branches/pap_delete/psModules 27530-27595
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/tap_branches/psModules/src/objects/pmSourceIO_CMF_PS1_V1.c
r25754 r27838 69 69 float magOffset = NAN; 70 70 float exptime = psMetadataLookupF32 (&status1, fpa->concepts, "FPA.EXPOSURE"); 71 float zeropt = psMetadataLookupF32 (&status2, imageHeader, "ZPT_OBS"); 72 float zeroptErr = psMetadataLookupF32 (&status2, imageHeader, "ZPT_ERR"); 71 float zeropt = psMetadataLookupF32(&status2, fpa->concepts, "FPA.ZP"); 72 if (!isfinite(zeropt)) { 73 zeropt = psMetadataLookupF32 (&status2, imageHeader, "ZPT_OBS"); 74 } 73 75 if (status1 && status2 && (exptime > 0.0)) { 74 76 magOffset = zeropt + 2.5*log10(exptime); 75 77 } 78 float zeroptErr = psMetadataLookupF32 (&status2, imageHeader, "ZPT_ERR"); 76 79 77 80 // if the sequence is defined, write these in seq order; otherwise … … 213 216 214 217 if (table->n == 0) { 215 psFitsWriteBlank(fits, header, extname); 218 if (!psFitsWriteBlank(fits, header, extname)) { 219 psError(psErrorCodeLast(), false, "Unable to write empty sources file."); 220 psFree(table); 221 psFree(header); 222 return false; 223 } 216 224 psFree(table); 217 225 psFree(header); … … 221 229 psTrace ("pmFPAfile", 5, "writing ext data %s\n", extname); 222 230 if (!psFitsWriteTable(fits, header, table, extname)) { 223 psError( PS_ERR_IO, false, "writing ext data %s\n", extname);231 psError(psErrorCodeLast(), false, "writing ext data %s\n", extname); 224 232 psFree(table); 225 233 psFree(header); … … 331 339 332 340 // XXX this layout is still the same as PS1_DEV_1 333 bool pmSourcesWrite_CMF_PS1_V1_XSRC (psFits *fits, p sArray *sources, char *extname, psMetadata *recipe)341 bool pmSourcesWrite_CMF_PS1_V1_XSRC (psFits *fits, pmReadout *readout, psArray *sources, psMetadata *imageHeader, char *extname, psMetadata *recipe) 334 342 { 335 343 … … 477 485 } 478 486 479 # endif 487 # endif 480 488 psArrayAdd (table, 100, row); 481 489 psFree (row); … … 483 491 484 492 if (table->n == 0) { 485 psFitsWriteBlank (fits, outhead, extname); 493 if (!psFitsWriteBlank (fits, outhead, extname)) { 494 psError(psErrorCodeLast(), false, "Unable to write empty sources."); 495 psFree(outhead); 496 psFree(table); 497 return false; 498 } 486 499 psFree (outhead); 487 500 psFree (table); … … 491 504 psTrace ("pmFPAfile", 5, "writing ext data %s\n", extname); 492 505 if (!psFitsWriteTable (fits, outhead, table, extname)) { 493 psError( PS_ERR_IO, false, "writing ext data %s\n", extname);506 psError(psErrorCodeLast(), false, "writing ext data %s\n", extname); 494 507 psFree (outhead); 495 508 psFree(table); … … 503 516 504 517 // XXX this layout is still the same as PS1_DEV_1 505 bool pmSourcesWrite_CMF_PS1_V1_XFIT (psFits *fits, p sArray *sources, char *extname)518 bool pmSourcesWrite_CMF_PS1_V1_XFIT (psFits *fits, pmReadout *readout, psArray *sources, char *extname) 506 519 { 507 520 … … 609 622 610 623 if (table->n == 0) { 611 psFitsWriteBlank (fits, outhead, extname); 624 if (!psFitsWriteBlank (fits, outhead, extname)) { 625 psError(psErrorCodeLast(), false, "Unable to write empty sources."); 626 psFree(outhead); 627 psFree(table); 628 return false; 629 } 612 630 psFree (outhead); 613 631 psFree (table); … … 617 635 psTrace ("pmFPAfile", 5, "writing ext data %s\n", extname); 618 636 if (!psFitsWriteTable (fits, outhead, table, extname)) { 619 psError( PS_ERR_IO, false, "writing ext data %s\n", extname);637 psError(psErrorCodeLast(), false, "writing ext data %s\n", extname); 620 638 psFree (outhead); 621 639 psFree(table);
Note:
See TracChangeset
for help on using the changeset viewer.
