source: branches/pixel-map-branch/src/Utils/menus.cc @ 1441

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

Summary of changes:

  • Rather than storing centres, the Objects now keep the xSum, ySum etc and return xSum/float(numPix) as the result for xCentre.
  • To do this, we also keep track of the number of pixels in each object. Each time a pixel, scan or object is added, we increment the number by the correct amount.
  • These parameters are also calculated as we go, rather than all at once.
  • Detection::calcParams() changed to Detection::calcFluxes(), so that it just works out the flux-related parameters. Things like xCentre etc are done in the Objects.
  • areClose() improved to work at the Scan level, rather than looking at each pixel. It only compares Scans within the appropriate y-range.
  • Other functions simplified include logDetectionList() and trimImage().
  • Scan::join() and Scan::isCommon() changed to Scan::unite() and Scan::intersect().
File size: 5.1 KB
Line 
1#include <iostream>
2#include <fstream>
3#include <iomanip>
4#include <sstream>
5#include <string>
6using std::stringstream;
7
8// void menu(std::string &fname)
9std::string menu()
10{
11  std::cout << "Files to choose from:\n";
12  std::cout << "1: precut_p26cube22_poly.fits\n";
13  std::cout << "2: precut_p34cube19_poly.fits\n";
14  std::cout << "3: precut_p34cube20_poly.fits\n";
15  std::cout << "4: precut_p42cube17_poly.fits\n";
16  std::cout << "5: precut_p58cube10_poly.fits\n";
17  std::cout << "6: H201_abcde_luther_chop.fits\n";
18  std::cout << "7: Another HIPASS cube\n";
19  std::cout << "8: Your own cube\n";
20
21  int file=0;
22  while((file<1)||(file>8)){
23    std::cout<<"Enter choice (1-8): ";
24    std::cin >> file;
25  }
26
27  std::string fname;
28  stringstream ss;
29  int cube=0;
30  switch(file){
31  case 1:
32    fname = "/DATA/SITAR_1/whi550/ObsData/cubes/precut_p26cube22_poly.fits";
33    break;
34  case 2:
35    fname = "/DATA/SITAR_1/whi550/ObsData/cubes/precut_p34cube19_poly.fits";
36    break;
37  case 3:
38    fname = "/DATA/SITAR_1/whi550/ObsData/cubes/precut_p34cube20_poly.fits";
39    break;
40  case 4:
41    fname = "/DATA/SITAR_1/whi550/ObsData/cubes/precut_p42cube17_poly.fits";
42    break;
43  case 5:
44    fname = "/DATA/SITAR_1/whi550/ObsData/cubes/precut_p58cube10_poly.fits";
45    break;
46  case 6:
47    fname = "/DATA/SITAR_1/whi550/ObsData/cubes/H201_abcde_luther_chop.fits";
48    break;
49  case 7:
50    while((cube<1)||(cube>538)){
51      std::cout<<"Enter cube number (1-538): ";
52      std::cin>>cube;
53    }
54    ss << "/DATA/MULTI_5/LUTHER/hipass_chop/H";
55    ss << std::setw(3) << std::setfill('0') << cube;
56    ss << "_abcde_luther_chop.fits";
57    fname = ss.str();
58    break;
59  default:
60    std::cout << "Enter filename (full path): ";
61    std::cin >> fname;
62    break;
63  }
64  return fname;
65}
66
67// void specMenu(std::string fname)
68std::string specMenu()
69{
70  std::cout << "Spectra to choose from:\n";
71  std::cout << "1: b1133m172\n";
72  std::cout << "2: b1136m135\n";
73  std::cout << "3: b1226p023\n";
74  std::cout << "4: b2126m158\n";
75  std::cout << "5: b2126m158-Galaxy#09\n";
76  std::cout << "6: b0823p033\n";
77  std::cout << "7: b1404p044 (SDSS)\n";
78
79  int file=0;
80  while((file<1)||(file>7)){
81    std::cout<<"Enter choice (1-7): ";
82    std::cin >> file;
83  }
84
85  std::string fname;
86  switch(file){
87  case 1:
88    fname = "/DATA/SITAR_1/whi550/ObsData/cubes/phfs_spectra/b1133m172";
89    break;
90  case 2:
91    fname = "/DATA/SITAR_1/whi550/ObsData/cubes/phfs_spectra/b1136m135";
92    break;
93  case 3:
94    fname = "/DATA/SITAR_1/whi550/ObsData/cubes/phfs_spectra/b1226p023";
95    break;
96  case 4:
97    fname = "/DATA/SITAR_1/whi550/ObsData/cubes/phfs_spectra/b2126m158";
98    break;
99  case 5:
100    fname = "/DATA/SITAR_1/whi550/ObsData/cubes/phfs_spectra/b2126_obj09";
101    break;
102  case 6:
103    fname = "/DATA/SITAR_1/whi550/ObsData/cubes/phfs_spectra/b0823p033";
104    break;
105  default:
106    fname = "/DATA/SITAR_1/whi550/ObsData/cubes/phfs_spectra/b1404_sdss.dat";
107    break;
108  }
109  return fname;
110}
111
112//void orionMenu(std::string fname)
113std::string orionMenu()
114{
115  std::cout << "Chandra time series to choose from:\n";
116  std::cout << "1: Flaring/Constant \n";
117  std::cout << "2: Faint/Flaring\n";
118  std::cout << "3: Bright/Flaring\n";
119
120
121  int file=0;
122  while((file<1)||(file>3)){
123    std::cout<<"Enter choice (1-3): ";
124    std::cin >> file;
125  }
126
127  std::string fname;
128  switch(file){
129  case 1:
130    fname = "/DATA/SITAR_1/whi550/Stats/summerschool/orion/COUP263.dat";
131    break;
132  case 2:
133    fname = "/DATA/SITAR_1/whi550/Stats/summerschool/orion/COUP551.dat";
134    break;
135  default:
136    fname = "/DATA/SITAR_1/whi550/Stats/summerschool/orion/COUP554.dat";
137    break;
138  }
139  return fname;
140}
141
142//void imageMenu(std::string fname)
143std::string imageMenu()
144{
145  std::cout << "2D optical/NIR images to choose from:\n";
146  std::cout << "1: 2126-158 Kband (IRIS)\n";
147  std::cout << "2: 1555-140 Rband (40\")\n";
148  std::cout << "3: 2126-158 i' band (GMOS)\n";
149  std::cout << "4: NGC4567 Bband (2.3m)\n";
150  std::cout << "5: NGC4567 Vband (2.3m)\n";
151  std::cout << "6: A single velocity plane of an HI cube\n";
152
153  int file=0;
154  while((file<1)||(file>6)){
155    std::cout<<"Enter choice (1-6): ";
156    std::cin >> file;
157  }
158
159  std::string fname;
160  switch(file){
161  case 1:
162    fname = "/DATA/SITAR_1/whi550/iraf/search_test/temp2.fits";
163    break;
164  case 2:
165    fname = "/DATA/SITAR_1/whi550/iraf/search_test/b1555m140r.fits";
166    break;
167  case 3:
168    fname = "/DATA/SITAR_1/whi550/iraf/search_test/b2126_cps_sml.fits";
169    break;
170  case 4:
171    fname = "/DATA/SITAR_1/whi550/iraf/search_test/N4567B_trim.fits";
172    break;
173  case 5:
174    fname = "/DATA/SITAR_1/whi550/iraf/search_test/N4567V_trim.fits[216:715,261:760]";
175    break;
176  default:
177    //    fname = menu();
178    fname = "";
179    break;
180  }
181  return fname;
182}
183
184std::string twoblMenu()
185{
186  std::cout << "2BL spectra to choose from: \n";
187  system("ls /u/whi550/RESEARCH/2BL/data");
188  std::string fname;
189  std::ifstream fin;
190  do{
191    std::cout << "Select a file: ";
192    std::cin >> fname;
193    fname = "/u/whi550/RESEARCH/2BL/data/" + fname;
194    fin.open(fname.c_str(),std::ifstream::in);
195    if(!fin.good()) std::cout << "Bad file -- try again!";
196  }while(!fin.good());
197
198  return fname;
199}
200
Note: See TracBrowser for help on using the repository browser.