source: branches/pixel-map-branch/src/Cubes/invertCube.cc @ 1441

Last change on this file since 1441 was 243, checked in by Matthew Whiting, 17 years ago

Large commit with the new version using Scans & Object just about working.

The major problem at the moment is that there seems to be something not quite working with the merger part of the code, and some dud scans are being introduced (where X & Y are very large numbers -- apparently unallocated...)

File size: 1.0 KB
Line 
1#include <Cubes/cubes.hh>
2#include <Detection/detection.hh>
3
4void Cube::invert()
5{
6  /**
7   *  A function that multiplies all non-Blank pixels by -1.
8   *  This is used when searching for negative features.
9   */
10  for(int i=0; i<this->numPixels; i++)
11    if(!this->isBlank(i)){
12      this->array[i] *= -1.;
13      if(this->reconExists) this->recon[i] *= -1.;
14    }
15}
16
17void Cube::reInvert()
18{
19  /**
20   *  A function that switches the array back to the original sign.
21   *  This is used when searching for negative features.
22   */
23  for(int i=0; i<this->numPixels; i++){
24    if(!this->isBlank(i)){
25      this->array[i] *= -1.;
26      if(this->reconExists) this->recon[i] *= -1.;
27    }
28  }
29
30  for(int i=0; i<this->objectList.size(); i++){
31    this->objectList[i].setNegative(true);
32    this->objectList[i].setTotalFlux(-1. * this->objectList[i].getTotalFlux() );
33    this->objectList[i].setIntegFlux(-1. * this->objectList[i].getIntegFlux() );
34    this->objectList[i].setPeakFlux(-1. * this->objectList[i].getPeakFlux() );
35  }
36
37}
Note: See TracBrowser for help on using the repository browser.