Changeset 35967
- Timestamp:
- Aug 19, 2013, 6:40:44 AM (13 years ago)
- Location:
- branches/eam_branches/ipp-20130711/psModules/src/objects
- Files:
-
- 2 edited
-
pmModel_CentralPixel.c (modified) (1 diff)
-
pmModel_CentralPixel.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130711/psModules/src/objects/pmModel_CentralPixel.c
r35961 r35967 687 687 } 688 688 689 // this is a test function which generates a full sersic model evaluation with sub-pixel sampling 690 // Nsub is the number of sub-pixel samplings and must be odd 691 // dx,dy are the centroid offset 692 float pmModelCP_SersicSubpix (float dx, float dy, float Rxx, float Rxy, float Ryy, float Sindex, int Nsub) { 693 694 float flux = 0.0; 695 int npix = 0; 696 697 float kappa = -0.275552 + 1.972625*Sindex + 0.003487 * PS_SQR(Sindex); 698 float rindex = 0.5 / Sindex; 699 700 // have the resolution be a user-parameter? 701 psAssert (Nsub % 2 == 1, "Nsub is not odd"); 702 int Nsub2 = (Nsub - 1) / 2; 703 704 float delta = 1.0 / (float) Nsub; 705 float off = -Nsub2 * delta; 706 for (float ix = off; ix < 0.5; ix += delta) { 707 for (float iy = off; iy < 0.5; iy += delta) { 708 709 float dX = dx + ix; 710 float dY = dy + iy; 711 float z = PS_SQR(dX / Rxx) + PS_SQR(dY / Ryy) + dX * dY * Rxy; 712 713 float q = pow (z, rindex); 714 float f = exp(-kappa*q); 715 716 flux += f; 717 npix ++; 718 } 719 } 720 float normFlux = flux / npix; 721 // fprintf (stderr, "full : %f %f %f\n", flux, (float) npix, normFlux); 722 return normFlux; 723 } 724 689 725 # if (0) 690 726 // create a vector containing only the unique entries in the input vector -
branches/eam_branches/ipp-20130711/psModules/src/objects/pmModel_CentralPixel.h
r35947 r35967 62 62 float pmModelCP_GetFlux_Old (pmModelCP *cp, float dx, float dy, float theta); 63 63 64 float pmModelCP_SersicSubpix (float dx, float dy, float Rxx, float Rxy, float Ryy, float Sindex, int Nsub); 65 64 66 # endif
Note:
See TracChangeset
for help on using the changeset viewer.
