IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36156


Ignore:
Timestamp:
Sep 27, 2013, 8:47:32 PM (13 years ago)
Author:
eugene
Message:

psphotFullForce builds with new input data (probably close to ready)

Location:
branches/eam_branches/ipp-20130904/psphot/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130904/psphot/src/psphotGalaxyShape.c

    r36154 r36156  
    200200    int psfSize                    = PS_SCALAR_VALUE(job->args->data[5],S32);
    201201
     202    float fitRadius;
     203    float windowRadius;
     204
    202205    for (int i = 0; i < sources->n; i++) {
    203206
     
    240243bool psphotGalaxyShapeGrid (pmSource *source, pmSourceFitOptions *fitOptions, psImageMaskType maskVal, int psfSize) {
    241244
    242     // allocate the model
    243     // XXX need to figure out how to get the model into the program
    244     pmModelType modelType = pmModelClassGetType ("PS_MODEL_EXP");
    245 
     245    // we use the 0th model to define the initial guess shape
    246246    pmModel *model = source->modelFits->data[0];
    247247    if (!model) return false;
     248
     249    pmModelType modelType = model->type;
    248250
    249251    // we are using fitOptions->mode : be sure this makes sense
     
    261263    // I am going to retain the value of e0, and grid search around e1,e2
    262264    // I need to study a valid range (and distribution?) for e1,e2)
     265
     266    if (!source->galaxyFits) {
     267      source->galaxyFits = pmSourceGalaxyFitsAlloc();
     268    }
    263269
    264270    for (float de1 = -0.2; de1 <= +0.2; de1 += 0.1) {
     
    292298    pmPCMMakeModel (source, pcm->modelConv, maskVal, psfSize);
    293299       
     300    int nPix = 0;
    294301    float YY = 0.0;
    295302    float YM = 0.0;
     
    307314                continue;
    308315            }
     316
    309317            // skip nan value points
    310318            if (!isfinite(source->pixels->data.F32[iy][ix])) {
     
    319327            YM += fm * fy * wt;
    320328            MM += PS_SQR(fm) * wt;
     329            nPix ++;
    321330        }
    322331    }
    323332
    324333    float Io = YM / MM;
     334    float dIo = sqrt (1.0 / MM);
    325335    float Chisq = YY - 2 * Io * YM + Io * Io * MM;
    326336
    327337    fprintf (stderr, "Io: %f, Chisq: %f\n", Io, Chisq);
    328338
    329     return true;
    330 }
     339    psVectorAppend (source->galaxyFits->Io, Io);
     340    psVectorAppend (source->galaxyFits->dIo, dIo);
     341    psVectorAppend (source->galaxyFits->chisq, Chisq);
     342    source->galaxyFits->nPix = nPix;
     343
     344    return true;
     345}
  • branches/eam_branches/ipp-20130904/psphot/src/psphotMergeSources.c

    r36154 r36156  
    7676    bool status;
    7777    pmDetections *extCMF = NULL;
     78    pmDetections *extCFF = NULL;
    7879    psArray *extSourcesTXT = NULL;
    7980    int index = 0;
  • branches/eam_branches/ipp-20130904/psphot/src/psphotPetroFlux.c

    r36154 r36156  
    11# include "psphotInternal.h"
     2
     3# define PETROSIAN_RADII 2.0
    24
    35bool psphotPetroFlux (pmConfig *config, const pmFPAview *view, const char *filerule)
Note: See TracChangeset for help on using the changeset viewer.