Changeset 25979
- Timestamp:
- Nov 1, 2009, 3:52:39 PM (17 years ago)
- Location:
- trunk/psModules/src
- Files:
-
- 9 edited
-
camera/pmFPAfile.h (modified) (1 diff)
-
camera/pmFPAfileIO.c (modified) (1 diff)
-
objects/pmPSF_IO.c (modified) (4 diffs)
-
objects/pmSourceIO_PS1_CAL_0.c (modified) (1 diff)
-
objects/pmSourceIO_PS1_DEV_0.c (modified) (1 diff)
-
objects/pmSourceIO_PS1_DEV_1.c (modified) (1 diff)
-
objects/pmSourceIO_SMPDATA.c (modified) (2 diffs)
-
objects/pmSourceMoments.c (modified) (1 diff)
-
objects/pmSourceVisual.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAfile.h
r23487 r25979 48 48 PM_FPA_FILE_ASTROM_REFSTARS, 49 49 PM_FPA_FILE_SUBKERNEL, 50 PM_FPA_FILE_SRCTEXT, 50 51 } pmFPAfileType; 51 52 -
trunk/psModules/src/camera/pmFPAfileIO.c
r25880 r25979 208 208 case PM_FPA_FILE_CMF: 209 209 case PM_FPA_FILE_WCS: 210 case PM_FPA_FILE_SRCTEXT: 210 211 status = pmFPAviewReadObjects (view, file, config); 211 212 break; -
trunk/psModules/src/objects/pmPSF_IO.c
r25854 r25979 49 49 #include "pmSource.h" 50 50 #include "pmModelClass.h" 51 #include "pmModelUtils.h" 51 52 #include "pmSourceIO.h" 52 53 … … 267 268 } 268 269 residName = pmFPAfileNameFromRule (rule, file, view); 270 271 // EXTNAME for psf image 272 // rule = psMetadataLookupStr(&status, menu, "PSF.RESID"); 273 // if (!rule) { 274 // psError(PS_ERR_UNKNOWN, false, "missing entry for PSF.RESID in EXTNAME.RULES in camera.config"); 275 // psFree (headName); 276 // psFree (tableName); 277 // psFree(hdu); 278 // return false; 279 // } 280 // residName = pmFPAfileNameFromRule (rule, file, view); 269 281 } 270 282 … … 477 489 } 478 490 491 // write a representation of the psf model 492 { 493 psMetadata *header = psMetadataAlloc (); 494 495 if (0) { 496 // set some header keywords to make it clear there are no residuals? 497 psFitsWriteBlank (file->fits, header, residName); 498 psFree (residName); 499 psFree (header); 500 return true; 501 } 502 503 int DX = 65; 504 int DY = 65; 505 506 psImage *psfMosaic = psImageAlloc (DX, DY, PS_TYPE_F32); 507 psImageInit (psfMosaic, 0.0); 508 509 pmModel *modelRef = pmModelAlloc(psf->type); 510 511 // use the center of the center pixel of the image 512 float xc = 0.5*psf->fieldNx; 513 float yc = 0.5*psf->fieldNy; 514 515 // assign the x and y coords to the image center 516 // create an object with center intensity of 1000 517 modelRef->params->data.F32[PM_PAR_SKY] = 0; 518 modelRef->params->data.F32[PM_PAR_I0] = 1.000; 519 modelRef->params->data.F32[PM_PAR_XPOS] = xc; 520 modelRef->params->data.F32[PM_PAR_YPOS] = yc; 521 522 // create modelPSF from this model 523 pmModel *model = pmModelFromPSF (modelRef, psf); 524 if (model) { 525 // place the reference object in the image center 526 pmModelAddWithOffset (psfMosaic, NULL, model, PM_MODEL_OP_FULL | PM_MODEL_OP_CENTER, 0, 0.0, 0.0); 527 psFree (model); 528 529 if (false) { 530 // this call creates an extension with NAXIS3 = 3 531 psArray *images = psArrayAllocEmpty (3); 532 psArrayAdd (images, 1, psfMosaic); 533 // psArrayAdd (images, 1, psfModel); 534 // psArrayAdd (images, 1, psfModel); 535 536 psFitsWriteImageCube (file->fits, header, images, "PSF_MODEL"); 537 psFree (images); 538 } else { 539 // this call creates an extension with NAXIS3 = 1 540 // XXX need to replace PSF_MODEL with rule-based name like residName 541 psFitsWriteImage(file->fits, header, psfMosaic, 0, "PSF_MODEL"); 542 } 543 } 544 545 psFree (psfMosaic); 546 psFree (modelRef); 547 psFree (header); 548 } 549 479 550 return true; 480 551 … … 693 764 psMetadataAddF32 (regionMD, PS_LIST_TAIL, "PSF.CLUMP.DY", PS_META_REPLACE, "psf clump center", psfClump.dY); 694 765 } else { 695 psMetadataAddS32 ( recipe, PS_LIST_TAIL, "PSF.CLUMP.NREGIONS", PS_META_REPLACE, "psf clump regions", nRegions);766 psMetadataAddS32 (analysis, PS_LIST_TAIL, "PSF.CLUMP.NREGIONS", PS_META_REPLACE, "psf clump regions", nRegions); 696 767 697 768 for (int i = 0; i < nRegions; i++) { -
trunk/psModules/src/objects/pmSourceIO_PS1_CAL_0.c
r25754 r25979 282 282 pmPSF_AxesToModel (PAR, axes); 283 283 284 float lflux = psMetadataLookupF32 (&status, row, "PEAK_FLUX_AS_MAG"); 285 float flux = (isfinite(lflux)) ? pow(10.0, -0.4*lflux) : NAN; 286 source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], flux, PM_PEAK_LONE); 287 source->peak->flux = flux; 284 float peakMag = psMetadataLookupF32 (&status, row, "PEAK_FLUX_AS_MAG"); 285 float peakFlux = (isfinite(peakMag)) ? pow(10.0, -0.4*peakMag) : NAN; 286 287 source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE); 288 source->peak->flux = peakFlux; 289 source->peak->dx = dPAR[PM_PAR_XPOS]; 290 source->peak->dy = dPAR[PM_PAR_YPOS]; 288 291 289 292 source->pixWeight = psMetadataLookupF32 (&status, row, "PSF_QF"); -
trunk/psModules/src/objects/pmSourceIO_PS1_DEV_0.c
r20937 r25979 208 208 pmPSF_AxesToModel (PAR, axes); 209 209 210 float lflux = psMetadataLookupF32 (&status, row, "PEAK_FLUX_AS_MAG"); 211 float flux = (isfinite(lflux)) ? pow(10.0, -0.4*lflux) : NAN; 212 source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], flux, PM_PEAK_LONE); 213 source->peak->flux = flux; 210 float peakMag = psMetadataLookupF32 (&status, row, "PEAK_FLUX_AS_MAG"); 211 float peakFlux = (isfinite(peakMag)) ? pow(10.0, -0.4*peakMag) : NAN; 212 213 source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE); 214 source->peak->flux = peakFlux; 215 source->peak->dx = dPAR[PM_PAR_XPOS]; 216 source->peak->dy = dPAR[PM_PAR_YPOS]; 214 217 215 218 source->pixWeight = psMetadataLookupF32 (&status, row, "PSF_QF"); -
trunk/psModules/src/objects/pmSourceIO_PS1_DEV_1.c
r25754 r25979 252 252 pmPSF_AxesToModel (PAR, axes); 253 253 254 float lflux = psMetadataLookupF32 (&status, row, "PEAK_FLUX_AS_MAG"); 255 float flux = (isfinite(lflux)) ? pow(10.0, -0.4*lflux) : NAN; 256 source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], flux, PM_PEAK_LONE); 257 source->peak->flux = flux; 254 float peakMag = psMetadataLookupF32 (&status, row, "PEAK_FLUX_AS_MAG"); 255 float peakFlux = (isfinite(peakMag)) ? pow(10.0, -0.4*peakMag) : NAN; 256 257 source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE); 258 source->peak->flux = peakFlux; 259 source->peak->dx = dPAR[PM_PAR_XPOS]; 260 source->peak->dy = dPAR[PM_PAR_YPOS]; 258 261 259 262 source->pixWeight = psMetadataLookupF32 (&status, row, "PSF_QF"); -
trunk/psModules/src/objects/pmSourceIO_SMPDATA.c
r20937 r25979 184 184 pmPSF_AxesToModel (PAR, axes); 185 185 186 187 186 source->psfMag = psMetadataLookupF32 (&status, row, "MAG_RAW") - ZERO_POINT; 188 187 source->extMag = psMetadataLookupF32 (&status, row, "MAG_GAL") - ZERO_POINT; … … 198 197 199 198 source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE); 199 source->peak->flux = peakFlux; 200 200 201 sources->data[i] = source; 201 202 } -
trunk/psModules/src/objects/pmSourceMoments.c
r25754 r25979 135 135 // stars. 136 136 if (PS_SQR(pDiff) < minSN2*wDiff) continue; 137 if (pDiff < 0) continue; 137 if (pDiff < 0) continue; // XXX : MWV says I should include < 0.0 valued points... 138 138 139 139 // Apply a Gaussian window function. Be careful with the window function. S/N -
trunk/psModules/src/objects/pmSourceVisual.c
r25754 r25979 388 388 KapaPlotVector (kapa1, y->n, model->data.F32, "y"); 389 389 390 psFree (xm); 391 psFree (ym); 392 psFree (Fm); 393 390 394 psFree (resid); 391 395 psFree (model);
Note:
See TracChangeset
for help on using the changeset viewer.
