IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 7637


Ignore:
Timestamp:
Jun 22, 2006, 10:17:06 AM (20 years ago)
Author:
eugene
Message:

dropping old test code, freeing ref in skipped case

File:
1 edited

Legend:

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

    r7332 r7637  
    5252                float minY = -fieldExtra*Ny;
    5353                float maxY = (1+fieldExtra)*Ny;
    54                
     54
    5555                // the refstars is a subset within range of this chip
    5656                psArray *refstars = psArrayAlloc (100);
    57 
    58                 int Nst = 0;
    5957
    6058                // select the reference objects within range of this readout
     
    6866
    6967                    // limit the X,Y range of the refs to the selected chip
    70                     if (ref->chip->x < minX) continue;
    71                     if (ref->chip->x > maxX) continue;
    72                     if (ref->chip->y < minY) continue;
    73                     if (ref->chip->y > maxY) continue;
    74                    
    75                     if (Nst < 0) {
    76                         fprintf (stderr, "dn: %f,%f <- %f,%f <- %f,%f <- %f,%f\n",
    77                                  ref->chip->x, ref->chip->y,
    78                                  ref->FP->x, ref->FP->y,
    79                                  ref->TP->x, ref->TP->y,
    80                                  ref->sky->r, ref->sky->d);
    81 
    82                         psSphere *sk = psSphereAlloc();
    83                         psPlane *fp = psPlaneAlloc();
    84                         psPlane *tp = psPlaneAlloc();
    85 
    86                         psPlaneTransformApply (fp, chip->toFPA, ref->chip);
    87                         psPlaneDistortApply (tp, fpa->toTangentPlane, fp, 0.0, 0.0);
    88                         p_psDeproject (sk, tp, fpa->projection);
    89 
    90                         fprintf (stderr, "up: %f,%f -> %f,%f -> %f,%f -> %f,%f\n",
    91                                  ref->chip->x, ref->chip->y,
    92                                  fp->x, fp->y,
    93                                  tp->x, tp->y,
    94                                  sk->r, sk->d);
    95                     }
    96                     Nst ++;
     68                    if (ref->chip->x < minX) goto skip;
     69                    if (ref->chip->x > maxX) goto skip;
     70                    if (ref->chip->y < minY) goto skip;
     71                    if (ref->chip->y > maxY) goto skip;
    9772
    9873                    psArrayAdd (refstars, 100, ref);
     74                skip:
     75                    psFree (ref);
    9976                }
    10077                psTrace (__func__, 4, "Added %d refstars\n", refstars->n);
    101 
    10278                psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.REFSTARS", PS_DATA_ARRAY, "astrometry matches", refstars);
    103 
    104                 // XXX test point
    105                 if (0) {
    106                     pmChip *chip1 = fpa->chips->data[10];
    107                     pmCell *cell1 = chip1->cells->data[0];
    108                     pmReadout *readout1 = cell1->readouts->data[0];
    109                     psArray *refstars1 = psMetadataLookupPtr (NULL, readout1->analysis, "PSASTRO.REFSTARS");
    110                     pmAstromObj *ref1 = refstars1->data[0];
    111                     fprintf (stderr, "test 3: %f %f  %f %f  %f %f\n", ref1->chip->x, ref1->chip->y, ref1->FP->x, ref1->FP->y, ref1->sky->r, ref1->sky->d);
    112                 }
    11379
    11480                psFree (refstars);
Note: See TracChangeset for help on using the changeset viewer.