IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10829


Ignore:
Timestamp:
Dec 24, 2006, 3:49:50 PM (19 years ago)
Author:
magnier
Message:

some API work to reduce dependencies on the recipes, support for mosaic astrometry

Location:
trunk/psModules/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/astrom/pmAstrometryDistortion.c

    r10825 r10829  
    77*  @author EAM, IfA
    88*
    9 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    10 *  @date $Date: 2006-12-22 21:23:06 $
     9*  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     10*  @date $Date: 2006-12-25 01:49:49 $
    1111*
    1212*  Copyright 2006 Institute for Astronomy, University of Hawaii
     
    5050}
    5151
    52 psArray *pmAstromMeasureGradients(psArray *grads, psArray *rawstars, psArray *refstars, psArray *matches, psMetadata *config)
     52psArray *pmAstromMeasureGradients(psArray *gradients, psArray *rawstars, psArray *refstars, psArray *matches, psMetadata *config)
    5353{
    5454
    55     if (grads == NULL) {
    56         grads = psArrayAllocEmpty (100);
     55    if (gradients == NULL) {
     56        gradients = psArrayAllocEmpty (100);
    5757    }
    5858
     
    141141            grad->dTPdM.y = local->coeff[0][1];
    142142
    143             psArrayAdd (grads, 100, grad);
    144         }
    145     }
    146     return grads;
     143            psArrayAdd (gradients, 100, grad);
     144        }
     145    }
     146    return gradients;
    147147}
    148148
    149 bool pmAstromFitDistortion(pmFPA *fpa, psArray *grads, psMetadata *config)
     149bool pmAstromFitDistortion(pmFPA *fpa, psArray *gradients, psMetadata *config)
    150150{
    151151
     
    154154
    155155    // assign the gradient elements to psVectors for fitting
    156     psVector *dPdL = psVectorAlloc (grads->n, PS_TYPE_F32);
    157     psVector *dQdL = psVectorAlloc (grads->n, PS_TYPE_F32);
    158     psVector *dPdM = psVectorAlloc (grads->n, PS_TYPE_F32);
    159     psVector *dQdM = psVectorAlloc (grads->n, PS_TYPE_F32);
    160     psVector *L = psVectorAlloc (grads->n, PS_TYPE_F32);
    161     psVector *M = psVectorAlloc (grads->n, PS_TYPE_F32);
    162 
    163     for (int i = 0; i < grads->n; i++) {
    164 
    165         pmAstromGradient *grad = grads->data[i];
     156    psVector *dPdL = psVectorAlloc (gradients->n, PS_TYPE_F32);
     157    psVector *dQdL = psVectorAlloc (gradients->n, PS_TYPE_F32);
     158    psVector *dPdM = psVectorAlloc (gradients->n, PS_TYPE_F32);
     159    psVector *dQdM = psVectorAlloc (gradients->n, PS_TYPE_F32);
     160    psVector *L = psVectorAlloc (gradients->n, PS_TYPE_F32);
     161    psVector *M = psVectorAlloc (gradients->n, PS_TYPE_F32);
     162
     163    for (int i = 0; i < gradients->n; i++) {
     164
     165        pmAstromGradient *grad = gradients->data[i];
    166166
    167167        dPdL->data.F32[i] = grad->dTPdL.x;
     
    176176
    177177    psStats *stats = psStatsAlloc (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV);
    178     psVector *mask = psVectorAlloc (grads->n, PS_TYPE_MASK);
     178    psVector *mask = psVectorAlloc (gradients->n, PS_TYPE_MASK);
    179179    psVectorInit (mask, 0);
    180180
     
    185185
    186186    // set masks based on fpa->toTP
    187     for (int i = 0; i < fpa->toTPA->x->nX; i++) {
    188         for (int j = 0; j < fpa->toTPA->x->nY; j++) {
     187    for (int i = 0; i <= fpa->toTPA->x->nX; i++) {
     188        for (int j = 0; j <= fpa->toTPA->x->nY; j++) {
    189189            if (fpa->toTPA->x->mask[i][j]) {
    190                 localX->mask[i-1][j] = 1;
    191                 localY->mask[i][j-1] = 1;
     190                if ((i > 0) && (i < fpa->toTPA->x->nX)) {
     191                    localX->mask[i-1][j] = 1;
     192                }
     193                if ((j > 0) && (j < fpa->toTPA->y->nY)) {
     194                    localY->mask[i][j-1] = 1;
     195                }
    192196            }
    193197        }
     
    247251    psVector *dQdMf = psPolynomial2DEvalVector (localY, L, M);
    248252
    249     FILE *f = fopen ("grads.dat", "w");
     253    FILE *f = fopen ("gradients.dat", "w");
    250254    for (int i = 0; i < dPdLf->n; i++) {
    251255        fprintf (f, "%f %f  | %f %f  %f %f | %f %f  %f %f\n",
     
    290294    psFree (mask);
    291295
     296    // XXX need to reset the fromFPA terms here
     297
     298
    292299    return true;
    293300}
  • trunk/psModules/src/astrom/pmAstrometryObjects.c

    r10780 r10829  
    88*  @author EAM, IfA
    99*
    10 *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2006-12-17 09:45:20 $
     10*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2006-12-25 01:49:49 $
    1212*
    1313*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    121121
    122122/************************************************************************************************************/
    123 
     123// macro to generate code for radius match function based on desired member
     124// radius is in units of matching member (eg, pixels for chip, microns for FP, etc)
    124125#define MAKE_ASTROM_RADIUS(FUNC, MEMBER) \
    125126psArray *FUNC( \
    126127               const psArray *st1, \
    127128               const psArray *st2, \
    128                const psMetadata *config) \
     129               double RADIUS) \
    129130{ \
    130131    PS_ASSERT_PTR_NON_NULL(st1, NULL); \
    131132    PS_ASSERT_PTR_NON_NULL(st2, NULL); \
    132     PS_ASSERT_PTR_NON_NULL(config, NULL); \
    133133    \
    134134    assert(st1->n == 0 || pmIsAstromObj(st1->data[0])); \
    135135    assert(st2->n == 0 || pmIsAstromObj(st2->data[0])); \
    136136    \
    137     bool status = false; \
    138     double RADIUS = psMetadataLookupF32 (&status, config, "PSASTRO.MATCH.RADIUS"); \
    139     if (!status) { \
    140         psError(PS_ERR_IO, false, "Failed to lookup matching radius"); \
    141         return NULL; \
    142     } \
    143137    /* sort both lists by X coord; st1 first */ \
    144138    psVector *x1 = psVectorAlloc(st1->n, PS_TYPE_F64); \
     
    186180 */
    187181MAKE_ASTROM_RADIUS(pmAstromRadiusMatch, FP)
     182MAKE_ASTROM_RADIUS(pmAstromRadiusMatchFP, FP)
    188183MAKE_ASTROM_RADIUS(pmAstromRadiusMatchTP, TP)
    189184MAKE_ASTROM_RADIUS(pmAstromRadiusMatchChip, chip)
    190185
    191186/******************************************************************************
    192 pmAstromMatchFit(map, raw, ref, match, config): take two matched star lists
     187pmAstromMatchFit(map, raw, ref, match, stats): take two matched star lists
    193188and fit a psPlaneTransform between them
    194189 ******************************************************************************/
    195 bool pmAstromMatchFit(
     190pmAstromFitResults *pmAstromMatchFit(
    196191    psPlaneTransform *map,
    197192    psArray *raw,
    198193    psArray *ref,
    199194    psArray *match,
    200     psMetadata *config,
    201     psMetadata *updates)
     195    psStats *stats)
    202196{
    203197    PS_ASSERT_PTR_NON_NULL(map, NULL);
     
    205199    PS_ASSERT_PTR_NON_NULL(ref, NULL);
    206200    PS_ASSERT_PTR_NON_NULL(match, NULL);
    207     PS_ASSERT_PTR_NON_NULL(config, NULL);
    208 
    209     bool status;
    210     pmAstromObj *rawStar, *refStar;
    211     pmAstromMatch *pair;
    212 
    213     // XXX EAM : clip fit seems to only work for F32!
    214     // XXX EAM : clip fit fails to handle NULL error
     201    PS_ASSERT_PTR_NON_NULL(stats, NULL);
     202
     203    // reassign values for clip fit
     204    // XXX set wt based on mag error?
    215205    psVector *X = psVectorAlloc (match->n, PS_TYPE_F32);
    216206    psVector *Y = psVectorAlloc (match->n, PS_TYPE_F32);
     
    220210    // take the matched stars, first fit
    221211    for (int i = 0; i < match->n; i++) {
    222 
    223         pair    = match->data[i];
    224         rawStar = raw->data[pair->raw];
    225         refStar = ref->data[pair->ref];
     212        pmAstromMatch *pair = match->data[i];
     213        pmAstromObj *rawStar = raw->data[pair->raw];
     214        pmAstromObj *refStar = ref->data[pair->ref];
    226215
    227216        X->data.F32[i] = rawStar->chip->x;
     
    238227    psVectorInit (mask, 0);
    239228
    240     double dX, dY;
    241 
    242     psStats *stats = psStatsAlloc (PS_STAT_CLIPPED_MEAN | PS_STAT_CLIPPED_STDEV);
    243     stats->clipSigma = psMetadataLookupF32 (&status, config, "PSASTRO.CHIP.NSIGMA");
    244     stats->clipIter = 1;
    245     int clipIter  = psMetadataLookupS32 (&status, config, "PSASTRO.CHIP.NITER");
    246     // we run 'clipIter' cycles clipping in each of x and y
     229    pmAstromFitResults *results = pmAstromFitResultsAlloc();
     230    results->xStats = psStatsAlloc (PS_STAT_NONE);
     231    results->yStats = psStatsAlloc (PS_STAT_NONE);
     232    *results->xStats = *stats;
     233    *results->yStats = *stats;
     234    results->xStats->clipIter = 1;
     235    results->yStats->clipIter = 1;
    247236
    248237    // fit chip-to-FPA transformation
    249     // XXX should force x->n and y->n to be the same
    250     for (int i = 0; i < clipIter; i++) {
    251         psVectorClipFitPolynomial2D (map->x, stats, mask, 0xff, x, wt, X, Y);
    252         psLogMsg ("psModules.astrom", 3, "x resid: %f +/- %f (%ld of %ld)\n", stats->clippedMean, stats->clippedStdev, stats->clippedNvalues, x->n);
    253         dX = stats->clippedStdev;
    254 
    255         psVectorClipFitPolynomial2D (map->y, stats, mask, 0xff, y, wt, X, Y);
    256         psLogMsg ("psModules.astrom", 3, "y resid: %f +/- %f (%ld of %ld)\n", stats->clippedMean, stats->clippedStdev, stats->clippedNvalues, y->n);
    257         dY = stats->clippedStdev;
    258     }
    259 
    260     // XXXX test dump output code
    261     # if (0)
    262         psVector *xfit = psPolynomial2DEvalVector(map->x, X, Y);
    263     psVector *yfit = psPolynomial2DEvalVector(map->y, X, Y);
    264     FILE *f = fopen ("match.dat", "w");
    265     for (int i = 0; i < x->n; i++) {
    266         fprintf (f, "%3d %1d %1d %f %f  %f %f   %f %f\n",
    267                  i, mask->data.U8[i], mask->data.U8[i],
    268                  X->data.F32[i], Y->data.F32[i],
    269                  xfit->data.F32[i], yfit->data.F32[i],
    270                  x->data.F32[i], y->data.F32[i]);
    271     }
    272     fclose (f);
    273     psFree (xfit);
    274     psFree (yfit);
    275     # endif
    276 
    277     // XXX this is somewhat ad-hoc: we need to be sure these values are in arcsec
    278     // and we need to set NASTRO = 0 if we have a failure, etc
    279     // XXX this is a somewhat silly place to write these updates...
    280     if (updates) {
    281         psMetadataAddF32 (updates, PS_LIST_TAIL, "NASTRO",   PS_META_REPLACE, "", stats->clippedNvalues);
    282         psMetadataAddF32 (updates, PS_LIST_TAIL, "CERROR",   PS_META_REPLACE, "", hypot(dX, dY));
    283         psMetadataAddF32 (updates, PS_LIST_TAIL, "CPRECISE", PS_META_REPLACE, "", hypot(dX, dY)/sqrt(PS_MIN(x->n, y->n)));
    284         psMetadataAddF32 (updates, PS_LIST_TAIL, "EQUINOX",  PS_META_REPLACE, "", 2000.0); // XXX this is bogus: must be defined somewhere
    285     }
    286 
    287     float maxError = psMetadataLookupF32 (&status, config, "PSASTRO.MAX.ERROR");
    288     float astError = hypot(dX, dY);
    289     int minNstar = psMetadataLookupS32 (&status, config, "PSASTRO.MIN.NSTAR");
    290     int astNstar = stats->clippedNvalues;
    291 
    292     if (astError > maxError) {
    293         psError(PS_ERR_UNKNOWN, true, "residual error is too large, failed to find a solution: %f > %f", astError, maxError);
    294         return NULL;
    295     }
    296     if (stats->clippedNvalues < minNstar) {
    297         psError(PS_ERR_UNKNOWN, true, "solution uses too few stars: %d < %d", astNstar, minNstar);
    298         return NULL;
    299     }
    300     psLogMsg ("psModules.astrom", 3, "astrometry solution: error: %f, Nstars: %d", astError, astNstar);
     238    // we run 'clipIter' cycles clipping in each of x and y, with only one iteration each
     239    for (int i = 0; i < stats->clipIter; i++) {
     240        psVectorClipFitPolynomial2D (map->x, results->xStats, mask, 0xff, x, wt, X, Y);
     241        psTrace ("psModules.astrom", 3, "x resid: %f +/- %f (%ld of %ld)\n", stats->clippedMean, stats->clippedStdev, stats->clippedNvalues, x->n);
     242
     243        psVectorClipFitPolynomial2D (map->y, results->yStats, mask, 0xff, y, wt, X, Y);
     244        psTrace ("psModules.astrom", 3, "y resid: %f +/- %f (%ld of %ld)\n", stats->clippedMean, stats->clippedStdev, stats->clippedNvalues, y->n);
     245    }
     246    results->xStats->clipIter = stats->clipIter;
     247    results->yStats->clipIter = stats->clipIter;
    301248
    302249    psFree (x);
     
    305252    psFree (Y);
    306253    psFree (wt);
    307     psFree (stats);
    308254    psFree (mask);
    309255
    310     return (map);
     256    return (results);
    311257}
    312258
     
    377323
    378324    return (stats);
     325}
     326
     327/******************************************************************************
     328pmAstromFitResultsFree(stats)
     329 ******************************************************************************/
     330static void pmAstromFitResultsFree(pmAstromFitResults *results)
     331{
     332    if (results == NULL)
     333        return;
     334    psFree (results->xStats);
     335    psFree (results->yStats);
     336    return;
     337}
     338
     339/******************************************************************************
     340pmAstromFitResultsAlloc()
     341 ******************************************************************************/
     342pmAstromFitResults *pmAstromFitResultsAlloc(void)
     343{
     344    pmAstromFitResults *results = psAlloc (sizeof(pmAstromFitResults));
     345    psMemSetDeallocator (results, (psFreeFunc)pmAstromFitResultsFree);
     346
     347    results->xStats    = NULL;
     348    results->yStats    = NULL;
     349    results->nMatch    = 0;
     350    results->nSigma    = 0;
     351
     352    return (results);
    379353}
    380354
  • trunk/psModules/src/astrom/pmAstrometryObjects.h

    r10780 r10829  
    88*  @author EAM, IfA
    99*
    10 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2006-12-17 09:45:20 $
     10*  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2006-12-25 01:49:49 $
    1212*
    1313*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    7979pmAstromStats;
    8080
    81 /*
    82  *
    83  * If the two sets of coordinates are expected to agree very well (ie, the
    84  * current best-guess astrometric solution is quite close to the radius. The
    85  * following function accepts two sets of pmAstromObj sources and determines the
    86  * matched objects between the two lists. The input sources must have been
    87  * projected to the Focal Plane coordinates (pmAstromObj.FP), and the supplied
    88  * options entry must contain the desired match radius (keyword:
    89  * ASTROM.MATCH.RADIUS). The output consists an array of pmAstromMatch values,
    90  * defined below.
     81typedef struct
     82{
     83    psStats *xStats;
     84    psStats *yStats;
     85    int     nMatch;                     ///<
     86    double  nSigma;                     ///<
     87}
     88pmAstromFitResults;
     89
     90/*
     91 *
     92 * If the two sets of coordinates are expected to agree very well (ie, the current best-guess
     93 * astrometric solution is quite close to reality), perform a match based on a simple radius
     94 * test. The following functions accept two sets of pmAstromObj sources and determines the
     95 * matched objects between the two lists using coordinates of the desired depth (depending on
     96 * the function). The input and reference sources must have been projected to the desired depth
     97 * (eg, for Focal Plane coordinates, to pmAstromObj.FP).  The specified radius must be in the
     98 * units for the matching depth (chip: pixels, focal plane: microns, tangent plane:
     99 * degrees. The output consists an array of pmAstromMatch values, defined above.
    91100 *
    92101 */
     
    94103    const psArray *st1,
    95104    const psArray *st2,
    96     const psMetadata *config
     105    double RADIUS
     106);
     107psArray *pmAstromRadiusMatchFP(
     108    const psArray *st1,
     109    const psArray *st2,
     110    double RADIUS
    97111);
    98112psArray *pmAstromRadiusMatchTP(
    99113    const psArray *st1,
    100114    const psArray *st2,
    101     const psMetadata *config
     115    double RADIUS
    102116);
    103117psArray *pmAstromRadiusMatchChip(
    104118    const psArray *st1,
    105119    const psArray *st2,
    106     const psMetadata *config
     120    double RADIUS
    107121);
    108122
     
    270284 */
    271285
     286pmAstromFitResults *pmAstromFitResultsAlloc(void);
    272287
    273288/*
     
    312327 *
    313328 */
    314 bool pmAstromMatchFit(
     329pmAstromFitResults *pmAstromMatchFit(
    315330    psPlaneTransform *map,
    316     psArray *st1,
    317     psArray *st2,
     331    psArray *raw,
     332    psArray *ref,
    318333    psArray *match,
    319     psMetadata *config,
    320     psMetadata *updates
     334    psStats *stats
    321335);
    322336
  • trunk/psModules/src/astrom/pmAstrometryWCS.c

    r10825 r10829  
    77 *  @author EAM, IfA
    88 *
    9  *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2006-12-22 21:23:06 $
     9 *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2006-12-25 01:49:49 $
    1111 *
    1212 *  Copyright 2006 Institute for Astronomy, University of Hawaii
     
    3232
    3333// interpret header WCS (only handles traditional WCS for the moment)
    34 // plateScale is nominal physical scale on tangent plane (radians / TPA physical units)
    35 bool pmAstromReadWCS (pmFPA *fpa, pmChip *chip, const psMetadata *header, double plateScale)
     34// pixelScale is microns per pixel
     35bool pmAstromReadWCS (pmFPA *fpa, pmChip *chip, const psMetadata *header, double pixelScale)
    3636{
    3737    pmAstromWCS *wcs = pmAstromWCSfromHeader (header);
     
    4040    }
    4141
    42     bool status = pmAstromWCStoFPA (fpa, chip, wcs, plateScale);
     42    bool status = pmAstromWCStoFPA (fpa, chip, wcs, pixelScale);
    4343
    4444    psFree (wcs);
     
    6767
    6868// interpret chip header WCS as bilevel chip components
    69 // plateScale is nominal physical scale on tangent plane (radians / TPA physical units)
    7069bool pmAstromReadBilevelChip (pmChip *chip, const psMetadata *header)
    7170{
     
    8281
    8382// convert toFPA / toSky components to traditional WCS
    84 // plateScale is nominal physical scale on tangent plane (microns / arcsecond)
    8583bool pmAstromReadBilevelMosaic (pmFPA *fpa, const psMetadata *header)
    8684{
     
    359357
    360358// interpret header WCS (only handles traditional WCS for the moment)
    361 // plateScale is nominal physical scale on tangent plane (radians / TPA physical units)
    362 bool pmAstromWCStoFPA (pmFPA *fpa, pmChip *chip, const pmAstromWCS *wcs, double plateScale)
     359// pixelScale is the pixel size in microns per pixel
     360bool pmAstromWCStoFPA (pmFPA *fpa, pmChip *chip, const pmAstromWCS *wcs, double pixelScale)
    363361{
    364362    psPlaneTransform *toFPA;
     
    367365     * wcs->trans, which will convert X,Y in pixels to L,M in degrees.  we also have the following
    368366     * elements defined:
    369      * type (CTYPE)
     367     * type (projection type)
    370368     * crval1,2 (in RA,DEC degrees)
    371369     * crpix1,2
    372370     * cdelt1,2 (in degrees / pixel)
    373      * plateScale (radians / physical TPA units)
     371     * pixelScale (microns / pixel)
    374372     *
    375373     * now we convert wcs->trans to toFPA, which is different from wcs->trans in 3 important ways:
    376      * 1) the output is in pixels (not degrees): divide by cdelt1,2 raised to an appropriate power
     374     * 1) the output is in microns (not degrees): divide by cdelt1,2
    377375     * 2) X,Y are applied directly, without an applied Xo,Yo offset
    378376     * 3) there is an allowed Lo,Mo term ([0][0] coefficients)
    379377     */
    380378
    381     // convert wcs->trans to a matrix which yields L,M in pixels
    382     double cdelt1 = hypot (wcs->trans->x->coeff[1][0], wcs->trans->x->coeff[0][1]);
    383     double cdelt2 = hypot (wcs->trans->y->coeff[1][0], wcs->trans->y->coeff[0][1]);
    384     for (int i = 0; i <= wcs->trans->x->nX; i++) {
    385         for (int j = 0; j <= wcs->trans->x->nX; j++) {
    386             wcs->trans->x->coeff[i][j] /= cdelt1;
    387             wcs->trans->y->coeff[i][j] /= cdelt2;
    388         }
    389     }
    390 
    391379    // create transformation with 0,0 reference pixel
    392380    toFPA = psPlaneTransformSetCenter (NULL, wcs->trans, -wcs->crpix1, -wcs->crpix2);
    393381
    394     // scale from FPA to TPA (microns / pixel)
    395     double pdelt1 = cdelt1*PM_RAD_DEG / plateScale;
    396     double pdelt2 = cdelt2*PM_RAD_DEG / plateScale;
     382    // modify scale of toFPA to yield L,M in microns
     383    double cdelt1 = hypot (toFPA->x->coeff[1][0], toFPA->x->coeff[0][1]);
     384    double cdelt2 = hypot (toFPA->y->coeff[1][0], toFPA->y->coeff[0][1]);
     385    for (int i = 0; i <= toFPA->x->nX; i++) {
     386        for (int j = 0; j <= toFPA->x->nX; j++) {
     387            toFPA->x->coeff[i][j] *= pixelScale/cdelt1;
     388            toFPA->y->coeff[i][j] *= pixelScale/cdelt2;
     389        }
     390    }
     391
     392    // scale from FPA to TPA (degrees / micron)
     393    double pdelt1 = cdelt1 / pixelScale;
     394    double pdelt2 = cdelt2 / pixelScale;
    397395    float rX = 1.0;
    398396    float rY = 1.0;
    399397
    400     // projection from TPA to SKY
    401     psProjection *toSky = psProjectionAlloc (wcs->toSky->R, wcs->toSky->D, plateScale, plateScale, wcs->toSky->type);
     398    // projection from TPA ("linear" degrees) to SKY (radians)
     399    psProjection *toSky = psProjectionAlloc (wcs->toSky->R, wcs->toSky->D, PM_RAD_DEG, PM_RAD_DEG, wcs->toSky->type);
    402400
    403401    if (fpa->toSky == NULL) {
     
    558556
    559557    // cdelt1,2 convert from pixels->degrees
    560     double cdelt1 = fpa->toTPA->x->coeff[1][0]*fpa->toSky->Xs*PM_DEG_RAD;
    561     double cdelt2 = fpa->toTPA->y->coeff[0][1]*fpa->toSky->Ys*PM_DEG_RAD;
     558    double cdelt1 = fpa->toTPA->x->coeff[1][0];
     559    double cdelt2 = fpa->toTPA->y->coeff[0][1];
    562560    wcs->cdelt1 = cdelt1;
    563561    wcs->cdelt2 = cdelt2;
  • trunk/psModules/src/objects/pmSourceIO.c

    r10421 r10829  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2006-12-03 18:48:10 $
     5 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2006-12-25 01:49:50 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    256256            if (phu) {
    257257                outhead = psMetadataCopy (NULL, phu->header);
     258
     259                // if we have mosaic-level astrometry information, add it here:
     260                updates = psMetadataLookupPtr (&status, file->fpa->analysis, "PSASTRO.HEADER");
     261                if (updates) {
     262                    psMetadataCopy (outhead, updates);
     263                }
     264
    258265                psMetadataAddBool (outhead, PS_LIST_TAIL, "EXTEND", PS_META_REPLACE, "this file has extensions", true);
    259266                // XXX what is the EXTNAME??
Note: See TracChangeset for help on using the changeset viewer.