Changeset 28006 for trunk/pswarp/src/pswarpLoop.c
- Timestamp:
- May 18, 2010, 2:34:09 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
pswarp/src/pswarpLoop.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/pap (added) merged: 27707-27709,27726-27727,27732-27733,27787,27791-27792,27933,28003-28005 /branches/pap_delete removed
- Property svn:mergeinfo changed
-
trunk/pswarp/src/pswarpLoop.c
r27387 r28006 267 267 } 268 268 269 // Correct image for change in the plate scale270 {271 psAssert(input && input->fpa && input->fpa->toSky, "Require astrometry for input");272 psAssert(outFPA && outFPA && outFPA->toSky, "Require astrometry for output");273 274 double inScale = input->fpa->toSky->Xs + input->fpa->toSky->Ys; // Plate scale for input275 double outScale = outFPA->toSky->Xs + outFPA->toSky->Ys; // Plate scale for output276 float correction = PS_SQR(outScale / inScale); // Correction factor to apply to image277 psLogMsg("pswarp", PS_LOG_INFO, "Correcting flux by %f to account for pixel scales", correction);278 279 psBinaryOp(output->image, output->image, "*", psScalarAlloc(correction, PS_TYPE_F32));280 if (output->variance) {281 psBinaryOp(output->variance, output->variance, "*",282 psScalarAlloc(PS_SQR(correction), PS_TYPE_F32));283 }284 }285 286 287 269 // Set covariance matrix for output 288 270 { … … 291 273 psAssert(covariances, "Should be there"); 292 274 psArray *covars = psListToArray(covariances); // Array of covariance matrices 293 output->covariance= psImageCovarianceAverage(covars);275 psKernel *covar = psImageCovarianceAverage(covars); 294 276 psFree(covars); 295 277 psMetadataRemoveKey(output->analysis, PSWARP_ANALYSIS_COVARIANCES); 278 279 // Correct covariance matrix scale for the mean (square root of the) Jacobian 280 double jacobian = psMetadataLookupF64(NULL, output->analysis, PSWARP_ANALYSIS_JACOBIAN); // Jacobian 281 int goodPixels = psMetadataLookupS32(NULL, output->analysis, PSWARP_ANALYSIS_GOODPIX); // Good pixels 282 jacobian /= goodPixels; 283 output->covariance = psImageCovarianceScale(covar, jacobian); 284 psFree(covar); 285 296 286 psImageCovarianceTransfer(output->variance, output->covariance); 297 287 }
Note:
See TracChangeset
for help on using the changeset viewer.
