Changeset 12718
- Timestamp:
- Apr 3, 2007, 10:43:21 AM (19 years ago)
- Location:
- trunk/psastro/src
- Files:
-
- 8 edited
-
psastro.h (modified) (1 diff)
-
psastroChipAstrom.c (modified) (2 diffs)
-
psastroChooseRefstars.c (modified) (1 diff)
-
psastroLoadRefstars.c (modified) (2 diffs)
-
psastroMosaicAstrom.c (modified) (2 diffs)
-
psastroMosaicChipAstrom.c (modified) (2 diffs)
-
psastroMosaicOneChip.c (modified) (4 diffs)
-
psastroOneChip.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastro.h
r12492 r12718 59 59 bool psastroMosaicCommonScale (pmFPA *fpa, psMetadata *recipe); 60 60 bool psastroMosaicAstrom (pmConfig *config, psArray *refs); 61 bool psastroMosaicChipAstrom (pmFPA *fpa, psMetadata *recipe, bool nonlinear);61 bool psastroMosaicChipAstrom (pmFPA *fpa, psMetadata *recipe, int iteration); 62 62 bool psastroMosaicSetMatch (pmFPA *fpa, psMetadata *recipe, int iteration); 63 63 bool psastroMosaicSetAstrom (pmFPA *fpa); 64 64 bool psastroMosaicHeaders (pmConfig *config); 65 65 bool psastroMosaicRescaleChips (pmFPA *fpa); 66 bool psastroMosaicOneChip (pmChip *chip, pmReadout *readout, psMetadata *recipe, psMetadata *updates, bool nonlinear);66 bool psastroMosaicOneChip (pmChip *chip, pmReadout *readout, psMetadata *recipe, psMetadata *updates, int iteration); 67 67 68 68 // Return version strings. -
trunk/psastro/src/psastroChipAstrom.c
r12712 r12718 47 47 // the absolute minimum number of stars is 4 (for order = 1) 48 48 if ((rawstars->n < 4) || (refstars->n < 4)) { 49 readout->data_exists = false; 49 50 psLogMsg ("psastro", 3, "insufficient rawstars (%ld) or refstars (%ld)", 50 51 rawstars->n, refstars->n); … … 72 73 // XXX update the header with info to reflect the failure 73 74 if (!psastroOneChip (fpa, chip, refstars, rawstars, recipe, updates)) { 75 readout->data_exists = false; 74 76 psLogMsg ("psastro", 3, "failed to find a solution\n"); 75 77 psFree (updates); -
trunk/psastro/src/psastroChooseRefstars.c
r10880 r12718 80 80 psFree (refstars); 81 81 82 // XXX TEST : skip the luminosity function selection 83 continue; 84 82 85 // XXX this error means the readout fails, but should probably not kill the entire program 83 86 // in this case, no PSASTRO.REFSTARS is added to readout->analysis -
trunk/psastro/src/psastroLoadRefstars.c
r12536 r12718 19 19 float DECmin = DEG_RAD*psMetadataLookupF32(NULL, recipe, "DEC_MIN"); 20 20 float DECmax = DEG_RAD*psMetadataLookupF32(NULL, recipe, "DEC_MAX"); 21 float MAGmax = psMetadataLookupF32(NULL, recipe, "MAG_MAX");21 // float MAGmax = psMetadataLookupF32(NULL, recipe, "MAG_MAX"); 22 22 23 23 // XXX CATDIR needs to look up abstracted name from psastro.config … … 53 53 54 54 // XXX set getstar in config? 55 // XXX TEST : no magnitude limit 55 56 // psStringAppend (&getstarLine, "/home/kiawe/eugene/psconfig/dev.lin64/bin/getstar %s -D CATMODE mef -maglim %f -region %f %f %f %f -o %s", catformat, MAGmax, RAmin, DECmin, RAmax, DECmax, tempFile); 56 psStringAppend (&getstarLine, "/home/kiawe/eugene/psconfig/dev.lin64/bin/getstar %s -D CATMODE mef -maglim %f -region %f %f %f %f -o %s", catformat, MAGmax, RAmin, DECmin, RAmax, DECmax, tempFile); 57 // psStringAppend (&getstarLine, "/home/kiawe/eugene/psconfig/dev.lin64/bin/getstar %s -D CATMODE mef -maglim %f -region %f %f %f %f -o %s", catformat, MAGmax, RAmin, DECmin, RAmax, DECmax, tempFile); 58 psStringAppend (&getstarLine, "/home/kiawe/eugene/psconfig/dev.lin64/bin/getstar %s -D CATMODE mef -region %f %f %f %f -o %s", catformat, RAmin, DECmin, RAmax, DECmax, tempFile); 57 59 psTrace ("psastro", 3, "%s\n", getstarLine); 58 60 -
trunk/psastro/src/psastroMosaicAstrom.c
r12536 r12718 74 74 if (psTraceGetLevel("psastro.dump") > 0) { psastroDumpMatches (fpa, "match.4.dat"); } 75 75 76 if (!psastroMosaicChipAstrom (fpa, recipe, false)) {76 if (!psastroMosaicChipAstrom (fpa, recipe, 0)) { 77 77 psError(PSASTRO_ERR_UNKNOWN, false, "failed to measure chip astrometry in mosaic mode (2nd pass)"); 78 78 return false; … … 82 82 // now fit the chips under the common distortion with higher-order terms 83 83 // first, re-perform the match with a slightly tighter circle 84 if (!psastroMosaicSetMatch (fpa, recipe, 1)) {84 if (!psastroMosaicSetMatch (fpa, recipe, 2)) { 85 85 psError(PSASTRO_ERR_UNKNOWN, false, "failed to match raw and ref stars for mosaic (3rd pass)"); 86 86 return false; 87 87 } 88 if (!psastroMosaicChipAstrom (fpa, recipe, true)) {88 if (!psastroMosaicChipAstrom (fpa, recipe, 1)) { 89 89 psError(PSASTRO_ERR_UNKNOWN, false, "failed to measure chip astrometry in mosaic mode (3rd pass)"); 90 90 return false; -
trunk/psastro/src/psastroMosaicChipAstrom.c
r10880 r12718 2 2 # define NONLIN_TOL 0.001 /* tolerance in pixels */ 3 3 4 bool psastroMosaicChipAstrom (pmFPA *fpa, psMetadata *recipe, bool nonlinear) {4 bool psastroMosaicChipAstrom (pmFPA *fpa, psMetadata *recipe, int iteration) { 5 5 6 6 pmChip *chip = NULL; … … 26 26 psMetadata *updates = psMetadataAlloc(); 27 27 28 psastroMosaicOneChip (chip, readout, recipe, updates, nonlinear); 28 if (!psastroMosaicOneChip (chip, readout, recipe, updates, iteration)) { 29 readout->data_exists = false; 30 psLogMsg ("psastro", 3, "failed to find a solution for %d,%d,%d\n", view->chip, view->cell, view->readout); 31 psFree (updates); 32 continue; 33 } 29 34 30 35 // create the header keywords to descripe the results -
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 } -
trunk/psastro/src/psastroOneChip.c
r12712 r12718 154 154 psFree (fitStats); 155 155 psFree (gridStats); 156 return true;156 return validSolution; 157 157 } 158 158
Note:
See TracChangeset
for help on using the changeset viewer.
