Last change
on this file since 3 was
3,
checked in by Matthew Whiting, 18 years ago
|
This is the first full import of all working code to
the Duchamp repository.
Made three directories at top level:
branches/ tags/ trunk/
and trunk/ has the full set of code:
ATrous/ Cubes/ Detection/ InputComplete? InputExample? README Utils/ docs/ mainDuchamp.cc param.cc param.hh
|
File size:
1.1 KB
|
Line | |
---|
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 | |
---|
Note: See
TracBrowser
for help on using the repository browser.