[301] | 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 | // ----------------------------------------------------------------------- |
---|
[3] | 28 | #include <iostream> |
---|
| 29 | #include <fstream> |
---|
| 30 | #include <iomanip> |
---|
| 31 | #include <sstream> |
---|
| 32 | #include <string> |
---|
| 33 | using std::stringstream; |
---|
| 34 | |
---|
[232] | 35 | // void menu(std::string &fname) |
---|
| 36 | std::string menu() |
---|
[3] | 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 | |
---|
[232] | 54 | std::string fname; |
---|
[3] | 55 | stringstream ss; |
---|
| 56 | int cube=0; |
---|
| 57 | switch(file){ |
---|
| 58 | case 1: |
---|
[258] | 59 | fname = "/DATA/SITAR_1/whi550/ObsData/cubes/precut_p26cube22_poly.fits"; |
---|
[3] | 60 | break; |
---|
| 61 | case 2: |
---|
[258] | 62 | fname = "/DATA/SITAR_1/whi550/ObsData/cubes/precut_p34cube19_poly.fits"; |
---|
[3] | 63 | break; |
---|
| 64 | case 3: |
---|
[258] | 65 | fname = "/DATA/SITAR_1/whi550/ObsData/cubes/precut_p34cube20_poly.fits"; |
---|
[3] | 66 | break; |
---|
| 67 | case 4: |
---|
[258] | 68 | fname = "/DATA/SITAR_1/whi550/ObsData/cubes/precut_p42cube17_poly.fits"; |
---|
[3] | 69 | break; |
---|
| 70 | case 5: |
---|
[258] | 71 | fname = "/DATA/SITAR_1/whi550/ObsData/cubes/precut_p58cube10_poly.fits"; |
---|
[3] | 72 | break; |
---|
| 73 | case 6: |
---|
[258] | 74 | fname = "/DATA/SITAR_1/whi550/ObsData/cubes/H201_abcde_luther_chop.fits"; |
---|
[3] | 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 | |
---|
[232] | 94 | // void specMenu(std::string fname) |
---|
| 95 | std::string specMenu() |
---|
[3] | 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"; |
---|
[233] | 104 | std::cout << "7: b1404p044 (SDSS)\n"; |
---|
[3] | 105 | |
---|
| 106 | int file=0; |
---|
[233] | 107 | while((file<1)||(file>7)){ |
---|
| 108 | std::cout<<"Enter choice (1-7): "; |
---|
[3] | 109 | std::cin >> file; |
---|
| 110 | } |
---|
| 111 | |
---|
[232] | 112 | std::string fname; |
---|
[3] | 113 | switch(file){ |
---|
| 114 | case 1: |
---|
[233] | 115 | fname = "/DATA/SITAR_1/whi550/ObsData/cubes/phfs_spectra/b1133m172"; |
---|
[3] | 116 | break; |
---|
| 117 | case 2: |
---|
[233] | 118 | fname = "/DATA/SITAR_1/whi550/ObsData/cubes/phfs_spectra/b1136m135"; |
---|
[3] | 119 | break; |
---|
| 120 | case 3: |
---|
[233] | 121 | fname = "/DATA/SITAR_1/whi550/ObsData/cubes/phfs_spectra/b1226p023"; |
---|
[3] | 122 | break; |
---|
| 123 | case 4: |
---|
[233] | 124 | fname = "/DATA/SITAR_1/whi550/ObsData/cubes/phfs_spectra/b2126m158"; |
---|
[3] | 125 | break; |
---|
| 126 | case 5: |
---|
[233] | 127 | fname = "/DATA/SITAR_1/whi550/ObsData/cubes/phfs_spectra/b2126_obj09"; |
---|
[3] | 128 | break; |
---|
[233] | 129 | case 6: |
---|
| 130 | fname = "/DATA/SITAR_1/whi550/ObsData/cubes/phfs_spectra/b0823p033"; |
---|
| 131 | break; |
---|
[3] | 132 | default: |
---|
[233] | 133 | fname = "/DATA/SITAR_1/whi550/ObsData/cubes/phfs_spectra/b1404_sdss.dat"; |
---|
[3] | 134 | break; |
---|
| 135 | } |
---|
| 136 | return fname; |
---|
| 137 | } |
---|
| 138 | |
---|
[232] | 139 | //void orionMenu(std::string fname) |
---|
| 140 | std::string orionMenu() |
---|
[3] | 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 | |
---|
[232] | 154 | std::string fname; |
---|
[3] | 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 | |
---|
[232] | 169 | //void imageMenu(std::string fname) |
---|
| 170 | std::string imageMenu() |
---|
[3] | 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 | |
---|
[232] | 186 | std::string fname; |
---|
[3] | 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: |
---|
[56] | 204 | // fname = menu(); |
---|
| 205 | fname = ""; |
---|
[3] | 206 | break; |
---|
| 207 | } |
---|
| 208 | return fname; |
---|
| 209 | } |
---|
| 210 | |
---|
[232] | 211 | std::string twoblMenu() |
---|
[3] | 212 | { |
---|
| 213 | std::cout << "2BL spectra to choose from: \n"; |
---|
| 214 | system("ls /u/whi550/RESEARCH/2BL/data"); |
---|
[232] | 215 | std::string fname; |
---|
[3] | 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 | |
---|