Changeset 42290
- Timestamp:
- Sep 23, 2022, 6:19:21 AM (4 years ago)
- Location:
- tags/ipp-ops-20220705/psastro
- Files:
-
- 6 edited
-
. (modified) (1 prop)
-
src/psastroAstromGuess.c (modified) (2 diffs)
-
src/psastroMosaicOneChip.c (modified) (3 diffs)
-
src/psastroOneChipFit.c (modified) (1 diff)
-
src/psastroOneChipGrid.c (modified) (6 diffs)
-
src/psastroUtils.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-ops-20220705/psastro
- Property svn:mergeinfo changed
/trunk/psastro (added) merged: 42257,42285,42289
- Property svn:mergeinfo changed
-
tags/ipp-ops-20220705/psastro/src/psastroAstromGuess.c
r41895 r42290 320 320 if (!chip->process || !chip->file_exists || !chip->data_exists) { continue; } 321 321 322 if (!chip->toFPA || !chip->fromFPA) { 322 // if a chip fails during the calibration, the associated readout->data_exists 323 // gets set to false. This may be the wrong solution, but it does not break this 324 // analysis here. Note this is not the chip->data_exists field tested above. 325 // chip->data_exists is only false if the chip data is missing. 326 327 // chip->fromFPA can be NULL if the inversion fails, but I'm not sure 328 // chip->toFPA can be NULL unless it was not in the original model 329 if (!chip->toFPA) { 323 330 char *name = psMetadataLookupStr (NULL, chip->concepts, "CHIP.NAME"); 324 331 fprintf (stderr, "no astrom model for %s, skipping\n", name); 325 332 continue; 326 333 } 327 328 // XXX we are currently inconsistent with marking the good vs the bad data 329 // psastroChipAstrom sets data_exists to false if the fit is bad. this is 330 // probably wrong since it implies there is no data! 334 if (!chip->fromFPA) { 335 char *name = psMetadataLookupStr (NULL, chip->concepts, "CHIP.NAME"); 336 fprintf (stderr, "inversion faiulre for %s (%d), will be skipped\n", name, view->chip); 337 } 331 338 332 339 // skip chips for which the astrometry failed (NASTRO == 0) … … 350 357 float astError = psMetadataLookupF32 (&status, updates, "CERROR"); 351 358 if (fabs(astError) < 1e-6) goto skip_chip; 359 360 // XXX EAM 2022.09.22 : a more robust analysis would put the corner points 361 // on the chip metadata so we can be certain the old and new corner values 362 // are correctly matched. 352 363 353 364 psPlane ptCH, ptFP, ptTP; -
tags/ipp-ops-20220705/psastro/src/psastroMosaicOneChip.c
r41895 r42290 148 148 if (order == 1) { minNstar = PS_MAX ( 8, minNstar); } 149 149 150 // determine fromFPA transformation and apply new transformation to raw & ref stars 151 psastroUpdateChipToFPA (fpa, chip); 152 150 153 bool validSolution = true; 151 154 … … 162 165 if (astNstar < minNstar) { 163 166 psLogMsg("psastro", PS_LOG_INFO, "solution uses too few stars: %d < %d", astNstar, minNstar); 167 validSolution = false; 168 } 169 if (!chip->fromFPA) { 170 psLogMsg("psastro", PS_LOG_INFO, "toFPA/fromFPA inversion failure"); 164 171 validSolution = false; 165 172 } … … 189 196 psMetadataAddF32 (updates, PS_LIST_TAIL, "AST_MRY", PS_META_REPLACE, "mosaic astrometry Y 10-90 percentile (arcsec)", results->dYrange * plateScale); 190 197 191 // determine fromFPA transformation and apply new transformation to raw & ref stars 192 psastroUpdateChipToFPA (fpa, chip); 193 194 //plot results 198 // plot results 195 199 pmAstromVisualPlotMosaicOneChip(rawstars, refstars, match, recipe); 196 200 -
tags/ipp-ops-20220705/psastro/src/psastroOneChipFit.c
r41895 r42290 217 217 validSolution = false; 218 218 } 219 if (!chip->fromFPA) { 220 psLogMsg("psastro", PS_LOG_INFO, "toFPA/fromFPA inversion failure"); 221 validSolution = false; 222 } 219 223 220 224 // DVO expects NASTRO = 0 if we fail to find a solution -
tags/ipp-ops-20220705/psastro/src/psastroOneChipGrid.c
r40084 r42290 22 22 bool status; 23 23 pmAstromStats *stats = NULL; 24 char *chipname = psMetadataLookupStr (NULL, chip->concepts, "CHIP.NAME"); 25 24 26 25 27 // do we need to get a rough initial match? … … 49 51 } 50 52 51 psLogMsg ("psastro", 3, "grid search using %ld raw vs %ld ref stars\n",rawGridStars->n, refGridStars->n);53 psLogMsg ("psastro", 3, "grid search for chip %s using %ld raw vs %ld ref stars\n",chipname,rawGridStars->n, refGridStars->n); 52 54 53 55 // find initial offset / rotation / scale 54 56 pmAstromStats *gridStats = pmAstromGridMatch (rawGridStars, refGridStars, recipe); 55 57 if (gridStats == NULL) { 56 psLogMsg ("psastro", 3, "failed to find a grid match solution \n");58 psLogMsg ("psastro", 3, "failed to find a grid match solution for chip %s\n",chipname); 57 59 psFree (rawGridStars); 58 60 psFree (refGridStars); … … 60 62 return false; 61 63 } 62 psLogMsg ("psastro", 3, "basic grid search result - offset: %f,%f pixels, rotation: %f deg\n", gridStats->offset.x, gridStats->offset.y, DEG_RAD*gridStats->angle);64 psLogMsg ("psastro", 3, "basic grid search result for chip %s - offset: %f,%f pixels, rotation: %f deg\n",chipname, gridStats->offset.x, gridStats->offset.y, DEG_RAD*gridStats->angle); 63 65 64 66 # if (1) … … 73 75 return false; 74 76 } 75 psLogMsg ("psastro", 3, "tweak grid search result - offset: %f,%f pixels, rotation: %f deg\n", stats->offset.x, stats->offset.y, DEG_RAD*stats->angle);77 psLogMsg ("psastro", 3, "tweak grid search result for chip %s - offset: %f,%f pixels, rotation: %f deg\n",chipname, stats->offset.x, stats->offset.y, DEG_RAD*stats->angle); 76 78 # else 77 79 // EAM TEST: skip tweak … … 82 84 // adjust the chip.toFPA terms only 83 85 pmAstromGridApply (chip->toFPA, stats); 84 psastroUpdateChipToFPA (fpa, chip); // updates PSASTRO.RAWSTARS and PSASTRO.REFSTARS 86 psastroUpdateChipToFPA (fpa, chip); // updates PSASTRO.RAWSTARS and PSASTRO.REFSTARS (see note below) 85 87 psFree (gridStats); 86 88 psFree (rawGridStars); … … 90 92 return true; 91 93 } 94 95 /* if psastroUpdateChiptoFPA fails to invert the toFPA transformation, 96 the ref->chip coordinates will not be set. This is not a problem 97 at this stage since they are not used in the calculation. Later 98 passes can still yield a valid solution. 99 */ -
tags/ipp-ops-20220705/psastro/src/psastroUtils.c
r41895 r42290 109 109 110 110 psRegion *region = pmChipPixels (chip); 111 112 111 psFree (chip->fromFPA); 113 112 chip->fromFPA = psPlaneTransformInvert (NULL, chip->toFPA, *region, 50, 4); 114 113 psFree (region); 114 115 // XXX EAM 2022.09.22 : for a specific case, psPlaneTransformInvert fails. 116 // This probably means the solution was poor in any case. 117 // Some options: 118 // 1) skip the chip in psastroAstromGuessCheck (supply bad corners) 119 // 2) mark this chip as bad (return an error here and trap in psastroMosaicOneChip) 120 // 3) warn of the failure: 121 if (!chip->fromFPA) { 122 char *name = psMetadataLookupStr (NULL, chip->concepts, "CHIP.NAME"); 123 psLogMsg ("psastro", PS_LOG_INFO, "WARNING: failure to invert toFPA for %s", name); 124 } 115 125 116 126 // loop over cells in this chip … … 150 160 pmAstromObj *ref = refstars->data[i]; 151 161 psPlaneTransformApply (ref->chip, chip->fromFPA, ref->FP); 162 // if chip->fromFPA is NULL (non-invertable), the action is skipped 152 163 } 153 164 }
Note:
See TracChangeset
for help on using the changeset viewer.
