source: tags/release-1.1.2/src/Devel/menus.cc @ 1441

Last change on this file since 1441 was 348, checked in by MatthewWhiting, 17 years ago
  • Added a "scaleMax" parameter, so we can specify a range of scales to be used in the reconstruction. Changed the 1D reconstruction code as well.
  • Minor fixes to the merger code so 2D data doesn't do unnecessary checking.
  • Other minor fixes to work around bugs in outputs.
File size: 6.9 KB
Line 
1// -----------------------------------------------------------------------
2// menus.cc: Interactive text-based menus to access certain FITS images.
3// -----------------------------------------------------------------------
4// Copyright (C) 2006, Matthew Whiting, ATNF
5//
6// This program is free software; you can redistribute it and/or modify it
7// under the terms of the GNU General Public License as published by the
8// Free Software Foundation; either version 2 of the License, or (at your
9// option) any later version.
10//
11// Duchamp is distributed in the hope that it will be useful, but WITHOUT
12// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14// for more details.
15//
16// You should have received a copy of the GNU General Public License
17// along with Duchamp; if not, write to the Free Software Foundation,
18// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
19//
20// Correspondence concerning Duchamp may be directed to:
21//    Internet email: Matthew.Whiting [at] atnf.csiro.au
22//    Postal address: Dr. Matthew Whiting
23//                    Australia Telescope National Facility, CSIRO
24//                    PO Box 76
25//                    Epping NSW 1710
26//                    AUSTRALIA
27// -----------------------------------------------------------------------
28#include <iostream>
29#include <fstream>
30#include <iomanip>
31#include <sstream>
32#include <string>
33using std::stringstream;
34
35// void menu(std::string &fname)
36std::string menu()
37{
38  std::cout << "Files to choose from:\n";
39  std::cout << "1: precut_p26cube22_poly.fits\n";
40  std::cout << "2: precut_p34cube19_poly.fits\n";
41  std::cout << "3: precut_p34cube20_poly.fits\n";
42  std::cout << "4: precut_p42cube17_poly.fits\n";
43  std::cout << "5: precut_p58cube10_poly.fits\n";
44  std::cout << "6: H201_abcde_luther_chop.fits\n";
45  std::cout << "7: Another HIPASS cube\n";
46  std::cout << "8: Your own cube\n";
47
48  int file=0;
49  while((file<1)||(file>8)){
50    std::cout<<"Enter choice (1-8): ";
51    std::cin >> file;
52  }
53
54  std::string fname;
55  stringstream ss;
56  int cube=0;
57  switch(file){
58  case 1:
59    fname = "/DATA/SITAR_1/whi550/ObsData/cubes/precut_p26cube22_poly.fits";
60    break;
61  case 2:
62    fname = "/DATA/SITAR_1/whi550/ObsData/cubes/precut_p34cube19_poly.fits";
63    break;
64  case 3:
65    fname = "/DATA/SITAR_1/whi550/ObsData/cubes/precut_p34cube20_poly.fits";
66    break;
67  case 4:
68    fname = "/DATA/SITAR_1/whi550/ObsData/cubes/precut_p42cube17_poly.fits";
69    break;
70  case 5:
71    fname = "/DATA/SITAR_1/whi550/ObsData/cubes/precut_p58cube10_poly.fits";
72    break;
73  case 6:
74    fname = "/DATA/SITAR_1/whi550/ObsData/cubes/H201_abcde_luther_chop.fits";
75    break;
76  case 7:
77    while((cube<1)||(cube>538)){
78      std::cout<<"Enter cube number (1-538): ";
79      std::cin>>cube;
80    }
81    ss << "/DATA/MULTI_5/LUTHER/hipass_chop/H";
82    ss << std::setw(3) << std::setfill('0') << cube;
83    ss << "_abcde_luther_chop.fits";
84    fname = ss.str();
85    break;
86  default:
87    std::cout << "Enter filename (full path): ";
88    std::cin >> fname;
89    break;
90  }
91  return fname;
92}
93
94// void specMenu(std::string fname)
95std::string specMenu()
96{
97  std::cout << "Spectra to choose from:\n";
98  std::cout << "1: b1133m172\n";
99  std::cout << "2: b1136m135\n";
100  std::cout << "3: b1226p023\n";
101  std::cout << "4: b2126m158\n";
102  std::cout << "5: b2126m158-Galaxy#09\n";
103  std::cout << "6: b0823p033\n";
104  std::cout << "7: b1404p044 (SDSS)\n";
105
106  int file=0;
107  while((file<1)||(file>7)){
108    std::cout<<"Enter choice (1-7): ";
109    std::cin >> file;
110  }
111
112  std::string fname;
113  switch(file){
114  case 1:
115    fname = "/DATA/SITAR_1/whi550/ObsData/cubes/phfs_spectra/b1133m172";
116    break;
117  case 2:
118    fname = "/DATA/SITAR_1/whi550/ObsData/cubes/phfs_spectra/b1136m135";
119    break;
120  case 3:
121    fname = "/DATA/SITAR_1/whi550/ObsData/cubes/phfs_spectra/b1226p023";
122    break;
123  case 4:
124    fname = "/DATA/SITAR_1/whi550/ObsData/cubes/phfs_spectra/b2126m158";
125    break;
126  case 5:
127    fname = "/DATA/SITAR_1/whi550/ObsData/cubes/phfs_spectra/b2126_obj09";
128    break;
129  case 6:
130    fname = "/DATA/SITAR_1/whi550/ObsData/cubes/phfs_spectra/b0823p033";
131    break;
132  default:
133    fname = "/DATA/SITAR_1/whi550/ObsData/cubes/phfs_spectra/b1404_sdss.dat";
134    break;
135  }
136  return fname;
137}
138
139//void orionMenu(std::string fname)
140std::string orionMenu()
141{
142  std::cout << "Chandra time series to choose from:\n";
143  std::cout << "1: Flaring/Constant \n";
144  std::cout << "2: Faint/Flaring\n";
145  std::cout << "3: Bright/Flaring\n";
146
147
148  int file=0;
149  while((file<1)||(file>3)){
150    std::cout<<"Enter choice (1-3): ";
151    std::cin >> file;
152  }
153
154  std::string fname;
155  switch(file){
156  case 1:
157    fname = "/DATA/SITAR_1/whi550/Stats/summerschool/orion/COUP263.dat";
158    break;
159  case 2:
160    fname = "/DATA/SITAR_1/whi550/Stats/summerschool/orion/COUP551.dat";
161    break;
162  default:
163    fname = "/DATA/SITAR_1/whi550/Stats/summerschool/orion/COUP554.dat";
164    break;
165  }
166  return fname;
167}
168
169//void imageMenu(std::string fname)
170std::string imageMenu()
171{
172  std::cout << "2D optical/NIR images to choose from:\n";
173  std::cout << "1: 2126-158 Kband (IRIS)\n";
174  std::cout << "2: 1555-140 Rband (40\")\n";
175  std::cout << "3: 2126-158 i' band (GMOS)\n";
176  std::cout << "4: NGC4567 Bband (2.3m)\n";
177  std::cout << "5: NGC4567 Vband (2.3m)\n";
178  std::cout << "6: A single velocity plane of an HI cube\n";
179
180  int file=0;
181  while((file<1)||(file>6)){
182    std::cout<<"Enter choice (1-6): ";
183    std::cin >> file;
184  }
185
186  std::string fname;
187  switch(file){
188  case 1:
189    fname = "/DATA/SITAR_1/whi550/iraf/search_test/temp2.fits";
190    break;
191  case 2:
192    fname = "/DATA/SITAR_1/whi550/iraf/search_test/b1555m140r.fits";
193    break;
194  case 3:
195    fname = "/DATA/SITAR_1/whi550/iraf/search_test/b2126_cps_sml.fits";
196    break;
197  case 4:
198    fname = "/DATA/SITAR_1/whi550/iraf/search_test/N4567B_trim.fits";
199    break;
200  case 5:
201    fname = "/DATA/SITAR_1/whi550/iraf/search_test/N4567V_trim.fits[216:715,261:760]";
202    break;
203  default:
204    //    fname = menu();
205    fname = "";
206    break;
207  }
208  return fname;
209}
210
211std::string twoblMenu()
212{
213  std::cout << "2BL spectra to choose from: \n";
214  system("ls /u/whi550/RESEARCH/2BL/data");
215  std::string fname;
216  std::ifstream fin;
217  do{
218    std::cout << "Select a file: ";
219    std::cin >> fname;
220    fname = "/u/whi550/RESEARCH/2BL/data/" + fname;
221    fin.open(fname.c_str(),std::ifstream::in);
222    if(!fin.good()) std::cout << "Bad file -- try again!";
223  }while(!fin.good());
224
225  return fname;
226}
227
228
229std::string b1555Menu()
230{
231  std::cout << "B1555-140 spectra to choose from: \n";
232  system("set DIR=`pwd`;cd /u/whi550/RESEARCH/Papers/1555-140/b1555_redshifts/data/;ls *.txt;cd $DIR;unset $DIR");
233  std::string fname;
234  std::ifstream fin;
235  do{
236    std::cout << "Select a file: ";
237    std::cin >> fname;
238    fname = "/u/whi550/RESEARCH/Papers/1555-140/b1555_redshifts/data/" + fname;
239    fin.open(fname.c_str(),std::ifstream::in);
240    if(!fin.good()) std::cout << "Bad file -- try again!";
241  }while(!fin.good());
242
243  return fname;
244}
245
Note: See TracBrowser for help on using the repository browser.