IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 24, 2006, 3:56:53 PM (20 years ago)
Author:
eugene
Message:

finished up the mosaic astrometry code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psastro/src/psastroMosaicSetMatch.c

    r9574 r10830  
    11# include "psastro.h"
    22
    3 bool psastroMosaicSetMatch (pmFPA *fpa, psMetadata *recipe) {
     3bool psastroMosaicSetMatch (pmFPA *fpa, psMetadata *recipe, int iteration) {
    44
    55    pmChip *chip = NULL;
     
    77    pmReadout *readout = NULL;
    88    pmFPAview *view = pmFPAviewAlloc (0);
    9 
    10     FILE *f;
    11     char name[128];
     9    char radiusWord[64];
    1210
    1311    FILE *g1 = fopen ("raw.ps.dat", "w");
    1412    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    }
    1522
    1623    // this loop selects the matched stars for all chips
     
    3744                psTrace ("psastro", 4, "Trying %ld refstars\n", refstars->n);
    3845
    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);
    4247                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);
    5948
    6049                for (int i = 0; i < matches->n; i++) {
Note: See TracChangeset for help on using the changeset viewer.