Changeset 41895 for trunk/psastro
- Timestamp:
- Nov 4, 2021, 6:08:21 PM (5 years ago)
- Location:
- trunk/psastro
- Files:
-
- 14 edited
- 5 copied
-
. (modified) (1 prop)
-
src/Makefile.am (modified) (3 diffs)
-
src/psastroAstromGuess.c (modified) (2 diffs)
-
src/psastroConvert.c (modified) (1 diff)
-
src/psastroFixChips.c (modified) (2 diffs)
-
src/psastroMetadataStats.c (modified) (1 diff)
-
src/psastroMosaicAstrom.c (modified) (1 diff)
-
src/psastroMosaicChipAstrom.c (modified) (1 diff)
-
src/psastroMosaicCorrectDistortion.c (modified) (1 diff)
-
src/psastroMosaicFPtoTP.c (modified) (1 diff)
-
src/psastroMosaicGradients.c (modified) (1 diff)
-
src/psastroMosaicOneChip.c (modified) (6 diffs)
-
src/psastroOneChipFit.c (modified) (5 diffs)
-
src/psastroTIO.c (copied) (copied from branches/eam_branches/ipp-dev-20210817/psastro/src/psastroTIO.c )
-
src/psastroTIOArguments.c (copied) (copied from branches/eam_branches/ipp-dev-20210817/psastro/src/psastroTIOArguments.c )
-
src/psastroTIODataLoad.c (copied) (copied from branches/eam_branches/ipp-dev-20210817/psastro/src/psastroTIODataLoad.c )
-
src/psastroTIODataSave.c (copied) (copied from branches/eam_branches/ipp-dev-20210817/psastro/src/psastroTIODataSave.c )
-
src/psastroTIOParseCamera.c (copied) (copied from branches/eam_branches/ipp-dev-20210817/psastro/src/psastroTIOParseCamera.c )
-
src/psastroUtils.c (modified) (1 diff)
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/Makefile.am
r41705 r41895 10 10 libpsastro_la_LDFLAGS = $(PSASTRO_LIBS) $(PPSTATS_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) 11 11 12 bin_PROGRAMS = psastro psastroExtract psastroModel psastroModelFit gpcModel 12 bin_PROGRAMS = psastro psastroExtract psastroModel psastroModelFit gpcModel psastroTIO 13 13 14 14 psastro_CFLAGS = $(PSASTRO_CFLAGS) $(PPSTATS_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) … … 31 31 gpcModel_LDFLAGS = $(PSASTRO_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) 32 32 gpcModel_LDADD = libpsastro.la 33 34 psastroTIO_CFLAGS = $(PSASTRO_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) 35 psastroTIO_LDFLAGS = $(PSASTRO_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) 36 psastroTIO_LDADD = libpsastro.la 33 37 34 38 psastro_SOURCES = \ … … 62 66 psastroModelAdjust.c \ 63 67 psastroModelDataSave.c \ 68 psastroCleanup.c 69 70 psastroTIO_SOURCES = \ 71 psastroTIO.c \ 72 psastroTIOArguments.c \ 73 psastroTIOParseCamera.c \ 74 psastroTIODataLoad.c \ 75 psastroTIODataSave.c \ 64 76 psastroCleanup.c 65 77 -
trunk/psastro/src/psastroAstromGuess.c
r39926 r41895 342 342 if (!updates) goto skip_chip; 343 343 344 // in psastroOneChipFit & psastroMosaicOneCihp, astrometry failures are marked with NASTRO = 0 345 // these should be ignored when checking the overall solution 344 346 int nAstro = psMetadataLookupS32 (&status, updates, "NASTRO"); 345 347 if (!nAstro) goto skip_chip; 346 348 349 // it is not clear when astError = 0.0 347 350 float astError = psMetadataLookupF32 (&status, updates, "CERROR"); 348 351 if (fabs(astError) < 1e-6) goto skip_chip; … … 397 400 } 398 401 399 psPlaneTransform *map = psPlaneTransformAlloc (1, 1 );402 psPlaneTransform *map = psPlaneTransformAlloc (1, 1, PS_POLYNOMIAL_ORD); 400 403 map->x->coeffMask[1][1] = PS_POLY_MASK_SET; 401 404 map->y->coeffMask[1][1] = PS_POLY_MASK_SET; -
trunk/psastro/src/psastroConvert.c
r41435 r41895 172 172 calStars->n = j; 173 173 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.CALSTARS", PS_DATA_ARRAY, "astrometry objects for masking", calStars); 174 psFree (calStars); 174 175 175 176 psFree (index); -
trunk/psastro/src/psastroFixChips.c
r41536 r41895 170 170 if (DEBUG) fclose (f); 171 171 172 psPlaneTransform *map = psPlaneTransformAlloc (1, 1 );172 psPlaneTransform *map = psPlaneTransformAlloc (1, 1, PS_POLYNOMIAL_ORD); 173 173 174 174 psVector *mask = psVectorAlloc (nPts, PS_TYPE_VECTOR_MASK); … … 289 289 // apply the exiting fromTPA transformation to make the new toFPA consistent with the toTPA layter 290 290 // XXX this only works if toTPA is at most a linear transformation 291 psPlaneTransform *toFPA = psPlaneTransformAlloc(refChip->toFPA->x->nX, refChip->toFPA->x->nY );291 psPlaneTransform *toFPA = psPlaneTransformAlloc(refChip->toFPA->x->nX, refChip->toFPA->x->nY, PS_POLYNOMIAL_ORD); 292 292 for (int i = 0; i <= refChip->toFPA->x->nX; i++) { 293 293 for (int j = 0; j <= refChip->toFPA->x->nY; j++) { -
trunk/psastro/src/psastroMetadataStats.c
r41071 r41895 37 37 psMetadataItemSupplement(&status, stats, header, "ZPT_ERR"); 38 38 psMetadataItemSupplement(&status, stats, header, "CERROR"); 39 psMetadataItemSupplement(&status, stats, header, "CERSTD"); 39 40 psMetadataItemSupplement(&status, stats, header, "NASTRO"); 40 41 psMetadataItemSupplement(&status, stats, header, "AST_R0"); -
trunk/psastro/src/psastroMosaicAstrom.c
r41536 r41895 277 277 } 278 278 279 // the original transforms are (1, 1), but we will need higher order to fit the distortions 279 // the original transforms are (1, 1), but we will need higher order to fit the distortions. 280 // forward transformations (chip->fpa->tpa->sky) use Ordinary polynomials 280 281 psFree (fpa->toTPA); 281 282 // the original transforms are (1, 1), but we will need higher order to fit the distortions 283 fpa->toTPA = psPlaneTransformAlloc (order, order); 282 fpa->toTPA = psPlaneTransformAlloc (order, order, PS_POLYNOMIAL_ORD); 284 283 for (int i = 0; i <= fpa->toTPA->x->nX; i++) { 285 284 for (int j = 0; j <= fpa->toTPA->x->nY; j++) { -
trunk/psastro/src/psastroMosaicChipAstrom.c
r41500 r41895 91 91 return true; 92 92 } 93 94 // XXX count success and failures95 // XXX set bad quality if fraction of successes < threshold96 // XXX e.g., 5% success would mean 3 of 60 GPC1 chips are goo.97 // XXX or, 10% would be 6 of 60.98 // XXX seems like a good indicator of failure.99 // XXX also, test CERROR against a minimum value? -
trunk/psastro/src/psastroMosaicCorrectDistortion.c
r41536 r41895 22 22 } 23 23 24 // store the new coeffs in a new structure 25 psPlaneTransform *toTPAnew = psPlaneTransformAlloc(fpa->toTPA->x->nX, fpa->toTPA->x->nY); 24 // Store the new coeffs in a new structure. Forward transformations (chip->fpa->tpa->sky) 25 // use Ordinary polynomials 26 psPlaneTransform *toTPAnew = psPlaneTransformAlloc(fpa->toTPA->x->nX, fpa->toTPA->x->nY, PS_POLYNOMIAL_ORD); 26 27 27 28 // set the new coeffs, or set the mask -
trunk/psastro/src/psastroMosaicFPtoTP.c
r26259 r41895 80 80 81 81 // linear fit without xy cross term 82 psPlaneTransform *map = psPlaneTransformAlloc (1, 1 );82 psPlaneTransform *map = psPlaneTransformAlloc (1, 1, PS_POLYNOMIAL_ORD); 83 83 map->x->coeffMask[1][1] = PS_POLY_MASK_SET; 84 84 map->y->coeffMask[1][1] = PS_POLY_MASK_SET; -
trunk/psastro/src/psastroMosaicGradients.c
r39926 r41895 84 84 return false; 85 85 } 86 87 // forward transformations (chip->fpa->tpa->sky) use Ordinary polynomials 86 88 psFree (fpa->toTPA); 87 fpa->toTPA = psPlaneTransformAlloc (order, order );89 fpa->toTPA = psPlaneTransformAlloc (order, order, PS_POLYNOMIAL_ORD); 88 90 for (int i = 0; i <= fpa->toTPA->x->nX; i++) { 89 91 for (int j = 0; j <= fpa->toTPA->x->nY; j++) { -
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 -
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 -
trunk/psastro/src/psastroUtils.c
r41536 r41895 215 215 psPlaneTransform *psPlaneTransformCopy (psPlaneTransform *input) { 216 216 217 psPlaneTransform *output = psPlaneTransformAlloc (input->x->nX, input->x->nY );217 psPlaneTransform *output = psPlaneTransformAlloc (input->x->nX, input->x->nY, input->x->type); 218 218 219 219 for (int i = 0; i < input->x->nX; i++) {
Note:
See TracChangeset
for help on using the changeset viewer.
