IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 12, 2010, 12:56:07 PM (16 years ago)
Author:
Paul Price
Message:

Implementing better Jacobian correction. Previously, was calculating Jacobian from the projections (tangent plane --> sky), which does not account for scales in the transformations from the pixels to the tangent plane. Now using the local linear mapping to provide the Jacobian, so that it's applied on small areas. Also using the (square root of the) Jacobian to fix the plate scale of the covariance (instead of a single value for the entire focal plane) so the noise model should be more accurate as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/pap/pswarp/src/pswarpTransformReadout.c

    r27096 r27933  
    148148    psThreadJob *job = NULL;
    149149    int xMin = output->image->numCols, xMax = 0, yMin = output->image->numRows, yMax = 0; // Bounds
    150     int goodPixels = 0;                 // total number of good pixels across all tiles
     150    int goodPixels = psMetadataLookupS32(&mdok, output->analysis, PSWARP_ANALYSIS_GOODPIX); // Number of pixels
    151151    psList *covariances = psMetadataLookupPtr(&mdok, output->analysis,
    152152                                              PSWARP_ANALYSIS_COVARIANCES); // Collection of covar. matrices
     
    157157        psFree(covariances);            // Drop reference; still have the copy on the analysis metadata
    158158    }
     159    double jacobian = psMetadataLookupF64(&mdok, output->analysis, PSWARP_ANALYSIS_JACOBIAN); // Jacobian
     160    if (!isfinite(jacobian)) {
     161        jacobian = 0.0;
     162    }
     163
    159164    while ((job = psThreadJobGetDone()) != NULL) {
    160165        if (job->args->n < 1) {
     
    171176                psListAdd(covariances, PS_LIST_TAIL, args->covariance);
    172177            }
     178            if (args->goodPixels > 0 && isfinite(args->jacobian)) {
     179                jacobian += args->jacobian * args->goodPixels;
     180            }
    173181        }
    174182        psFree(job);
    175183    }
    176184    psFree(grid);
     185
     186    psMetadataAddS32(output->analysis, PS_LIST_TAIL, PSWARP_ANALYSIS_GOODPIX, PS_META_REPLACE,
     187                     "Number of good pixels", goodPixels);
     188    psMetadataAddF64(output->analysis, PS_LIST_TAIL, PSWARP_ANALYSIS_JACOBIAN, PS_META_REPLACE,
     189                     "Jacobian of transformation", jacobian);
    177190
    178191    if (xMin < xMax && yMin < yMax) {
Note: See TracChangeset for help on using the changeset viewer.