IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 23, 2006, 6:16:11 PM (20 years ago)
Author:
eugene
Message:

fixed some errors with double sources, added second-pass linear PSF fit, multiple-depths

File:
1 edited

Legend:

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

    r6379 r6481  
    3434    sparse->Bfj->data.F32[2] = B->data.F32[2];
    3535
    36     x = psSparseSolve (x, sparse, 0);
    37     fprintf (stderr, "x: %f %f %f\n", x->data.F32[0], x->data.F32[1], x->data.F32[2]);
    38 
    39     x = psSparseSolve (x, sparse, 1);
    40     fprintf (stderr, "x: %f %f %f\n", x->data.F32[0], x->data.F32[1], x->data.F32[2]);
    41 
    42     x = psSparseSolve (x, sparse, 2);
    43     fprintf (stderr, "x: %f %f %f\n", x->data.F32[0], x->data.F32[1], x->data.F32[2]);
    44 
    45     x = psSparseSolve (x, sparse, 3);
    46     fprintf (stderr, "x: %f %f %f\n", x->data.F32[0], x->data.F32[1], x->data.F32[2]);
    47 
    48     x = psSparseSolve (x, sparse, 4);
     36    psSparseConstraint constraint;
     37    constraint.paramMin   = -1e8;
     38    constraint.paramMax   = +1e8;
     39    constraint.paramDelta = +1e8;
     40
     41    x = psSparseSolve (x, constraint, sparse, 0);
     42    fprintf (stderr, "x: %f %f %f\n", x->data.F32[0], x->data.F32[1], x->data.F32[2]);
     43
     44    x = psSparseSolve (x, constraint, sparse, 1);
     45    fprintf (stderr, "x: %f %f %f\n", x->data.F32[0], x->data.F32[1], x->data.F32[2]);
     46
     47    x = psSparseSolve (x, constraint, sparse, 2);
     48    fprintf (stderr, "x: %f %f %f\n", x->data.F32[0], x->data.F32[1], x->data.F32[2]);
     49
     50    x = psSparseSolve (x, constraint, sparse, 3);
     51    fprintf (stderr, "x: %f %f %f\n", x->data.F32[0], x->data.F32[1], x->data.F32[2]);
     52
     53    x = psSparseSolve (x, constraint, sparse, 4);
    4954    fprintf (stderr, "x: %f %f %f\n", x->data.F32[0], x->data.F32[1], x->data.F32[2]);
    5055    return;
     
    166171}
    167172
    168 psVector *psSparseSolve (psVector *guess, psSparse *sparse, int Niter) {
     173psVector *psSparseSolve (psVector *guess, psSparseConstraint constraint, psSparse *sparse, int Niter) {
    169174
    170175    psF32 dG;
     
    182187        for (int i = 0; i < dQ->n; i++) {
    183188            dG = (dQ->data.F32[i] - Bfj->data.F32[i]) / Qii->data.F32[i];
     189            if (fabs (dG) > constraint.paramDelta) {
     190                if (dG > 0) {
     191                    dG = +constraint.paramDelta;
     192                } else {
     193                    dG = -constraint.paramDelta;
     194                }
     195            }
    184196            guess->data.F32[i] -= dG;
     197            guess->data.F32[i] = PS_MAX (guess->data.F32[i], constraint.paramMin);
     198            guess->data.F32[i] = PS_MIN (guess->data.F32[i], constraint.paramMax);
    185199        }
    186200    }
     
    220234}
    221235
    222 
Note: See TracChangeset for help on using the changeset viewer.