Changeset 12492 for trunk/psastro/src/psastroOneChip.c
- Timestamp:
- Mar 18, 2007, 12:28:16 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psastro/src/psastroOneChip.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastroOneChip.c
r11470 r12492 10 10 11 11 bool status; 12 pmAstromStats *gridStats = NULL; 13 pmAstromStats *stats = NULL; 12 14 13 15 // supplied radius is in pixels … … 25 27 REQUIRED_RECIPE_VALUE (int minNstar, "PSASTRO.MIN.NSTAR", S32, "failed to find single-chip min allowed stars\n"); 26 28 27 // find initial offset / rotation 28 pmAstromStats *gridStats = pmAstromGridMatch (rawstars, refstars, recipe); 29 if (gridStats == NULL) { 30 psLogMsg ("psastro", 3, "failed to find a grid match solution\n"); 31 return false; 29 // do we need to get a rough initial match? 30 REQUIRED_RECIPE_VALUE (bool gridSearch, "PSASTRO.GRID.SEARCH", Bool, "failed to find chip grid-search option\n"); 31 32 if (gridSearch) { 33 // find initial offset / rotation 34 gridStats = pmAstromGridMatch (rawstars, refstars, recipe); 35 if (gridStats == NULL) { 36 psLogMsg ("psastro", 3, "failed to find a grid match solution\n"); 37 return false; 38 } 39 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); 40 41 // tweak the position by finding peak of matches stars 42 stats = pmAstromGridTweak (rawstars, refstars, recipe, gridStats); 43 if (stats == NULL) { 44 psLogMsg ("psastro", 3, "failed to measure tweaked grid solution\n"); 45 psFree (gridStats); 46 return false; 47 } 48 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); 49 50 // adjust the chip.toFPA terms only 51 pmAstromGridApply (chip->toFPA, stats); 52 psastroUpdateChipToFPA (fpa, chip, rawstars, refstars); 32 53 } 33 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);34 35 // tweak the position by finding peak of matches stars36 pmAstromStats *stats = pmAstromGridTweak (rawstars, refstars, recipe, gridStats);37 if (stats == NULL) {38 psLogMsg ("psastro", 3, "failed to measure tweaked grid solution\n");39 return false;40 }41 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);42 43 // adjust the chip.toFPA terms only44 pmAstromGridApply (chip->toFPA, stats);45 psastroUpdateChipToFPA (fpa, chip, rawstars, refstars);46 54 47 55 // use small radius to match stars … … 49 57 if (match == NULL) { 50 58 psLogMsg ("psastro", 3, "failed to find radius-matched sources\n"); 59 psFree (stats); 60 psFree (gridStats); 51 61 return false; 52 62 } … … 85 95 if (!results) { 86 96 psLogMsg ("psastro", 3, "failed to perform the matched fit\n"); 97 psFree (match); 98 psFree (stats); 99 psFree (fitStats); 100 psFree (gridStats); 87 101 return false; 88 102 }
Note:
See TracChangeset
for help on using the changeset viewer.
