Changeset 26259 for trunk/psastro/src/psastroOneChipFit.c
- Timestamp:
- Nov 22, 2009, 2:57:41 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/psastro/src/psastroOneChipFit.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastroOneChipFit.c
r24035 r26259 28 28 REQUIRED_RECIPE_VALUE (int nIter, "PSASTRO.MATCH.FIT.NITER", S32); 29 29 30 // for iterations >= uniqIter, require a single match per reference 31 REQUIRED_RECIPE_VALUE (int uniqIter, "PSASTRO.MATCH.UNIQ.ITER", S32); 32 30 33 // correct radius to FP units (physical pixel scale in microns per pixel) 31 34 REQUIRED_RECIPE_VALUE (double pixelScale, "PSASTRO.PIXEL.SCALE", F32); … … 61 64 return false; 62 65 } 66 67 if (iter >= uniqIter) { 68 psArray *unique = pmAstromRadiusMatchUniq (rawstars, refstars, match); 69 if (!unique) { 70 psLogMsg ("psastro", 3, "failed to generate a uniq set of matched sources\n"); 71 return false; 72 } 73 psFree (match); 74 match = unique; 75 } 63 76 64 77 // modify the order to correspond to the actual number of matched stars: … … 101 114 } 102 115 103 // XXX allow stati tic to be set by the user116 // XXX allow statistic to be set by the user 104 117 // fitStats = psStatsAlloc (PS_STAT_CLIPPED_MEAN | PS_STAT_CLIPPED_STDEV); 105 118 fitStats = psStatsAlloc (PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV); … … 117 130 118 131 // determine fromFPA transformation and apply new transformation to raw & ref stars 119 psastroUpdateChipToFPA (fpa, chip, rawstars, refstars); 132 // this applies the transformation to all stars (including subset) 133 psastroUpdateChipToFPA (fpa, chip); // updates PSASTRO.RAWSTARS and PSASTRO.REFSTARS 120 134 121 135 // toSky converts from FPA & TPA units (microns) to sky units (radians) 122 136 float plateScale = 0.5*(fpa->toSky->Xs + fpa->toSky->Ys)*3600.0*PM_DEG_RAD; 123 // float astError = 0.5*(results->xStats->clippedStdev + results->yStats->clippedStdev) * plateScale; 124 float astError = 0.5*(results->xStats->robustStdev + results->yStats->robustStdev) * plateScale; 137 138 float rawXstdev = psStatsGetValue (results->xStats, psStatsStdevOption(results->xStats->options)); 139 float rawYstdev = psStatsGetValue (results->yStats, psStatsStdevOption(results->yStats->options)); 140 141 float astError = 0.5*(rawXstdev + rawYstdev) * plateScale; 125 142 int astNstar = results->yStats->clippedNvalues; 126 143 psLogMsg ("psastro", PS_LOG_INFO, "pass %d, error: %f arcsec, Nstars: %d", iter, astError, astNstar); … … 136 153 float plateScale = 0.5*(fpa->toSky->Xs + fpa->toSky->Ys)*3600.0*PM_DEG_RAD; 137 154 155 float rawXstdev = psStatsGetValue (results->xStats, psStatsStdevOption(results->xStats->options)); 156 float rawYstdev = psStatsGetValue (results->yStats, psStatsStdevOption(results->yStats->options)); 157 138 158 // pixError is the average 1D scatter in pixels ('results' are in FPA units = microns) 139 // float pixError = 0.5*(results->xStats->clippedStdev + results->yStats->clippedStdev) / pixelScale; 140 float pixError = 0.5*(results->xStats->robustStdev + results->yStats->robustStdev) / pixelScale; 159 float pixError = 0.5*(rawXstdev + rawYstdev) / pixelScale; 141 160 142 161 // astError is the average 1D scatter in arcsec ('results' are in FPA units = microns) 143 // float astError = 0.5*(results->xStats->clippedStdev + results->yStats->clippedStdev) * plateScale; 144 float astError = 0.5*(results->xStats->robustStdev + results->yStats->robustStdev) * plateScale; 162 float astError = 0.5*(rawXstdev + rawYstdev) * plateScale; 163 164 // x and y are forced to use the same subset of values: 145 165 int astNstar = results->yStats->clippedNvalues; 146 166 … … 170 190 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 171 191 172 // XXX drop from here : determine fromFPA transformation and apply new transformation to raw & ref stars 173 // psastroUpdateChipToFPA (fpa, chip, rawstars, refstars); 192 // additional error measurements: 193 psMetadataAddF32 (updates, PS_LIST_TAIL, "AST_CDX", PS_META_REPLACE, "chip astrometry X stdev (arcsec)", rawXstdev * plateScale); 194 psMetadataAddF32 (updates, PS_LIST_TAIL, "AST_CSX", PS_META_REPLACE, "chip astrometry X systematic err (arcsec)", results->dXsys * plateScale); 195 psMetadataAddF32 (updates, PS_LIST_TAIL, "AST_CRX", PS_META_REPLACE, "chip astrometry X 10-90 percentile (arcsec)", results->dXrange * plateScale); 196 197 psMetadataAddF32 (updates, PS_LIST_TAIL, "AST_CDY", PS_META_REPLACE, "chip astrometry Y stdev (arcsec)", rawYstdev * plateScale); 198 psMetadataAddF32 (updates, PS_LIST_TAIL, "AST_CSY", PS_META_REPLACE, "chip astrometry Y systematic err (arcsec)", results->dYsys * plateScale); 199 psMetadataAddF32 (updates, PS_LIST_TAIL, "AST_CRY", PS_META_REPLACE, "chip astrometry Y 10-90 percentile (arcsec)", results->dYrange * plateScale); 174 200 175 201 // XXX check if we correctly applied the new transformation: … … 189 215 psFree (results); 190 216 psFree (fitStats); 217 191 218 return validSolution; 192 219 }
Note:
See TracChangeset
for help on using the changeset viewer.
