Changeset 20805 for trunk/psastro/src/psastroMosaicSetMatch.c
- Timestamp:
- Nov 19, 2008, 3:28:01 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psastro/src/psastroMosaicSetMatch.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastroMosaicSetMatch.c
r17108 r20805 10 10 11 11 // use small radius to match stars (assume starting astrometry is good) 12 bool status = false; 12 bool status = false; 13 13 sprintf (radiusWord, "PSASTRO.MOSAIC.RADIUS.N%d", iteration); 14 double RADIUS = psMetadataLookupF32 (&status, recipe, radiusWord); 15 if (!status) { 16 psError(PS_ERR_IO, false, "Failed to lookup matching radius: %s", radiusWord); 17 psFree (view);18 return false; 19 } 14 double RADIUS = psMetadataLookupF32 (&status, recipe, radiusWord); 15 if (!status) { 16 psError(PS_ERR_IO, false, "Failed to lookup matching radius: %s", radiusWord); 17 psFree (view); 18 return false; 19 } 20 20 21 21 if (RADIUS <= 0.0) { 22 if (iteration == 0) {23 psError(PS_ERR_IO, false, "Invalid match radius for first iteration: %s", radiusWord); 24 psFree (view);25 return false; 26 } 27 psWarning ("skipping match for iteration %d\n", iteration);28 psFree (view);29 return true;22 if (iteration == 0) { 23 psError(PS_ERR_IO, false, "Invalid match radius for first iteration: %s", radiusWord); 24 psFree (view); 25 return false; 26 } 27 psWarning ("skipping match for iteration %d\n", iteration); 28 psFree (view); 29 return true; 30 30 } 31 31 … … 34 34 psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 35 35 if (!chip->process || !chip->file_exists) { continue; } 36 if (!chip->fromFPA) { continue; }37 38 while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) {36 if (!chip->fromFPA) { continue; } 37 38 while ((cell = pmFPAviewNextCell (view, fpa, 1)) != NULL) { 39 39 psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 40 40 if (!cell->process || !cell->file_exists) { continue; } 41 41 42 // process each of the readouts43 // XXX there can only be one readout per chip, right?44 while ((readout = pmFPAviewNextReadout (view, fpa, 1)) != NULL) {45 if (! readout->data_exists) { continue; }42 // process each of the readouts 43 // XXX there can only be one readout per chip, right? 44 while ((readout = pmFPAviewNextReadout (view, fpa, 1)) != NULL) { 45 if (! readout->data_exists) { continue; } 46 46 47 // select the raw objects for this readout48 psArray *rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.RAWSTARS");49 if (rawstars == NULL) { continue; }47 // select the raw objects for this readout 48 psArray *rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.RAWSTARS"); 49 if (rawstars == NULL) { continue; } 50 50 51 // select the raw objects for this readout52 psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS");53 if (refstars == NULL) { continue; }54 psTrace ("psastro", 4, "Trying %ld refstars\n", refstars->n);51 // select the raw objects for this readout 52 psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS"); 53 if (refstars == NULL) { continue; } 54 psTrace ("psastro", 4, "Trying %ld refstars\n", refstars->n); 55 55 56 psArray *matches = pmAstromRadiusMatchChip (rawstars, refstars, RADIUS);57 psTrace ("psastro", 4, "Matched %ld refstars\n", matches->n);56 psArray *matches = pmAstromRadiusMatchChip (rawstars, refstars, RADIUS); 57 psTrace ("psastro", 4, "Matched %ld refstars\n", matches->n); 58 58 59 // XXX drop the old one 60 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.MATCH", PS_DATA_ARRAY | PS_META_REPLACE, "astrometry matches", matches); 61 psFree (matches); 62 } 63 } 59 psastroVisualPlotMosaicMatches(rawstars, refstars, matches, iteration, recipe); 60 61 // XXX drop the old one 62 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.MATCH", PS_DATA_ARRAY | PS_META_REPLACE, "astrometry matches", matches); 63 psFree (matches); 64 } 65 } 64 66 } 65 67 psFree (view);
Note:
See TracChangeset
for help on using the changeset viewer.
