IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10076


Ignore:
Timestamp:
Nov 17, 2006, 9:35:22 PM (20 years ago)
Author:
eugene
Message:

working on new linear fit process

Location:
trunk/psphot/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotChoosePSF.c

    r9889 r10076  
    9797
    9898    // XXX test dump of psf stars and model
    99     if (0) {
     99    if (1) {
     100        psphotSaveImage (NULL, readout->image,  "testsub.fits");
    100101        pmSourcesWritePSFs (stars, "psfstars.dat");
    101102        try = models->data[0];
  • trunk/psphot/src/psphotEnsemblePSF.c

    r10052 r10076  
    1010// the analysis is performed wrt the simulated pixel values
    1111
    12 static bool SetBorderT (psSparseBorder *border, pmReadout *readout, psArray *refSources, bool fitSlope);
     12static bool SetBorderT (psSparseBorder *border, pmReadout *readout, psArray *refSources, psArray *fitSources, psVector *index, bool fitSlope);
    1313
    1414bool psphotEnsemblePSF (pmReadout *readout, psArray *refSources, psMetadata *recipe, pmPSF *psf, bool final) {
     
    162162    // set the sky, sky_x, sky_y components of border matrix
    163163    // XXX ignore sky slope terms for now
    164     SetBorderT (border, readout, refSources, false);
     164    SetBorderT (border, readout, refSources, fitSources, index, false);
    165165
    166166    psSparseConstraint constraint;
     
    170170
    171171    // solve for normalization terms (need include local sky?)
     172    # if (0)
    172173    psVector *norm = NULL;
    173174    psVector *skyfit = NULL;
    174175    psSparseBorderSolve (&norm, &skyfit, constraint, border, 3);
     176    # else
     177    psVector *norm = psSparseSolve (NULL, constraint, sparse, 3);
     178    # endif
    175179
    176180    // adjust fitSources, set refSources and subtract
     
    215219    psFree (weight);
    216220    psFree (errors);
     221    psFree (border);
    217222
    218223    psLogMsg (__func__, 3, "measure ensemble of PSFs: %f sec\n", psTimerMark ("psphot"));
     
    221226
    222227// calculate the weight terms for the sky fit component of the matrix
    223 static bool SetBorderT (psSparseBorder *border, pmReadout *readout, psArray *refSources, bool fitSlope) {
     228static bool SetBorderT (psSparseBorder *border, pmReadout *readout, psArray *refSources, psArray *fitSources, psVector *index, bool fitSlope) {
    224229
    225230    // generate the image-wide weight terms
     
    231236    // turn off MARK for all object pixels
    232237    // we must use the refSources here since their pixels point at the science image
    233     for (int i = 0; i < refSources->n; i++) {
    234         pmSource *refSource = refSources->data[i];
     238    for (int i = 0; i < fitSources->n; i++) {
     239        int N = index->data.U32[i];
     240        pmSource *refSource = refSources->data[N];
    235241        pmModel *model = pmSourceGetModel (NULL, refSource);
     242        if (model == NULL) continue;
    236243        float x = model->params->data.F32[PM_PAR_XPOS];
    237244        float y = model->params->data.F32[PM_PAR_YPOS];
Note: See TracChangeset for help on using the changeset viewer.