IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 18, 2006, 5:00:44 PM (20 years ago)
Author:
eugene
Message:

added tests to rationalize ra range

File:
1 edited

Legend:

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

    r9627 r9641  
    1010    bool status = false;
    1111    bool isMosaic = false;
    12     double RAmin = NAN, RAmax = NAN, RAminSky = NAN, RAmaxSky = NAN;
    13     double DECmin = NAN, DECmax = NAN;
     12    double RAmin = NAN;
     13    double RAmax = NAN;
     14    double RAminSky = NAN;
     15    double RAmaxSky = NAN;
     16    double DECmin = NAN;
     17    double DECmax = NAN;
    1418
    1519    pmChip *chip = NULL;
     
    5458        if (newFPA) {
    5559            newFPA = false;
     60            while (fpa->projection->R <        0) fpa->projection->R += 2.0*M_PI;
     61            while (fpa->projection->R > 2.0*M_PI) fpa->projection->R -= 2.0*M_PI;
    5662            RAminSky = fpa->projection->R - M_PI;
    5763            RAmaxSky = fpa->projection->R + M_PI;
     
    8086                    p_psDeproject (raw->sky, raw->TP, fpa->projection);
    8187
    82                     if ((i < 10) && (psTraceGetLevel("psastro") > 5)) {
    83                         fprintf (stderr, "up: %f,%f -> %f,%f -> %f,%f -> %f,%f\n",
     88                    if (i < 10) {
     89                        psTrace ("psastro", 8, "up: %f,%f -> %f,%f -> %f,%f -> %f,%f\n",
    8490                                 raw->chip->x, raw->chip->y,
    8591                                 raw->FP->x, raw->FP->y,
    8692                                 raw->TP->x, raw->TP->y,
    8793                                 raw->sky->r, raw->sky->d);
    88 
     94                       
    8995                        psPlane *fp = psPlaneAlloc();
    9096                        psPlane *tp = psPlaneAlloc();
    9197                        psPlane *ch = psPlaneAlloc();
    92 
     98                       
    9399                        p_psProject (tp, raw->sky, fpa->projection);
    94100                        psPlaneDistortApply (fp, fpa->fromTangentPlane, tp, 0.0, 0.0);
    95101                        psPlaneTransformApply (ch, chip->fromFPA, fp);
    96 
    97                         fprintf (stderr, "dn: %f,%f <- %f,%f <- %f,%f <- %f,%f\n",
     102                       
     103                        psTrace ("psastro", 8, "dn: %f,%f <- %f,%f <- %f,%f <- %f,%f\n",
    98104                                 ch->x, ch->y,
    99105                                 fp->x, fp->y,
     
    107113
    108114                    // rationalize ra to sky range centered on boresite
    109                     while (raw->sky->r < RAminSky) raw->sky->r += M_PI;
    110                     while (raw->sky->r > RAmaxSky) raw->sky->r -= M_PI;
     115                    while (raw->sky->r < RAminSky) raw->sky->r += 2.0*M_PI;
     116                    while (raw->sky->r > RAmaxSky) raw->sky->r -= 2.0*M_PI;
    111117
    112118                    RAmin = PS_MIN (raw->sky->r, RAmin);
     
    120126    }
    121127
    122     psLogMsg ("psastro", 2, "loaded data from %f,%f - %f,%f\n", RAmin, DECmin, RAmax, DECmax);
     128    psLogMsg ("psastro", 2, "loaded raw data from %f,%f to %f,%f\n",
     129              DEG_RAD*RAmin, DEG_RAD*DECmin,
     130              DEG_RAD*RAmax, DEG_RAD*DECmax);
    123131
    124132    psMetadataAdd (recipe, PS_LIST_TAIL, "RA_MIN",  PS_DATA_F32 | PS_META_REPLACE, "", RAmin);
Note: See TracChangeset for help on using the changeset viewer.