source: trunk/src/Detection/columns.hh @ 136

Last change on this file since 136 was 136, checked in by Matthew Whiting, 18 years ago

Range of alterations... :
Cubes/cubes.cc -- added new front-end to the getopt function, that reads the

command-line options. Makes calling it easier from other
programs.
Slight alteration to Image::removeMW()
Moved Cube::setupColumns() to here, with different flow.

Cubes/cubes.hh -- Prototypes for above.
mainDuchamp.cc -- Removed call to getopt -- now a Cube:: function
Detection/spectrumDetect.cc -- Trying a new way of doing it -- just Detection,

rather than a vector.

Detection/columns.cc -- Changed this around a bit. Made two new functions that

return a ColSet? for either the full case or the logging
case. Cube::setupColumns() now calls these

Detection/mergeIntoList.cc -- minor edit
Detection/columns.hh -- change declaration orders and new prototypes.

File size: 1.7 KB
Line 
1#ifndef COLUMNS_H
2#define COLUMNS_H
3
4#include <iostream>
5#include <iomanip>
6#include <string>
7#include <vector>
8
9#include <param.hh>
10
11using std::string;
12using std::vector;
13
14class Detection;
15namespace Column
16{
17
18  const int fluxPrec=3, velPrec=3, xyzPrec=1, posPrec=6, wposPrec=2;
19
20  class Col{
21  public:
22    Col(){width=0;name="";unit="";};
23    Col(int w, string n, string u){width=w; name=n; unit=u;};
24    ~Col(){};
25    int widen(){width++;};
26    int getWidth(){return width;};
27    void setWidth(int i){width=i;};
28    string getName(){return name;};
29    void setName(string s){name=s;};
30    string getUnit(){return unit;};
31    void setUnit(string s){unit=s;};
32    void title(std::ostream &stream){
33      stream << std::setw(this->width) << this->name;};
34    void units(std::ostream &stream){
35      stream << std::setw(this->width) << this->unit;};
36    void dash (std::ostream &stream){
37      stream << std::setfill('-') << std::setw(this->width)
38             << ""<< std::setfill(' ');};
39    void blank(std::ostream &stream){
40      stream << std::setfill(' ') << std::setw(this->width) << "";};
41   
42    template <class type> void entry(std::ostream &stream, type e){
43      stream << std::setw(this->width) << e;};
44
45    int width;
46    string name;
47    string unit;
48  };
49
50  class ColSet{
51  public:
52    ColSet(){defined=false; inserted=false;}
53    ~ColSet(){};
54    vector<Col> vec;
55    bool defined;
56    bool inserted;
57    void addFluxCol(Col fluxCol){
58      if(!this->inserted) this->vec.insert(this->vec.begin()+11, fluxCol);
59      this->inserted = true;
60    }
61
62  };
63
64  ColSet getLogColSet(vector<Detection> &objectList);
65  ColSet getFullColSet(vector<Detection> &objectList, FitsHeader &head);
66
67}
68
69
70#endif
71
Note: See TracBrowser for help on using the repository browser.