IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10861


Ignore:
Timestamp:
Dec 30, 2006, 10:26:19 AM (19 years ago)
Author:
eugene
Message:

making test output optional on traces

File:
1 edited

Legend:

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

    r10855 r10861  
    7575                if (rawstars == NULL) { continue; }
    7676
    77                 FILE *f = fopen ("rawstars.dat", "w");
     77                if (psTraceGetLevel("psastro.dump.rawstars") > 2) {
     78                  dump_stars (rawstars, fpa, chip);
     79                }
     80
     81                if (psTraceGetLevel("psastro.plot.rawstars") > 2) {
     82                  plot_stars (rawstars, fpa, chip);
     83                }
     84
    7885                for (int i = 0; i < rawstars->n; i++) {
    7986                    pmAstromObj *raw = rawstars->data[i];
     
    8289                    psPlaneTransformApply (raw->TP, fpa->toTPA, raw->FP);
    8390                    psDeproject (raw->sky, raw->TP, fpa->toSky);
    84 
    85                     fprintf (f, "%d  %f %f  %f %f  %f %f  %f %f\n", i,
    86                              raw->sky->r, raw->sky->d,
    87                              raw->TP->x, raw->TP->y,
    88                              raw->FP->x, raw->FP->y,
    89                              raw->chip->x, raw->chip->y);
    90 
    91                     if (i < 10) {
    92                         psTrace ("psastro", 8, "up: %f,%f -> %f,%f -> %f,%f -> %f,%f\n",
    93                                  raw->chip->x, raw->chip->y,
    94                                  raw->FP->x, raw->FP->y,
    95                                  raw->TP->x, raw->TP->y,
    96                                  raw->sky->r, raw->sky->d);
    97                        
    98                         psPlane *fp = psPlaneAlloc();
    99                         psPlane *tp = psPlaneAlloc();
    100                         psPlane *ch = psPlaneAlloc();
    101                        
    102                         psProject (tp, raw->sky, fpa->toSky);
    103                         psPlaneTransformApply (fp, fpa->fromTPA, tp);
    104                         psPlaneTransformApply (ch, chip->fromFPA, fp);
    105                        
    106                         psTrace ("psastro", 8, "dn: %f,%f <- %f,%f <- %f,%f <- %f,%f\n",
    107                                  ch->x, ch->y,
    108                                  fp->x, fp->y,
    109                                  tp->x, tp->y,
    110                                  raw->sky->r, raw->sky->d);
    111 
    112                         psFree (fp);
    113                         psFree (tp);
    114                         psFree (ch);
    115                     }
    11691
    11792                    // rationalize ra to sky range centered on boresite
     
    125100                    DECmax = PS_MAX (raw->sky->d, DECmax);
    126101                }
    127                 fclose (f);
    128102            }
    129103        }
     
    151125   sky (ra, dec)
    152126*/
     127
     128dump_stars (psArray *rawstars, pmFPA *fpa, pmChip *chip) {
     129
     130  FILE *f1 = fopen ("rawstars.up.dat", "w");
     131  FILE *f2 = fopen ("rawstars.dn.dat", "w");
     132  for (int i = 0; i < rawstars->n; i++) {
     133    pmAstromObj *raw = rawstars->data[i];
     134
     135    psPlaneTransformApply (raw->FP, chip->toFPA, raw->chip);
     136    psPlaneTransformApply (raw->TP, fpa->toTPA, raw->FP);
     137    psDeproject (raw->sky, raw->TP, fpa->toSky);
     138
     139    fprintf (f1, "%d  %f %f  %f %f  %f %f  %f %f\n", i,
     140             raw->sky->r, raw->sky->d,
     141             raw->TP->x, raw->TP->y,
     142             raw->FP->x, raw->FP->y,
     143             raw->chip->x, raw->chip->y);
     144               
     145    psPlane *fp = psPlaneAlloc();
     146    psPlane *tp = psPlaneAlloc();
     147    psPlane *ch = psPlaneAlloc();
     148                       
     149    psProject (tp, raw->sky, fpa->toSky);
     150    psPlaneTransformApply (fp, fpa->fromTPA, tp);
     151    psPlaneTransformApply (ch, chip->fromFPA, fp);
     152                       
     153    fprintf (f2, "%d  %f %f  %f %f  %f %f  %f %f\n", i,
     154             raw->sky->r, raw->sky->d,
     155             tp->x, tp->y,
     156             fp->x, fp->y,
     157             ch->x, ch->y);
     158               
     159    psFree (fp);
     160    psFree (tp);
     161    psFree (ch);
     162  }
     163
     164  fclose (f1);
     165  fclose (f2);
     166}
Note: See TracChangeset for help on using the changeset viewer.