#324 closed defect (fixed)
pmSourceMoments()
| Reported by: | Owned by: | eugene | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | IPP SDRS | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: |
Description (last modified by )
Do you have a formula for the various members of the psMoments data structure?
The standard definitions of the first and second moments, mean and variance,
don't seem to apply here.
Also, the psImage argument seems redundant, since the image data is presumably
avaliable in the psSource->pixels argument. In calculating the moments, should
I be using the data in the psSource->pixels argument, or the psImage argument?
Change History (5)
comment:1 by , 21 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:2 by , 21 years ago
Thanks. I'm assuming the first and second moments for y are calculated the same
way.
I'm also assuming that all calculation are done in the x/y coordinates of the
image, not of the subImage psSource->pixels.
For the peak pixel, is that the absolute peak, or should I subtract the sky?
For the second moment, I think the "- X12" should be outside the summation
"SUM (x - xc)2 * (z - sky)", however I'd like you to verify that for me.
Also, there's no division by the "Sum". That doesn't seem right to me.
What is formula the xy cross moment? Is it sqrt(XY/Sum)?
comment:3 by , 21 years ago
let me try again:
Sum = SUM (z - sky)
X1 = SUM (x - xc)*(z - sky)
X2 = SUM (x - xc)2 * (z - sky)
XY = SUM (x - xc)*(y - yc)*(z - sky)
first moment X = X1/Sum + xc
second moment X = sqrt (X2/Sum - (X1/Sum)2)
Sxy = XY / Sum
(note: no sqrt on Sxy since XY may be negative)
first and second y moments: substitute y for x
peak: use the absolute peak value, not the sky subtracted value
comment:4 by , 21 years ago
Fixed the SDRS to remove the psImage parameter:
bool pmSourceMoments(pmSource *source, float radius);
comment:5 by , 16 years ago
| Component: | Modules SDRS → IPP SDRS |
|---|---|
| Description: | modified (diff) |

sky: select the pixels in the defined square annulus centered on the source,
determine the statistic specified by statsOptions
let x,y be the pixel coordinates with counts z.
xc, yc is the initial center:
Sum = SUM (z - sky)
X1 = SUM (x - xc)*(z - sky) / Sum
X2 = SUM (x - xc)2 * (z - sky) - X12
XY = SUM (x - xc)*(y - yc)*(z - sky)
first moment X = X1 + xc
second moment X = sqrt (X2)
peak is value of pixel with max counts
On the psImage argument: I agree - this is redundant. Drop it from the arg
list, and I'll fix the SDRS to reflect that.