IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 3, 2021, 11:52:26 AM (5 years ago)
Author:
eugene
Message:

improved comments; add CERSTD to output stats and header; add good/bad tests based on PSASTRO.MAX.STDEV, PSASTRO.MOSAIC.MAX.STDEV.Nn; add NASTUSED field to track actual number of stars used for astrometry in bad cases (when NASTRO is forced to 0)

Location:
branches/eam_branches/ipp-dev-20210817/psastro/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-dev-20210817/psastro/src/psastroAstromGuess.c

    r41833 r41877  
    342342        if (!updates) goto skip_chip;
    343343
     344        // in psastroOneChipFit & psastroMosaicOneCihp, astrometry failures are marked with NASTRO = 0
     345        // these should be ignored when checking the overall solution
    344346        int nAstro = psMetadataLookupS32 (&status, updates, "NASTRO");
    345347        if (!nAstro) goto skip_chip;
    346348
     349        // it is not clear when astError = 0.0
    347350        float astError = psMetadataLookupF32 (&status, updates, "CERROR");
    348351        if (fabs(astError) < 1e-6) goto skip_chip;
  • branches/eam_branches/ipp-dev-20210817/psastro/src/psastroMetadataStats.c

    r41071 r41877  
    3737        psMetadataItemSupplement(&status, stats, header, "ZPT_ERR");
    3838        psMetadataItemSupplement(&status, stats, header, "CERROR");
     39        psMetadataItemSupplement(&status, stats, header, "CERSTD");
    3940        psMetadataItemSupplement(&status, stats, header, "NASTRO");
    4041        psMetadataItemSupplement(&status, stats, header, "AST_R0");
  • branches/eam_branches/ipp-dev-20210817/psastro/src/psastroMosaicOneChip.c

    r41833 r41877  
    4444
    4545    // allowed limits for valid solutions
     46    // CERROR is currently tested during the iterations, but not CERSTD
    4647    snprintf (errorWord, 64, "PSASTRO.MOSAIC.MAX.ERROR.N%d", iteration);
    47     REQUIRED_RECIPE_VALUE (float maxError, errorWord, F32, "failed to find single-chip max allowed error\n");
    48     REQUIRED_RECIPE_VALUE (int minNstar, "PSASTRO.MOSAIC.MIN.NSTAR", S32, "failed to find single-chip min allowed stars\n");
     48    snprintf (stdevWord, 64, "PSASTRO.MOSAIC.MAX.STDEV.N%d", iteration);
     49    REQUIRED_RECIPE_VALUE (float maxError,                  errorWord, F32, "failed to find single-chip max allowed error\n");
     50    REQUIRED_RECIPE_VALUE (float maxStdev,                  stdevWord, F32, "failed to find single-chip max allowed stdev\n");
     51    REQUIRED_RECIPE_VALUE (int   minNstar, "PSASTRO.MOSAIC.MIN.NSTAR", S32, "failed to find single-chip min allowed stars\n");
    4952
    5053    // set the order of the per-chip fit (higher order only if iteration > 0)
     
    146149    bool validSolution = true;
    147150
    148     // XXX should these result in errors or be handled another way?
    149     // psLogMsg ("psastro", PS_LOG_INFO, "astrometry solution: error: %f arcsec, Nstars: %d", astError, astNstar);
     151    // We have options to exclude chips on the basis of NASTRO, CERROR, CERSTD
    150152    psLogMsg ("psastro", PS_LOG_INFO, "astrometry solution: error: %f arcsec, Nstars: %d, stdev: %f arcsec", astError, astNstar, astStdev);
    151153    if ((maxError > 0) && (astError > maxError)) {
    152154        psLogMsg("psastro", PS_LOG_INFO, "residual error is too large, failed to find a solution: %f > %f", astError, maxError);
     155        validSolution = false;
     156    }
     157    if ((maxStdev > 0) && (astStdev > maxStdev)) {
     158        psLogMsg("psastro", PS_LOG_INFO, "residual stdev is too large, failed to find a solution: %f > %f", astStdev, maxStdev);
    153159        validSolution = false;
    154160    }
     
    158164    }
    159165
    160     // DVO expects NASTRO = 0 if we fail to find a solution
     166    // DVO expects NASTRO = 0 if we fail to find a solution, NASTUSED is the true number
    161167    psMetadataAddF32 (updates, PS_LIST_TAIL, "PERROR",   PS_META_REPLACE, "astrometry error (pixels)", pixError);
    162168    psMetadataAddF32 (updates, PS_LIST_TAIL, "CERROR",   PS_META_REPLACE, "astrometry error (arcsec)", astError);
     
    165171        psMetadataAddF32 (updates, PS_LIST_TAIL, "CPRECISE", PS_META_REPLACE, "astrometry precision (arcsec)", astError/sqrt(astNstar));
    166172        psMetadataAddS32 (updates, PS_LIST_TAIL, "NASTRO",   PS_META_REPLACE, "number of astrometry stars", astNstar);
     173        psMetadataAddS32 (updates, PS_LIST_TAIL, "NASTUSED", PS_META_REPLACE, "number of astrometry stars", astNstar);
    167174    } else {
    168175        psMetadataAddF32 (updates, PS_LIST_TAIL, "CPRECISE", PS_META_REPLACE, "astrometry precision (arcsec)", 0.0);
    169176        psMetadataAddS32 (updates, PS_LIST_TAIL, "NASTRO",   PS_META_REPLACE, "number of astrometry stars", 0);
     177        psMetadataAddS32 (updates, PS_LIST_TAIL, "NASTUSED", PS_META_REPLACE, "number of astrometry stars", astNstar);
    170178    }
    171179    psMetadataAddF32 (updates, PS_LIST_TAIL, "EQUINOX",  PS_META_REPLACE, "", 2000.0); // XXX this is bogus: should be defined based on equinox of refstars
  • branches/eam_branches/ipp-dev-20210817/psastro/src/psastroOneChipFit.c

    r41833 r41877  
    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;
     
    208209        validSolution = false;
    209210    }
     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    }
    210215    if (astNstar < minNstar) {
    211216        psLogMsg("psastro", PS_LOG_INFO, "solution uses too few stars: %d < %d", astNstar, minNstar);
     
    220225        psMetadataAddF32 (updates, PS_LIST_TAIL, "CPRECISE", PS_META_REPLACE, "astrometry precision (arcsec)", astError/sqrt(astNstar));
    221226        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);
    222228    } else {
    223229        psastroChipFailureHeader (updates);
     230        psMetadataAddS32 (updates, PS_LIST_TAIL, "NASTUSED", PS_META_REPLACE, "number of astrometry stars", astNstar);
    224231    }
    225232    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.