1 | #include <iostream> |
---|
2 | #include <param.hh> |
---|
3 | #include <Cubes/cubes.hh> |
---|
4 | #include <Utils/utils.hh> |
---|
5 | |
---|
6 | void findSources(Image &image) |
---|
7 | { |
---|
8 | int size = image.getSize(); |
---|
9 | float blankPixValue = image.pars().getBlankPixVal(); |
---|
10 | bool flagFDR = image.pars().getFlagFDR(); |
---|
11 | |
---|
12 | float *arr = new float[size]; |
---|
13 | int goodSize=0; |
---|
14 | for(int i=0;i<size;i++){ |
---|
15 | float val = image.getPixValue(i); |
---|
16 | // if((!image.pars().getFlagBlankPix())||(image.getPixValue(i)!=blankPixValue)) |
---|
17 | if(!image.pars().isBlank(val)) |
---|
18 | arr[goodSize++] = val; |
---|
19 | } |
---|
20 | if(goodSize>0){ |
---|
21 | float mean,sigma; |
---|
22 | findMedianStats(arr,goodSize,mean,sigma); |
---|
23 | image.setStats(mean,sigma,image.pars().getCut()); |
---|
24 | if(flagFDR) image.setupFDR(); |
---|
25 | image.lutz_detect(); |
---|
26 | } |
---|
27 | delete [] arr; |
---|
28 | } |
---|
29 | |
---|
30 | void findSources(Image &image, float mean, float sigma) |
---|
31 | { |
---|
32 | bool flagFDR = image.pars().getFlagFDR(); |
---|
33 | int size = image.getSize(); |
---|
34 | float *arr = new float[size]; |
---|
35 | for(int i=0;i<size;i++) arr[i] = image.getPixValue(i); |
---|
36 | findMedianStats(arr,size,mean,sigma); |
---|
37 | image.setStats(mean,sigma,image.pars().getCut()); |
---|
38 | if(flagFDR) image.setupFDR(); |
---|
39 | image.lutz_detect(); |
---|
40 | delete [] arr; |
---|
41 | } |
---|
42 | |
---|