Last change
on this file since 192 was
192,
checked in by Matthew Whiting, 18 years ago
|
A large commit based around a few changes:
- Implemented the new SNRpeak column, defining it in columns.cc and printing it out in outputDetection.cc.
- Corrected a bug in the subsection parsing that miscalculated the pixel offset when "*" was given as an axis range.
- setupFDR now calculates the flux threshold so this can be reported.
- The object flags now distinguish between spatial edge and spectral edge locations.
- Other minor changes for clarity's sake.
|
File size:
1.2 KB
|
Rev | Line | |
---|
[50] | 1 | /** |
---|
| 2 | * spectrumDetect.cc |
---|
| 3 | * |
---|
| 4 | * A detection algorithm that searches in a single 1-D spectrum. |
---|
| 5 | * |
---|
| 6 | * INPUTS: |
---|
[192] | 7 | * image -- an Image object, containing a 1-D image that has had |
---|
| 8 | * its StatsContainer object defined. |
---|
[190] | 9 | * The detection array in image will be filled, according to |
---|
[50] | 10 | * the location of the objects in the image. |
---|
| 11 | * |
---|
| 12 | */ |
---|
| 13 | |
---|
| 14 | #include <Cubes/cubes.hh> |
---|
[177] | 15 | #include <Detection/detection.hh> |
---|
[50] | 16 | |
---|
| 17 | enum STATUS { NONOBJECT, OBJECT }; |
---|
| 18 | |
---|
| 19 | void Image::spectrumDetect() |
---|
| 20 | { |
---|
| 21 | STATUS status; |
---|
[136] | 22 | Detection *obj = new Detection; |
---|
[137] | 23 | Pixel *pix = new Pixel; |
---|
[50] | 24 | bool isObject; |
---|
| 25 | |
---|
| 26 | status = NONOBJECT; |
---|
| 27 | for(int pos=0;pos<(this->axisDim[0]+1);pos++){ |
---|
| 28 | |
---|
| 29 | isObject=false; |
---|
| 30 | if(pos<this->axisDim[0]){ |
---|
[137] | 31 | pix->setXYF(pos, 0, this->array[pos] ); |
---|
[50] | 32 | isObject = this->isDetection(pos,0); |
---|
| 33 | } |
---|
| 34 | |
---|
| 35 | if(isObject){ |
---|
[177] | 36 | if(status != OBJECT) status = OBJECT; |
---|
[137] | 37 | obj->addPixel(*pix); |
---|
[50] | 38 | } |
---|
[136] | 39 | else{ |
---|
| 40 | if(status == OBJECT){ // if we were on an object and have left |
---|
| 41 | if(obj->getSize() >= this->minSize){ // if it's big enough |
---|
| 42 | obj->calcParams(); // work out midpoints, fluxes etc |
---|
| 43 | this->addObject(*obj); // add to list. |
---|
| 44 | } |
---|
| 45 | obj->clearDetection(); |
---|
[50] | 46 | } |
---|
| 47 | status = NONOBJECT; |
---|
| 48 | } |
---|
| 49 | |
---|
| 50 | } |
---|
| 51 | |
---|
[177] | 52 | // clean up and remove declared memory |
---|
[137] | 53 | delete obj,pix; |
---|
[50] | 54 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.