IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 19, 2013, 6:40:03 AM (13 years ago)
Author:
eugene
Message:

replace ad-hoc code for central pixel with pmModelCP call

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130711/psModules/src/objects/models/pmModel_EXP.c

    r35961 r35966  
    4545#include "pmPSFtry.h"
    4646#include "pmDetections.h"
     47#include "pmModel_CentralPixel.h"
    4748
    4849#include "pmModel_EXP.h"
     
    124125    // only worry about the central 4 pixels at most
    125126    psF32 radius = hypot(X, Y);
    126     if (radius < 1.0) {
    127       // subdivide the central 2,3,4 pixels by Nx,Ny
    128       float Npix = 0.0;
    129       float Fpix = 0.0;
    130       float Xpix = floor(pixcoord->data.F32[0]) - PAR[PM_PAR_XPOS];
    131       float Ypix = floor(pixcoord->data.F32[1]) - PAR[PM_PAR_YPOS];
    132       for (float ix = 0.1; ix < 1.0; ix += 0.2) {
    133         for (float iy = 0.1; iy < 1.0; iy += 0.2) {
    134           psF32 X  = Xpix + ix;
    135           psF32 Y  = Ypix + iy;
    136           psF32 px = X / PAR[PM_PAR_SXX];
    137           psF32 py = Y / PAR[PM_PAR_SYY];
    138           psF32 z  = PS_SQR(px) + PS_SQR(py) + PAR[PM_PAR_SXY]*X*Y;
    139          
    140           // sqrt(z) is r
    141           float q = kappa*sqrt(z);
    142           psF32 f0 = exp(-q);
    143          
    144           psF32 f1 = PAR[PM_PAR_I0]*f0;
    145           psF32 fx = PAR[PM_PAR_SKY] + f1;
    146           Fpix += fx;
    147           Npix += 1.0;
    148         }
    149       }
    150       f = Fpix / Npix;
     127    if (radius <= 1.5) {
     128        f0 = pmModelCP_SersicSubpix (X, Y, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], 1.0, 51);
     129        f1 = PAR[PM_PAR_I0]*f0;
     130        f = PAR[PM_PAR_SKY] + f1;
    151131    }
    152132
Note: See TracChangeset for help on using the changeset viewer.