Changeset 12718 for trunk/psastro/src/psastroMosaicOneChip.c
- Timestamp:
- Apr 3, 2007, 10:43:21 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/psastro/src/psastroMosaicOneChip.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastroMosaicOneChip.c
r10880 r12718 7 7 return false; } 8 8 9 bool psastroMosaicOneChip (pmChip *chip, pmReadout *readout, psMetadata *recipe, psMetadata *updates, bool nonlinear) {9 bool psastroMosaicOneChip (pmChip *chip, pmReadout *readout, psMetadata *recipe, psMetadata *updates, int iteration) { 10 10 11 11 bool status; 12 char errorWord[64]; 12 13 13 14 PS_ASSERT_PTR_NON_NULL(chip, false); … … 30 31 31 32 // allowed limits for valid solutions 32 REQUIRED_RECIPE_VALUE (float maxError, "PSASTRO.MOSAIC.MAX.ERROR", F32, "failed to find single-chip max allowed error\n"); 33 sprintf (errorWord, "PSASTRO.MOSAIC.MAX.ERROR.N%d", iteration); 34 REQUIRED_RECIPE_VALUE (float maxError, errorWord, F32, "failed to find single-chip max allowed error\n"); 33 35 REQUIRED_RECIPE_VALUE (int minNstar, "PSASTRO.MOSAIC.MIN.NSTAR", S32, "failed to find single-chip min allowed stars\n"); 34 36 35 // set the order of the per-chip fit (higher order only if nonlinear == true)37 // set the order of the per-chip fit (higher order only if iteration > 0) 36 38 int order = 1; 37 if ( nonlinear) {39 if (iteration > 0) { 38 40 // select the desired chip order 39 41 REQUIRED_RECIPE_VALUE (order, "PSASTRO.MOSAIC.CHIP.ORDER", S32, "failed to find mosaic chip-level fit order\n"); 40 42 41 43 // modify the order to correspond to the actual number of matched stars: 42 if ((match->n < 1 1) && (order >= 3)) order = 2;43 if ((match->n < 7) && (order >= 2)) order = 1;44 if ((match->n < 4) && (order >= 1)) order = 0;44 if ((match->n < 15) && (order >= 3)) order = 2; 45 if ((match->n < 11) && (order >= 2)) order = 1; 46 if ((match->n < 8) && (order >= 1)) order = 0; 45 47 if (order < 1) { 46 48 psLogMsg ("psastro", 3, "insufficient stars or invalid order: %ld stars", match->n); … … 84 86 int astNstar = results->yStats->clippedNvalues; 85 87 88 // if we clip away too many stars, the order may be invalid 89 if (order == 3) { minNstar = PS_MAX (15, minNstar); } 90 if (order == 2) { minNstar = PS_MAX (11, minNstar); } 91 if (order == 1) { minNstar = PS_MAX ( 8, minNstar); } 92 86 93 bool validSolution = true; 87 94 … … 114 121 psFree (fitStats); 115 122 psFree (results); 116 return true;123 return validSolution; 117 124 }
Note:
See TracChangeset
for help on using the changeset viewer.
