- Timestamp:
- May 3, 2010, 8:45:22 AM (16 years ago)
- Location:
- branches/simmosaic_branches
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/simmosaic_branches
- Property svn:mergeinfo changed
-
branches/simmosaic_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/simmosaic_branches/psModules/src/objects/pmSourceIO_CMF_PS1_V1.c
r24401 r27839 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 … … 128 131 nDOF = model->nDOF; 129 132 nPix = model->nPix; 130 apRadius = model->radiusFit; // XXX should we really use the fitRadius for aperture Radius?133 apRadius = source->apRadius; 131 134 errMag = model->dparams->data.F32[PM_PAR_I0] / model->params->data.F32[PM_PAR_I0]; 132 135 } else { … … 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); … … 308 316 source->crNsigma = psMetadataLookupF32 (&status, row, "CR_NSIGMA"); 309 317 source->extNsigma = psMetadataLookupF32 (&status, row, "EXT_NSIGMA"); 318 source->apRadius = psMetadataLookupS32 (&status, row, "AP_MAG_RADIUS"); 310 319 311 320 // note that some older versions used PSF_PROBABILITY: this was not well defined. … … 313 322 model->nDOF = psMetadataLookupS32 (&status, row, "PSF_NDOF"); 314 323 model->nPix = psMetadataLookupS32 (&status, row, "PSF_NPIX"); 315 model->radiusFit = psMetadataLookupS32 (&status, row, "AP_MAG_RADIUS");316 324 317 325 source->moments = pmMomentsAlloc (); … … 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 … … 353 361 354 362 // which extended source analyses should we perform? 355 bool doPetrosian = psMetadataLookupBool (&status, recipe, "EXTENDED_SOURCE_PETROSIAN");356 bool doIsophotal = psMetadataLookupBool (&status, recipe, "EXTENDED_SOURCE_ISOPHOTAL");357 bool doAnnuli = psMetadataLookupBool (&status, recipe, "EXTENDED_SOURCE_ANNULI");358 bool doKron = psMetadataLookupBool (&status, recipe, "EXTENDED_SOURCE_KRON");363 // bool doPetrosian = psMetadataLookupBool (&status, recipe, "EXTENDED_SOURCE_PETROSIAN"); 364 // bool doIsophotal = psMetadataLookupBool (&status, recipe, "EXTENDED_SOURCE_ISOPHOTAL"); 365 // bool doAnnuli = psMetadataLookupBool (&status, recipe, "EXTENDED_SOURCE_ANNULI"); 366 // bool doKron = psMetadataLookupBool (&status, recipe, "EXTENDED_SOURCE_KRON"); 359 367 360 368 psVector *radialBinsLower = psMetadataLookupPtr (&status, recipe, "RADIAL.ANNULAR.BINS.LOWER"); … … 396 404 psMetadataAdd (row, PS_LIST_TAIL, "Y_EXT_SIG", PS_DATA_F32, "Sigma in EXT y coordinate", yErr); 397 405 406 # if (0) 398 407 // Petrosian measurements 399 408 // XXX insert header data: petrosian ref radius, flux ratio … … 476 485 } 477 486 487 # endif 478 488 psArrayAdd (table, 100, row); 479 489 psFree (row); … … 481 491 482 492 if (table->n == 0) { 483 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 } 484 499 psFree (outhead); 485 500 psFree (table); … … 489 504 psTrace ("pmFPAfile", 5, "writing ext data %s\n", extname); 490 505 if (!psFitsWriteTable (fits, outhead, table, extname)) { 491 psError( PS_ERR_IO, false, "writing ext data %s\n", extname);506 psError(psErrorCodeLast(), false, "writing ext data %s\n", extname); 492 507 psFree (outhead); 493 508 psFree(table); … … 501 516 502 517 // XXX this layout is still the same as PS1_DEV_1 503 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) 504 519 { 505 520 … … 607 622 608 623 if (table->n == 0) { 609 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 } 610 630 psFree (outhead); 611 631 psFree (table); … … 615 635 psTrace ("pmFPAfile", 5, "writing ext data %s\n", extname); 616 636 if (!psFitsWriteTable (fits, outhead, table, extname)) { 617 psError( PS_ERR_IO, false, "writing ext data %s\n", extname);637 psError(psErrorCodeLast(), false, "writing ext data %s\n", extname); 618 638 psFree (outhead); 619 639 psFree(table);
Note:
See TracChangeset
for help on using the changeset viewer.
