Changeset 7332 for trunk/psastro/src/psastroMosaicSetMatch.c
- Timestamp:
- Jun 4, 2006, 7:02:16 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psastro/src/psastroMosaicSetMatch.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastroMosaicSetMatch.c
r7154 r7332 7 7 pmReadout *readout = NULL; 8 8 pmFPAview *view = pmFPAviewAlloc (0); 9 10 FILE *f; 11 char name[128]; 12 13 FILE *g1 = fopen ("raw.ps.dat", "w"); 14 FILE *g2 = fopen ("ref.ps.dat", "w"); 9 15 10 16 // this loop selects the matched stars for all chips … … 23 29 24 30 // select the raw objects for this readout 25 psArray *rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO. OBJECTS");31 psArray *rawstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.RAWSTARS"); 26 32 if (rawstars == NULL) { continue; } 27 33 … … 29 35 psArray *refstars = psMetadataLookupPtr (NULL, readout->analysis, "PSASTRO.REFSTARS"); 30 36 if (refstars == NULL) { continue; } 37 psTrace (__func__, 4, "Trying %d refstars\n", refstars->n); 31 38 32 39 // use small radius to match stars (assume starting astrometry is good) 33 40 // XXX should this take a (double radius)? 34 psArray *matches = pmAstromRadiusMatch (rawstars, refstars, recipe); 41 psArray *matches = pmAstromRadiusMatchChip (rawstars, refstars, recipe); 42 psTrace (__func__, 4, "Matched %d 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 60 for (int i = 0; i < matches->n; i++) { 61 pmAstromMatch *match = matches->data[i]; 62 63 pmAstromObj *raw = rawstars->data[match->raw]; 64 fprintf (g1, "%d %f %f %f %f %f %f %f %f\n", i, 65 DEG_RAD*raw->sky->r, DEG_RAD*raw->sky->d, 66 raw->TP->x, raw->TP->y, 67 raw->FP->x, raw->FP->y, 68 raw->chip->x, raw->chip->y); 69 70 pmAstromObj *ref = refstars->data[match->ref]; 71 fprintf (g2, "%d %f %f %f %f %f %f %f %f\n", i, 72 DEG_RAD*ref->sky->r, DEG_RAD*ref->sky->d, 73 ref->TP->x, ref->TP->y, 74 ref->FP->x, ref->FP->y, 75 ref->chip->x, ref->chip->y); 76 } 35 77 36 78 // XXX drop the old one 37 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.MATCH", PS_DATA_ARRAY , "astrometry matches", matches);79 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.MATCH", PS_DATA_ARRAY | PS_META_REPLACE, "astrometry matches", matches); 38 80 } 39 81 } 40 82 } 83 fclose (g1); 84 fclose (g2); 41 85 return true; 42 86 }
Note:
See TracChangeset
for help on using the changeset viewer.
