IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 4, 2021, 6:08:21 PM (5 years ago)
Author:
eugene
Message:

merge changes from eam_branches/ipp-dev-20210817 (add CERSTD, NASTUSED to header, allow rejection no CERSTD, add psastroTIO)

Location:
trunk/psastro
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psastro

  • trunk/psastro/src/psastroOneChipFit.c

    r41285 r41895  
    4040    // allowed limits for valid solutions
    4141    REQUIRED_RECIPE_VALUE (float maxError, "PSASTRO.MAX.ERROR", F32);
    42     REQUIRED_RECIPE_VALUE (int minNstar, "PSASTRO.MIN.NSTAR", S32);
     42    REQUIRED_RECIPE_VALUE (float maxStdev, "PSASTRO.MAX.STDEV", F32);
     43    REQUIRED_RECIPE_VALUE (int   minNstar, "PSASTRO.MIN.NSTAR", S32);
    4344
    4445    psArray *match = NULL;
     
    121122        }
    122123
    123         // create output toFPA; set masks appropriate to the Elixir DVO astrometry format
     124        // Create output toFPA; set masks appropriate to the Elixir DVO astrometry format.
     125        // Forward transformations (chip->fpa->tpa->sky) use Ordinary polynomials
    124126        psFree (chip->toFPA);
    125         chip->toFPA = psPlaneTransformAlloc (order, order);
     127        chip->toFPA = psPlaneTransformAlloc (order, order, PS_POLYNOMIAL_ORD);
    126128        for (int i = 0; i <= chip->toFPA->x->nX; i++) {
    127129            for (int j = 0; j <= chip->toFPA->x->nY; j++) {
     
    192194    float astError = 0.5*(rawXstdev + rawYstdev) * plateScale;
    193195
     196    // astStdev is the average 1D stdev of median residuals in arcsec ('results' are in FPA units = microns)
     197    // the median residuals are calculated in a grid of N x N bins
     198    float astStdev = 0.5*(results->dXstdev + results->dYstdev) * plateScale;
     199
    194200    // x and y are forced to use the same subset of values:
    195201    int astNstar = results->yStats->clippedNvalues;
     
    198204
    199205    // XXX should these result in errors or be handled another way?
    200     psLogMsg ("psastro", PS_LOG_INFO, "astrometry solution: error: %f arcsec, Nstars: %d", astError, astNstar);
     206    psLogMsg ("psastro", PS_LOG_INFO, "astrometry solution: error: %f arcsec, Nstars: %d, stdev: %f arcsec", astError, astNstar, astStdev);
    201207    if (astError > maxError) {
    202208        psLogMsg("psastro", PS_LOG_INFO, "residual error is too large, failed to find a solution: %f > %f", astError, maxError);
    203209        validSolution = false;
    204210    }
     211    if (astStdev > maxStdev) {
     212        psLogMsg("psastro", PS_LOG_INFO, "residual stdev is too large, failed to find a solution: %f > %f", astStdev, maxStdev);
     213        validSolution = false;
     214    }
    205215    if (astNstar < minNstar) {
    206216        psLogMsg("psastro", PS_LOG_INFO, "solution uses too few stars: %d < %d", astNstar, minNstar);
     
    211221    psMetadataAddF32 (updates, PS_LIST_TAIL, "PERROR",   PS_META_REPLACE, "astrometry error (pixels)", pixError);
    212222    psMetadataAddF32 (updates, PS_LIST_TAIL, "CERROR",   PS_META_REPLACE, "astrometry error (arcsec)", astError);
     223    psMetadataAddF32 (updates, PS_LIST_TAIL, "CERSTD",   PS_META_REPLACE, "astrometry stdev (arcsec)", astStdev);
    213224    if (validSolution) {
    214225        psMetadataAddF32 (updates, PS_LIST_TAIL, "CPRECISE", PS_META_REPLACE, "astrometry precision (arcsec)", astError/sqrt(astNstar));
    215226        psMetadataAddS32 (updates, PS_LIST_TAIL, "NASTRO",   PS_META_REPLACE, "number of astrometry stars", astNstar);
     227        psMetadataAddS32 (updates, PS_LIST_TAIL, "NASTUSED", PS_META_REPLACE, "number of astrometry stars", astNstar);
    216228    } else {
    217229        psastroChipFailureHeader (updates);
     230        psMetadataAddS32 (updates, PS_LIST_TAIL, "NASTUSED", PS_META_REPLACE, "number of astrometry stars", astNstar);
    218231    }
    219232    psMetadataAddF32 (updates, PS_LIST_TAIL, "EQUINOX",  PS_META_REPLACE, "equinox of ref catalog", 2000.0); // XXX this is bogus: should be defined based on equinox of refstars
Note: See TracChangeset for help on using the changeset viewer.