Changeset 31161
- Timestamp:
- Apr 4, 2011, 1:19:58 PM (15 years ago)
- Location:
- trunk/psastro
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
src/psastroConvert.c (modified) (1 diff)
-
src/psastroOneChipGrid.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro
- Property svn:ignore
-
old new 18 18 psastro.pc 19 19 Doxyfile 20 a.out.dSYM
-
- Property svn:ignore
-
trunk/psastro/src/psastroConvert.c
r26897 r31161 58 58 // sort in ascending magnitude order 59 59 // psArraySort (inStars, psastroSortByMag); 60 // psVector *index = psArraySortIndex (sources, pmSourceSortBy SN);60 // psVector *index = psArraySortIndex (sources, pmSourceSortByFlux); 61 61 psVector *index = psArraySortIndex (NULL, inStars, psastroSortByMag); 62 62 -
trunk/psastro/src/psastroOneChipGrid.c
r26259 r31161 28 28 29 29 // do we need to get a rough initial match? 30 REQUIRED_RECIPE_VALUE (int maxNstar, "PSASTRO.GRID.NSTAR.MAX", S32); 31 32 // generate the bright subset of maxNstar entries (note: rawstars is sorted by S/N) 33 psArray *gridStars = psArrayAlloc (PS_MIN (maxNstar, rawstars->n)); 34 for (int i = 0; (i < maxNstar) && (i < rawstars->n); i++) { 35 gridStars->data[i] = psMemIncrRefCounter (rawstars->data[i]); 30 int nMaxRaw = psMetadataLookupS32(&status, recipe, "PSASTRO.GRID.NRAW.MAX"); 31 if (!status) { 32 nMaxRaw = psMetadataLookupS32(&status, recipe, "PSASTRO.GRID.NSTAR.MAX"); 33 } 34 int nMaxRef = psMetadataLookupS32(&status, recipe, "PSASTRO.GRID.NREF.MAX"); 35 if (!status) { 36 nMaxRef = refstars->n; 36 37 } 37 38 38 psLogMsg ("psastro", 3, "grid search using %ld raw vs %ld ref stars\n", gridStars->n, refstars->n); 39 // generate the bright subset of nMaxRaw entries of rawstars (already sorted by S/N) 40 psArray *rawGridStars = psArrayAlloc (PS_MIN (nMaxRaw, rawstars->n)); 41 for (int i = 0; (i < nMaxRaw) && (i < rawstars->n); i++) { 42 rawGridStars->data[i] = psMemIncrRefCounter (rawstars->data[i]); 43 } 44 45 // generate the bright subset of nMaxRef entries of refstars (already sorted by S/N) 46 psArray *refGridStars = psArrayAlloc (PS_MIN (nMaxRef, refstars->n)); 47 for (int i = 0; (i < nMaxRef) && (i < refstars->n); i++) { 48 refGridStars->data[i] = psMemIncrRefCounter (refstars->data[i]); 49 } 50 51 psLogMsg ("psastro", 3, "grid search using %ld raw vs %ld ref stars\n", rawGridStars->n, refGridStars->n); 39 52 40 53 // find initial offset / rotation / scale 41 pmAstromStats *gridStats = pmAstromGridMatch ( gridStars, refstars, recipe);54 pmAstromStats *gridStats = pmAstromGridMatch (rawGridStars, refGridStars, recipe); 42 55 if (gridStats == NULL) { 43 56 psLogMsg ("psastro", 3, "failed to find a grid match solution\n"); 44 psFree (gridStars); 57 psFree (rawGridStars); 58 psFree (refGridStars); 45 59 return false; 46 60 } … … 48 62 49 63 // tweak the position by finding peak of matches stars 50 stats = pmAstromGridTweak ( gridStars, refstars, recipe, gridStats);64 stats = pmAstromGridTweak (rawGridStars, refGridStars, recipe, gridStats); 51 65 if (stats == NULL) { 52 66 psLogMsg ("psastro", 3, "failed to measure tweaked grid solution\n"); 53 67 psFree (gridStats); 54 psFree (gridStars); 68 psFree (rawGridStars); 69 psFree (refGridStars); 55 70 return false; 56 71 } … … 61 76 psastroUpdateChipToFPA (fpa, chip); // updates PSASTRO.RAWSTARS and PSASTRO.REFSTARS 62 77 psFree (gridStats); 63 psFree (gridStars); 78 psFree (rawGridStars); 79 psFree (refGridStars); 64 80 psFree (stats); 65 81
Note:
See TracChangeset
for help on using the changeset viewer.
