IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36621


Ignore:
Timestamp:
Mar 31, 2014, 11:44:03 AM (12 years ago)
Author:
eugene
Message:

allow up to 6x6 aperture residual corrections; be a bit more strict about number of stars needed for higher orders; lensing terms seem to work

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

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140226/psphot/src/psphotApResid.c

    r34404 r36621  
    214214
    215215        // XXX make this user-configurable?
    216         if (source->psfMagErr > 0.01) continue;
     216        if (source->psfMagErr > 0.03) continue;
    217217
    218218        // aperture residual for this source
     
    267267
    268268    // set the max order (0 = constant) which the number of psf stars can support:
    269     // rule of thumb: require 3 stars per 'cell' (order+1)^2
     269    // we require only 3 stars for n = 0, increase stars / cell for higher order
    270270    int MaxOrderForStars = 0;
    271     if (Npsf >= 12) MaxOrderForStars = 1; // 4 cells
    272     if (Npsf >= 27) MaxOrderForStars = 2; // 9 cells
    273     if (Npsf >= 48) MaxOrderForStars = 3; // 16 cells
    274     if (Npsf >  75) MaxOrderForStars = 4; // 25 cells
     271    if (Npsf >=  16) MaxOrderForStars = 1; // 4 cells
     272    if (Npsf >=  54) MaxOrderForStars = 2; // 9 cells
     273    if (Npsf >= 128) MaxOrderForStars = 3; // 16 cells
     274    if (Npsf >= 300) MaxOrderForStars = 4; // 25 cells
     275    if (Npsf >  576) MaxOrderForStars = 5; // 36 cells
    275276
    276277    pmTrend2DMode mode = PM_TREND_MAP;
  • branches/eam_branches/ipp-20140226/psphot/src/psphotChoosePSF.c

    r35769 r36621  
    399399    char *modelName = pmModelClassGetName (psf->type);
    400400    psLogMsg ("psphot.pspsf", PS_LOG_WARN, "select psf model: %f sec\n", psTimerMark ("psphot.choose.psf"));
    401     psLogMsg ("psphot.pspsf", PS_LOG_INFO, "psf model %s, ApResid: %f +/- %f\n", modelName, psf->ApResid, psf->dApResid);
     401    psLogMsg ("psphot.pspsf", PS_LOG_INFO, "psf model %s, ApResid: %f +/- %f (%d x %d model)\n", modelName, psf->ApResid, psf->dApResid, psf->trendNx, psf->trendNy);
    402402
    403403    psFree (options);
  • branches/eam_branches/ipp-20140226/psphot/src/psphotLensing.c

    r36619 r36621  
    158158
    159159        // XXX make this user-configurable?
    160         if (source->psfMagErr > 0.01) continue;
     160        if (source->psfMagErr > 0.03) continue;
    161161
    162162        // aperture residual for this source
     
    192192
    193193    // set the max order (0 = constant) which the number of psf stars can support:
    194     // rule of thumb: require 3 stars per 'cell' (order+1)^2
     194    // we require only 3 stars for n = 0, increase stars / cell for higher order
    195195    int LensingTrendOrder = 0;
    196     if (Npsf >= 12) LensingTrendOrder = 1; // 4 cells
    197     if (Npsf >= 27) LensingTrendOrder = 2; // 9 cells
    198     if (Npsf >= 48) LensingTrendOrder = 3; // 16 cells
    199     if (Npsf >  75) LensingTrendOrder = 4; // 25 cells
     196    if (Npsf >=  16) LensingTrendOrder = 1; // 4 cells
     197    if (Npsf >=  54) LensingTrendOrder = 2; // 9 cells
     198    if (Npsf >= 128) LensingTrendOrder = 3; // 16 cells
     199    if (Npsf >= 300) LensingTrendOrder = 4; // 25 cells
     200    if (Npsf >  576) LensingTrendOrder = 5; // 36 cells
    200201
    201202    pmTrend2DMode mode = PM_TREND_MAP;
     
    217218    }
    218219
     220    psLogMsg ("psphot.lensing", PS_LOG_DETAIL, "generate lensing maps using %d objects (%d x %d grid)\n", Npsf, Nx, Ny);
     221
    219222    // XXX allow user to set this optionally?
    220223    psStats *stats = psStatsAlloc (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV);
     
    249252    for (int i = 0; i < sources->n; i++) {
    250253        source = sources->data[i];
    251 
    252         pmModel *model = source->modelPSF;
    253 
    254         float xPos = model->params->data.F32[PM_PAR_XPOS];
    255         float yPos = model->params->data.F32[PM_PAR_YPOS];
     254        pmPeak *peak = source->peak;
     255        if (!peak) continue;
     256
     257        float xPos = peak->xf;
     258        float yPos = peak->yf;
    256259
    257260        if (!source->lensingPSF) {
     
    283286    }
    284287
    285     psLogMsg ("psphot.lensing", PS_LOG_DETAIL, "calculate lensing parameters for %d objects\n", (int) sources->n);
     288    psFree (trendX11sm);
     289    psFree (trendX12sm);
     290    psFree (trendX22sm);
     291    psFree (trend_e1sm);
     292    psFree (trend_e2sm);
     293                     
     294    psFree (trendX11sh);
     295    psFree (trendX12sh);
     296    psFree (trendX22sh);
     297    psFree (trend_e1sh);
     298    psFree (trend_e2sh);
     299
     300    psFree (psfX11sm);
     301    psFree (psfX12sm);
     302    psFree (psfX22sm);
     303    psFree (psf_e1sm);
     304    psFree (psf_e2sm);
     305    psFree (psfX11sh);
     306    psFree (psfX12sh);
     307    psFree (psfX22sh);
     308    psFree (psf_e1sh);
     309    psFree (psf_e2sh);
     310    psFree (xPos    );
     311    psFree (yPos    );
     312
     313    psFree (stats);
     314
     315    psLogMsg ("psphot.lensing", PS_LOG_DETAIL, "calculate lensing parameters for %d objects: %f sec\n", (int) sources->n, psTimerMark ("psphot.lensing"));
    286316
    287317    return true;
Note: See TracChangeset for help on using the changeset viewer.