IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25450


Ignore:
Timestamp:
Sep 18, 2009, 4:32:13 PM (17 years ago)
Author:
bills
Message:

fix computation of chip coordinate bounding box for stamps using -arcrange

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/src/ppstampMakeStamp.c

    r25446 r25450  
    321321
    322322
    323 static void skyToChip(pmAstromObj *pt, pmFPA *fpa, pmChip *chip)
    324 {
    325     // convert from sky to TP to FP
    326     psProject(pt->TP, pt->sky, fpa->toSky);
     323static void TPToChip(pmAstromObj *pt, pmFPA *fpa, pmChip *chip)
     324{
    327325    psPlaneTransformApply(pt->FP, fpa->fromTPA, pt->TP);
    328326    // convert from FP to chip
    329327    psPlaneTransformApply(pt->chip, chip->fromFPA, pt->FP);
     328}
     329static void skyToChip(pmAstromObj *pt, pmFPA *fpa, pmChip *chip)
     330{
     331    // convert from sky to TP to FP
     332    psProject(pt->TP, pt->sky, fpa->toSky);
     333    TPToChip(pt, fpa, chip);
    330334}
    331335
     
    337341    psPlaneTransformApply(pt->TP, fpa->toTPA, pt->FP);
    338342    psDeproject(pt->sky, pt->TP, fpa->toSky);
    339 
    340343}
    341344
     
    359362
    360363    if (!options->roip.celestialCenter) {
    361         // Center was specified in chip coordinates, transform to the sky
     364        // Center was specified in chip coordinates, transform to the sky and the TP
    362365        chipToSky(center, fpa, chip);
    363366    }
     
    371374    options->roi.y1 = -INFINITY;
    372375
    373     pt->sky->rErr = 0;
    374     pt->sky->dErr = 0;
    375 
    376     pt->sky->r = center->sky->r - options->roip.dRA/2;
    377     pt->sky->d = center->sky->d - options->roip.dDEC/2;
    378     skyToChip(pt, fpa, chip);
     376    double dx = 0.5 * options->roip.dRA  / fpa->toSky->Xs;
     377    double dy = 0.5 * options->roip.dDEC / fpa->toSky->Ys;
     378
     379    pt->TP->xErr = 0;
     380    pt->TP->yErr = 0;
     381
     382    pt->TP->x = center->TP->x - dx;
     383    pt->TP->y = center->TP->y - dy;
     384    TPToChip(pt, fpa, chip);
    379385    compareToBox(&options->roi, pt->chip);
    380386
    381     pt->sky->r = center->sky->r + options->roip.dRA/2;
    382     pt->sky->d = center->sky->d - options->roip.dDEC/2;
    383     skyToChip(pt, fpa, chip);
     387    pt->TP->x = center->TP->x + dx;
     388    pt->TP->y = center->TP->y - dy;
     389    TPToChip(pt, fpa, chip);
    384390    compareToBox(&options->roi, pt->chip);
    385391
    386     pt->sky->r = center->sky->r + options->roip.dRA/2;
    387     pt->sky->d = center->sky->d + options->roip.dDEC/2;
    388     skyToChip(pt, fpa, chip);
     392    pt->TP->x = center->TP->x + dx;
     393    pt->TP->y = center->TP->y + dy;
     394    TPToChip(pt, fpa, chip);
    389395    compareToBox(&options->roi, pt->chip);
    390396
    391     pt->sky->r = center->sky->r - options->roip.dRA/2;
    392     pt->sky->d = center->sky->d + options->roip.dDEC/2;
    393     skyToChip(pt, fpa, chip);
     397    pt->TP->x = center->TP->x - dx;
     398    pt->TP->y = center->TP->y + dy;
     399    TPToChip(pt, fpa, chip);
    394400    compareToBox(&options->roi, pt->chip);
    395401
Note: See TracChangeset for help on using the changeset viewer.