Changeset 15665 for trunk/psModules/src/astrom/pmAstrometryObjects.c
- Timestamp:
- Nov 20, 2007, 9:02:55 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/astrom/pmAstrometryObjects.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/astrom/pmAstrometryObjects.c
r15102 r15665 8 8 * @author EAM, IfA 9 9 * 10 * @version $Revision: 1.3 4$ $Name: not supported by cvs2svn $11 * @date $Date: 2007- 09-29 02:28:04$10 * @version $Revision: 1.35 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2007-11-21 07:02:55 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 269 269 270 270 /****************************************************************************** 271 pmAstromRotateObj(old, center, angle ): rotate the focal-plane coordinates271 pmAstromRotateObj(old, center, angle, angle): rotate & scale the focal-plane coordinates 272 272 about the center coordinate angle specified in radians 273 273 ******************************************************************************/ … … 275 275 const psArray *old, 276 276 psPlane center, 277 double angle) 277 double angle, 278 double scale) 278 279 { 279 280 PS_ASSERT_PTR_NON_NULL(old, NULL); … … 284 285 285 286 psArray *new = psArrayAlloc (old->n); 286 double cs = cos(angle);287 double sn = s in(angle);287 double cs = scale*cos(angle); 288 double sn = scale*sin(angle); 288 289 double xCenter = center.x; 289 290 double yCenter = center.y; … … 326 327 // stats->offset = {0, 0, 0, 0}; 327 328 stats->angle = 0.0; 329 stats->scale = 1.0; 328 330 stats->minMetric = 0.0; 329 331 stats->minVar = 0.0; … … 703 705 center.y = 0.5*(yMin + yMax); 704 706 707 double minScale = psMetadataLookupF32 (&status, config, "PSASTRO.GRID.MIN.SCALE"); 708 double maxScale = psMetadataLookupF32 (&status, config, "PSASTRO.GRID.MAX.SCALE"); 709 double delScale = psMetadataLookupF32 (&status, config, "PSASTRO.GRID.DEL.SCALE"); 710 705 711 double minAngle = RAD_DEG*psMetadataLookupF32 (&status, config, "PSASTRO.GRID.MIN.ANGLE"); 706 712 double maxAngle = RAD_DEG*psMetadataLookupF32 (&status, config, "PSASTRO.GRID.MAX.ANGLE"); … … 709 715 710 716 minStat->minMetric = 1e10; 711 for (double angle = minAngle; angle <= maxAngle; angle += delAngle) { 712 rot = pmAstromRotateObj (raw, center, angle); 713 newStat = pmAstromGridAngle (rot, ref, config); 714 newStat->angle = angle; 715 newStat->center = center; 716 717 if (newStat->minMetric < minStat->minMetric) { 718 *minStat = *newStat; 719 psLogMsg ("psModule.astrom", 4, "grid test - offset: %7.2f,%7.2f @ %6.1f deg (%4d pts, %5.1f sig, %5.1f var, %6.3f log metric) *", 720 minStat->offset.x, minStat->offset.y, DEG_RAD*minStat->angle, minStat->nMatch, minStat->nSigma, minStat->minVar, log10(minStat->minMetric)); 721 } else { 722 psLogMsg ("psModule.astrom", 4, "grid test - offset: %7.2f,%7.2f @ %6.1f deg (%4d pts, %5.1f sig, %5.1f var, %6.3f log metric)", 723 newStat->offset.x, newStat->offset.y, DEG_RAD*newStat->angle, newStat->nMatch, newStat->nSigma, newStat->minVar, log10(newStat->minMetric)); 724 725 } 726 psFree (newStat); 727 psFree (rot); 728 } 729 psLogMsg ("psModule.astrom.grid.match", 4, "grid best - offset: %7.2f,%7.2f @ %6.1f deg (%4d pts, %5.1f sig, %5.1f var, %6.3f log metric)", 730 minStat->offset.x, minStat->offset.y, DEG_RAD*minStat->angle, minStat->nMatch, minStat->nSigma, minStat->minVar, log10(minStat->minMetric)); 717 for (double scale = minScale; scale <= maxScale; scale += delScale) { 718 for (double angle = minAngle; angle <= maxAngle; angle += delAngle) { 719 rot = pmAstromRotateObj (raw, center, angle, scale); 720 newStat = pmAstromGridAngle (rot, ref, config); 721 newStat->angle = angle; 722 newStat->scale = scale; 723 newStat->center = center; 724 725 if (newStat->minMetric < minStat->minMetric) { 726 *minStat = *newStat; 727 psLogMsg ("psModule.astrom", 4, "grid test - offset: %7.2f,%7.2f @ %6.1f deg x %7.3f (%4d pts, %5.1f sig, %5.1f var, %6.3f log metric) *", 728 minStat->offset.x, minStat->offset.y, DEG_RAD*minStat->angle, minStat->scale, minStat->nMatch, minStat->nSigma, minStat->minVar, log10(minStat->minMetric)); 729 } else { 730 psLogMsg ("psModule.astrom", 4, "grid test - offset: %7.2f,%7.2f @ %6.1f deg x %7.3f (%4d pts, %5.1f sig, %5.1f var, %6.3f log metric)", 731 newStat->offset.x, newStat->offset.y, DEG_RAD*newStat->angle, newStat->scale, newStat->nMatch, newStat->nSigma, newStat->minVar, log10(newStat->minMetric)); 732 733 } 734 psFree (newStat); 735 psFree (rot); 736 } 737 } 738 psLogMsg ("psModule.astrom.grid.match", 4, "grid best - offset: %7.2f,%7.2f @ %6.1f deg x %7.3f (%4d pts, %5.1f sig, %5.1f var, %6.3f log metric)", 739 minStat->offset.x, minStat->offset.y, DEG_RAD*minStat->angle, minStat->scale, minStat->nMatch, minStat->nSigma, minStat->minVar, log10(minStat->minMetric)); 731 740 732 741 // I need to decide if a solution is likely to be a good solution or just a mis-match … … 756 765 int nBin, xBin, yBin; 757 766 758 rot = pmAstromRotateObj (raw, stats->center, stats->angle );767 rot = pmAstromRotateObj (raw, stats->center, stats->angle, stats->scale); 759 768 760 769 // sampling scale of the grid … … 846 855 PS_ASSERT_POLY_NON_NULL(map->y, NULL); 847 856 848 double cs = cos (stat->angle);849 double sn = s in (stat->angle);857 double cs = stat->scale * cos (stat->angle); 858 double sn = stat->scale * sin (stat->angle); 850 859 851 860 double dx = (map->x->coeff[0][0] - stat->center.x);
Note:
See TracChangeset
for help on using the changeset viewer.
