IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 2, 2007, 3:26:52 PM (20 years ago)
Author:
eugene
Message:

fixed mosaic analysis; cleaned up test code (some in traces, some removed), general output cleanups

File:
1 edited

Legend:

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

    r10830 r10880  
    11# include "psastro.h"
    22
    3 psArray *psastroMosaicGradients (pmFPA *fpa, psMetadata *recipe) {
     3bool psastroMosaicGradients (pmFPA *fpa, psMetadata *recipe) {
    44
     5    bool status;
    56    pmChip *chip = NULL;
    67    pmCell *cell = NULL;
     
    3637
    3738                // measure the local gradients for this set of stars
    38                 // XXX update the function prototype to accept an incoming gradient structure to which the new elements are added
    3939                gradients = pmAstromMeasureGradients (gradients, rawstars, refstars, match, recipe);
    4040            }
    4141        }
    4242    }
    43     return (gradients);
     43
     44    // allocate mosaic-level polynomial transformation and set masks needed by DVO
     45    int order = psMetadataLookupF32 (&status, recipe, "PSASTRO.MOSAIC.ORDER");
     46    if (!status) {
     47        psError(PSASTRO_ERR_UNKNOWN, false, "failed to find single-chip fit order\n");
     48        return false;
     49    }
     50    psFree (fpa->toTPA);
     51    fpa->toTPA = psPlaneTransformAlloc (order, order);
     52    for (int i = 0; i <= fpa->toTPA->x->nX; i++) {
     53        for (int j = 0; j <= fpa->toTPA->x->nY; j++) {
     54            if (i + j > order) {
     55                fpa->toTPA->x->mask[i][j] = 1;
     56                fpa->toTPA->y->mask[i][j] = 1;
     57            }
     58        }
     59    }
     60
     61    // fit the measured gradients with the telescope distortion model (polynomial order based on toTPA)
     62    pmAstromFitDistortion (fpa, gradients, recipe);
     63    psastroMosaicSetAstrom (fpa);
     64
     65    psFree (gradients);
     66    psFree (view);
     67    return true;
    4468}
Note: See TracChangeset for help on using the changeset viewer.