IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 29, 2015, 5:55:41 AM (11 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20150112/psphot
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20150112/psphot

  • branches/eam_branches/ipp-20150112/psphot/src

    • Property svn:ignore
      •  

        old new  
        2727psmakecff
        2828psphotFullForceSummary
         29psphotVersionDefinitions.h.tmp
  • branches/eam_branches/ipp-20150112/psphot/src/psphotLensing.c

    r36865 r38057  
    138138    psVector *psf_e1sh = psVectorAllocEmpty (300, PS_TYPE_F32);
    139139    psVector *psf_e2sh = psVectorAllocEmpty (300, PS_TYPE_F32);
     140    psVector *psf_e1   = psVectorAllocEmpty (300, PS_TYPE_F32);
     141    psVector *psf_e2   = psVectorAllocEmpty (300, PS_TYPE_F32);
    140142    psVector *xPos     = psVectorAllocEmpty (300, PS_TYPE_F32);
    141143    psVector *yPos     = psVectorAllocEmpty (300, PS_TYPE_F32);
     
    178180
    179181        pmModel *model = source->modelPSF;
     182
     183        float R  = source->moments->Mxx + source->moments->Myy;
     184        source->lensingOBJ->e1 = (source->moments->Mxx - source->moments->Myy) / R;
     185        source->lensingOBJ->e2 = 2*source->moments->Mxy / R;
    180186
    181187        psVectorAppend (xPos, model->params->data.F32[PM_PAR_XPOS]);
     
    191197        psVectorAppend (psf_e1sh, source->lensingOBJ->shear->e1);
    192198        psVectorAppend (psf_e2sh, source->lensingOBJ->shear->e2);
     199        psVectorAppend (psf_e1,   source->lensingOBJ->e1);
     200        psVectorAppend (psf_e2,   source->lensingOBJ->e2);
    193201        Npsf ++;
    194202    }
     
    247255    pmTrend2D *trend_e2sh = pmTrend2DAlloc (PM_TREND_MAP, readout->image, Nx, Ny, stats);
    248256
     257    pmTrend2D *trend_e1   = pmTrend2DAlloc (PM_TREND_MAP, readout->image, Nx, Ny, stats);
     258    pmTrend2D *trend_e2   = pmTrend2DAlloc (PM_TREND_MAP, readout->image, Nx, Ny, stats);
     259
    249260    bool goodFit = false;
    250261    if (!pmTrend2DFit (&goodFit, trendX11sm, NULL, 0xff, xPos, yPos, psfX11sm, NULL)) { psWarning ("failed to measure X11 smear trend"); }
     
    259270    if (!pmTrend2DFit (&goodFit, trend_e1sh, NULL, 0xff, xPos, yPos, psf_e1sh, NULL)) { psWarning ("failed to measure  e1 shear trend"); }
    260271    if (!pmTrend2DFit (&goodFit, trend_e2sh, NULL, 0xff, xPos, yPos, psf_e2sh, NULL)) { psWarning ("failed to measure  e2 shear trend"); }
     272
     273    if (!pmTrend2DFit (&goodFit, trend_e1,   NULL, 0xff, xPos, yPos, psf_e1,   NULL)) { psWarning ("failed to measure  e1 trend"); }
     274    if (!pmTrend2DFit (&goodFit, trend_e2,   NULL, 0xff, xPos, yPos, psf_e2,   NULL)) { psWarning ("failed to measure  e2 trend"); }
    261275
    262276    // evaluate the PSF trend maps at the location of all sources
     
    295309        smear->e1  = pmTrend2DEval (trend_e1sm, xPos, yPos);
    296310        smear->e2  = pmTrend2DEval (trend_e2sm, xPos, yPos);
     311
     312        lensing->e1  = pmTrend2DEval (trend_e1, xPos, yPos);
     313        lensing->e2  = pmTrend2DEval (trend_e2, xPos, yPos);
    297314    }
    298315
     
    309326    psFree (trend_e2sh);
    310327
     328    psFree (trend_e1);
     329    psFree (trend_e2);
     330
    311331    psFree (psfX11sm);
    312332    psFree (psfX12sm);
     
    314334    psFree (psf_e1sm);
    315335    psFree (psf_e2sm);
     336
    316337    psFree (psfX11sh);
    317338    psFree (psfX12sh);
     
    319340    psFree (psf_e1sh);
    320341    psFree (psf_e2sh);
     342
     343    psFree (psf_e1);
     344    psFree (psf_e2);
     345
    321346    psFree (xPos    );
    322347    psFree (yPos    );
Note: See TracChangeset for help on using the changeset viewer.