source: tags/release-1.0.5/src/Utils/menus.cc @ 1455

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

Changes mostly motivated by additional plotting routines (not really used for
Duchamp, but for analysis programs):
Utils/cpgcumul.c -- A pgplot program to plot the cumulative distribution.
Utils/plottingUtilities.cc -- Various functions to draw lines and contour plots.
Utils/utils.hh -- Prototypes for the above, plus the removal of the isDetection function.
Detection/thresholding_functions.cc -- Removal of the #include call for utils.hh
Detection/detection.hh -- Added the prototype for isDetection
Utils/menus.cc -- Changed the menu() function to return "" instead of calling

the cubeMenu when a cube is requested. This enables the
calling program to use the Duchamp input file instead.

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