Changeset 10830 for trunk/psastro/src/psastroMosaicSetMatch.c
- Timestamp:
- Dec 24, 2006, 3:56:53 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psastro/src/psastroMosaicSetMatch.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastroMosaicSetMatch.c
r9574 r10830 1 1 # include "psastro.h" 2 2 3 bool psastroMosaicSetMatch (pmFPA *fpa, psMetadata *recipe ) {3 bool psastroMosaicSetMatch (pmFPA *fpa, psMetadata *recipe, int iteration) { 4 4 5 5 pmChip *chip = NULL; … … 7 7 pmReadout *readout = NULL; 8 8 pmFPAview *view = pmFPAviewAlloc (0); 9 10 FILE *f; 11 char name[128]; 9 char radiusWord[64]; 12 10 13 11 FILE *g1 = fopen ("raw.ps.dat", "w"); 14 12 FILE *g2 = fopen ("ref.ps.dat", "w"); 13 14 // use small radius to match stars (assume starting astrometry is good) 15 bool status = false; 16 sprintf (radiusWord, "PSASTRO.MOSAIC.RADIUS.N%d", iteration); 17 double RADIUS = psMetadataLookupF32 (&status, recipe, radiusWord); 18 if (!status) { 19 psError(PS_ERR_IO, false, "Failed to lookup matching radius: %s", radiusWord); 20 return NULL; 21 } 15 22 16 23 // this loop selects the matched stars for all chips … … 37 44 psTrace ("psastro", 4, "Trying %ld refstars\n", refstars->n); 38 45 39 // use small radius to match stars (assume starting astrometry is good) 40 // XXX should this take a (double radius)? 41 psArray *matches = pmAstromRadiusMatchChip (rawstars, refstars, recipe); 46 psArray *matches = pmAstromRadiusMatchChip (rawstars, refstars, RADIUS); 42 47 psTrace ("psastro", 4, "Matched %ld refstars\n", matches->n); 43 44 sprintf (name, "raw.%02d.dat", view->chip);45 f = fopen (name, "w");46 for (int i = 0; i < rawstars->n; i++) {47 pmAstromObj *raw = rawstars->data[i];48 fprintf (f, "%f %f %f %f %f %f\n", raw->chip->x, raw->chip->y, raw->FP->x, raw->FP->y, raw->sky->r, raw->sky->d);49 }50 fclose (f);51 52 sprintf (name, "ref.%02d.dat", view->chip);53 f = fopen (name, "w");54 for (int i = 0; i < refstars->n; i++) {55 pmAstromObj *ref = refstars->data[i];56 fprintf (f, "%f %f %f %f %f %f\n", ref->chip->x, ref->chip->y, ref->FP->x, ref->FP->y, ref->sky->r, ref->sky->d);57 }58 fclose (f);59 48 60 49 for (int i = 0; i < matches->n; i++) {
Note:
See TracChangeset
for help on using the changeset viewer.
