Changeset 41895 for trunk/psastro/src/psastroMosaicOneChip.c
- Timestamp:
- Nov 4, 2021, 6:08:21 PM (5 years ago)
- Location:
- trunk/psastro
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/psastroMosaicOneChip.c (modified) (6 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/psastroMosaicOneChip.c
r39926 r41895 23 23 bool status; 24 24 char errorWord[64]; 25 char stdevWord[64]; 25 26 char orderWord[64]; 26 27 … … 44 45 45 46 // allowed limits for valid solutions 47 // CERROR is currently tested during the iterations, but not CERSTD 46 48 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"); 49 snprintf (stdevWord, 64, "PSASTRO.MOSAIC.MAX.STDEV.N%d", iteration); 50 REQUIRED_RECIPE_VALUE (float maxError, errorWord, F32, "failed to find single-chip max allowed error\n"); 51 REQUIRED_RECIPE_VALUE (float maxStdev, stdevWord, F32, "failed to find single-chip max allowed stdev\n"); 52 REQUIRED_RECIPE_VALUE (int minNstar, "PSASTRO.MOSAIC.MIN.NSTAR", S32, "failed to find single-chip min allowed stars\n"); 49 53 50 54 // set the order of the per-chip fit (higher order only if iteration > 0) … … 88 92 } 89 93 } else { 94 // Forward transformations (chip->fpa->tpa->sky) use Ordinary polynomials 90 95 psFree (chip->toFPA); 91 chip->toFPA = psPlaneTransformAlloc (order, order );96 chip->toFPA = psPlaneTransformAlloc (order, order, PS_POLYNOMIAL_ORD); 92 97 for (int i = 0; i <= chip->toFPA->x->nX; i++) { 93 98 for (int j = 0; j <= chip->toFPA->x->nY; j++) { … … 134 139 int astNstar = results->yStats->clippedNvalues; 135 140 141 // astStdev is the average 1D stdev of median residuals in arcsec ('results' are in FPA units = microns) 142 // the median residuals are calculated in a grid of N x N bins 143 float astStdev = 0.5*(results->dXstdev + results->dYstdev) * plateScale; 144 136 145 // if we clip away too many stars, the order may be invalid 137 146 if (order == 3) { minNstar = PS_MAX (15, minNstar); } … … 141 150 bool validSolution = true; 142 151 143 // XXX should these result in errors or be handled another way?144 psLogMsg ("psastro", PS_LOG_INFO, "astrometry solution: error: %f arcsec, Nstars: %d ", astError, astNstar);152 // We have options to exclude chips on the basis of NASTRO, CERROR, CERSTD 153 psLogMsg ("psastro", PS_LOG_INFO, "astrometry solution: error: %f arcsec, Nstars: %d, stdev: %f arcsec", astError, astNstar, astStdev); 145 154 if ((maxError > 0) && (astError > maxError)) { 146 155 psLogMsg("psastro", PS_LOG_INFO, "residual error is too large, failed to find a solution: %f > %f", astError, maxError); 147 156 validSolution = false; 148 157 } 158 if ((maxStdev > 0) && (astStdev > maxStdev)) { 159 psLogMsg("psastro", PS_LOG_INFO, "residual stdev is too large, failed to find a solution: %f > %f", astStdev, maxStdev); 160 validSolution = false; 161 } 149 162 if (astNstar < minNstar) { 150 163 psLogMsg("psastro", PS_LOG_INFO, "solution uses too few stars: %d < %d", astNstar, minNstar); … … 152 165 } 153 166 154 // DVO expects NASTRO = 0 if we fail to find a solution 167 // DVO expects NASTRO = 0 if we fail to find a solution, NASTUSED is the true number 155 168 psMetadataAddF32 (updates, PS_LIST_TAIL, "PERROR", PS_META_REPLACE, "astrometry error (pixels)", pixError); 156 169 psMetadataAddF32 (updates, PS_LIST_TAIL, "CERROR", PS_META_REPLACE, "astrometry error (arcsec)", astError); 170 psMetadataAddF32 (updates, PS_LIST_TAIL, "CERSTD", PS_META_REPLACE, "astrometry stdev (arcsec)", astStdev); 157 171 if (validSolution) { 158 172 psMetadataAddF32 (updates, PS_LIST_TAIL, "CPRECISE", PS_META_REPLACE, "astrometry precision (arcsec)", astError/sqrt(astNstar)); 159 173 psMetadataAddS32 (updates, PS_LIST_TAIL, "NASTRO", PS_META_REPLACE, "number of astrometry stars", astNstar); 174 psMetadataAddS32 (updates, PS_LIST_TAIL, "NASTUSED", PS_META_REPLACE, "number of astrometry stars", astNstar); 160 175 } else { 161 176 psMetadataAddF32 (updates, PS_LIST_TAIL, "CPRECISE", PS_META_REPLACE, "astrometry precision (arcsec)", 0.0); 162 177 psMetadataAddS32 (updates, PS_LIST_TAIL, "NASTRO", PS_META_REPLACE, "number of astrometry stars", 0); 178 psMetadataAddS32 (updates, PS_LIST_TAIL, "NASTUSED", PS_META_REPLACE, "number of astrometry stars", astNstar); 163 179 } 164 180 psMetadataAddF32 (updates, PS_LIST_TAIL, "EQUINOX", PS_META_REPLACE, "", 2000.0); // XXX this is bogus: should be defined based on equinox of refstars
Note:
See TracChangeset
for help on using the changeset viewer.
