Changeset 41895 for trunk/psastro/src/psastroOneChipFit.c
- Timestamp:
- Nov 4, 2021, 6:08:21 PM (5 years ago)
- Location:
- trunk/psastro
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/psastroOneChipFit.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-dev-20210817/psastro (added) merged: 41799,41814,41816,41822,41833,41837,41876-41877,41883,41889
- Property svn:mergeinfo changed
-
trunk/psastro/src/psastroOneChipFit.c
r41285 r41895 40 40 // allowed limits for valid solutions 41 41 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); 43 44 44 45 psArray *match = NULL; … … 121 122 } 122 123 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 124 126 psFree (chip->toFPA); 125 chip->toFPA = psPlaneTransformAlloc (order, order );127 chip->toFPA = psPlaneTransformAlloc (order, order, PS_POLYNOMIAL_ORD); 126 128 for (int i = 0; i <= chip->toFPA->x->nX; i++) { 127 129 for (int j = 0; j <= chip->toFPA->x->nY; j++) { … … 192 194 float astError = 0.5*(rawXstdev + rawYstdev) * plateScale; 193 195 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 194 200 // x and y are forced to use the same subset of values: 195 201 int astNstar = results->yStats->clippedNvalues; … … 198 204 199 205 // 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); 201 207 if (astError > maxError) { 202 208 psLogMsg("psastro", PS_LOG_INFO, "residual error is too large, failed to find a solution: %f > %f", astError, maxError); 203 209 validSolution = false; 204 210 } 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 } 205 215 if (astNstar < minNstar) { 206 216 psLogMsg("psastro", PS_LOG_INFO, "solution uses too few stars: %d < %d", astNstar, minNstar); … … 211 221 psMetadataAddF32 (updates, PS_LIST_TAIL, "PERROR", PS_META_REPLACE, "astrometry error (pixels)", pixError); 212 222 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); 213 224 if (validSolution) { 214 225 psMetadataAddF32 (updates, PS_LIST_TAIL, "CPRECISE", PS_META_REPLACE, "astrometry precision (arcsec)", astError/sqrt(astNstar)); 215 226 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); 216 228 } else { 217 229 psastroChipFailureHeader (updates); 230 psMetadataAddS32 (updates, PS_LIST_TAIL, "NASTUSED", PS_META_REPLACE, "number of astrometry stars", astNstar); 218 231 } 219 232 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.
