|
64 | 64 | "\n", |
65 | 65 | "from specutils import Spectrum1D\n", |
66 | 66 | "\n", |
67 | | - "%matplotlib inline" |
| 67 | + "%matplotlib inline\n", |
| 68 | + "\n", |
| 69 | + "# Set tutorial path for data files\n", |
| 70 | + "tutorial_path = ''" |
68 | 71 | ] |
69 | 72 | }, |
70 | 73 | { |
|
83 | 86 | { |
84 | 87 | "cell_type": "code", |
85 | 88 | "execution_count": null, |
86 | | - "metadata": {}, |
| 89 | + "metadata": { |
| 90 | + "collapsed": true |
| 91 | + }, |
87 | 92 | "outputs": [], |
88 | 93 | "source": [ |
89 | 94 | "catalog_name = 'J/ApJS/212/1/wisecat'\n", |
|
104 | 109 | { |
105 | 110 | "cell_type": "code", |
106 | 111 | "execution_count": null, |
107 | | - "metadata": {}, |
| 112 | + "metadata": { |
| 113 | + "collapsed": true |
| 114 | + }, |
108 | 115 | "outputs": [], |
109 | 116 | "source": [ |
110 | 117 | "catalog_sample = catalog_sample_list[0]\n", |
|
136 | 143 | { |
137 | 144 | "cell_type": "code", |
138 | 145 | "execution_count": null, |
139 | | - "metadata": {}, |
| 146 | + "metadata": { |
| 147 | + "collapsed": true |
| 148 | + }, |
140 | 149 | "outputs": [], |
141 | 150 | "source": [ |
142 | 151 | "#Lift the row limit for the astroquery Vizier class\n", |
|
160 | 169 | { |
161 | 170 | "cell_type": "code", |
162 | 171 | "execution_count": null, |
163 | | - "metadata": {}, |
| 172 | + "metadata": { |
| 173 | + "collapsed": true |
| 174 | + }, |
164 | 175 | "outputs": [], |
165 | 176 | "source": [ |
166 | 177 | "#Delete extra columns of information we don't need\n", |
|
182 | 193 | { |
183 | 194 | "cell_type": "code", |
184 | 195 | "execution_count": null, |
185 | | - "metadata": {}, |
| 196 | + "metadata": { |
| 197 | + "collapsed": true |
| 198 | + }, |
186 | 199 | "outputs": [], |
187 | 200 | "source": [ |
188 | 201 | "#Create SkyCoord objects of the coordinates\n", |
|
215 | 228 | "## Download and visualize the WHAM all-sky map\n", |
216 | 229 | "\n", |
217 | 230 | "An integrate FITS image of this survey is available online at [http://www.astro.wisc.edu/wham/ss/wham-ss-DR1-v161116-170912-int-grid.fits](http://www.astro.wisc.edu/wham/ss/wham-ss-DR1-v161116-170912-int-grid.fits). We can download this file directly and plot it, overlaying our identified HII region positions. \n", |
218 | | - "\n" |
| 231 | + "\n", |
| 232 | + "For ease of use - this file is also available through this tutorial directly, so we can download the file from there.\n" |
219 | 233 | ] |
220 | 234 | }, |
221 | 235 | { |
222 | 236 | "cell_type": "code", |
223 | 237 | "execution_count": null, |
224 | | - "metadata": {}, |
| 238 | + "metadata": { |
| 239 | + "collapsed": true |
| 240 | + }, |
225 | 241 | "outputs": [], |
226 | 242 | "source": [ |
227 | | - "#Download the wham integrate FITS image\n", |
| 243 | + "'''\n", |
| 244 | + "# Download the wham integrated FITS image from the UW-Madison host\n", |
| 245 | + "\n", |
228 | 246 | "wham_image_file = download_file(\n", |
229 | 247 | " 'http://www.astro.wisc.edu/wham/ss/wham-ss-DR1-v161116-170912-int-grid.fits',\n", |
230 | | - " cache=True, show_progress = True)" |
| 248 | + " cache=True, show_progress = True)\n", |
| 249 | + "'''\n", |
| 250 | + "\n", |
| 251 | + "#Download the wham integrated FITS image\n", |
| 252 | + "wham_image_file = download_file(tutorialpath + \n", |
| 253 | + " 'wham-ss-DR1-v161116-170912-int-grid.fits',\n", |
| 254 | + " cache=True, show_progress = True)" |
231 | 255 | ] |
232 | 256 | }, |
233 | 257 | { |
234 | 258 | "cell_type": "code", |
235 | 259 | "execution_count": null, |
236 | | - "metadata": {}, |
| 260 | + "metadata": { |
| 261 | + "collapsed": true |
| 262 | + }, |
237 | 263 | "outputs": [], |
238 | 264 | "source": [ |
239 | 265 | "# Open the FITS file for reading\n", |
|
253 | 279 | { |
254 | 280 | "cell_type": "code", |
255 | 281 | "execution_count": null, |
256 | | - "metadata": {}, |
| 282 | + "metadata": { |
| 283 | + "collapsed": true |
| 284 | + }, |
257 | 285 | "outputs": [], |
258 | 286 | "source": [ |
259 | 287 | "# Access and store the data and header\n", |
|
284 | 312 | { |
285 | 313 | "cell_type": "code", |
286 | 314 | "execution_count": null, |
287 | | - "metadata": {}, |
| 315 | + "metadata": { |
| 316 | + "collapsed": true |
| 317 | + }, |
288 | 318 | "outputs": [], |
289 | 319 | "source": [ |
290 | 320 | "# Initiate a matplotlib figure object\n", |
|
328 | 358 | { |
329 | 359 | "cell_type": "code", |
330 | 360 | "execution_count": null, |
331 | | - "metadata": {}, |
| 361 | + "metadata": { |
| 362 | + "collapsed": true |
| 363 | + }, |
332 | 364 | "outputs": [], |
333 | 365 | "source": [ |
334 | 366 | "'''\n", |
|
374 | 406 | "## Examine the WHAM Kinematic Data\n", |
375 | 407 | "\n", |
376 | 408 | "The data is available as a FITS Table and can be downloaded directly from [http://www.astro.wisc.edu/wham/ss/wham-ss-DR1-v161116-170912.fits](http://www.astro.wisc.edu/wham/ss/wham-ss-DR1-v161116-170912.fits) and read in as an astropy Table. \n", |
| 409 | + "\n", |
| 410 | + "Once again for ease of use, this file is also available through this tutorial so we can download by just referring to the filename `wham-ss-DR1-v161116-170912.fits` with `tutorial_path + 'wham-ss-DR1-v161116-170912.fits'\n", |
| 411 | + "\n", |
377 | 412 | "<a id='ex2'></a>\n", |
378 | 413 | "### Exercise 2: Download the survey file to cache open it to display some info\n", |
379 | 414 | "\n", |
|
387 | 422 | { |
388 | 423 | "cell_type": "code", |
389 | 424 | "execution_count": null, |
390 | | - "metadata": {}, |
| 425 | + "metadata": { |
| 426 | + "collapsed": true |
| 427 | + }, |
391 | 428 | "outputs": [], |
392 | 429 | "source": [ |
393 | 430 | "'''\n", |
394 | 431 | "Temporarily have solution here for notebook testing\n", |
395 | 432 | "'''\n", |
396 | 433 | "\n", |
397 | 434 | "# Download the Kinematic Data Table\n", |
398 | | - "wham_data_file = download_file('http://www.astro.wisc.edu/wham/ss/wham-ss-DR1-v161116-170912.fits',\n", |
399 | | - " cache=True, show_progress = True)\n", |
400 | | - " \n", |
401 | | - "'''\n", |
402 | | - "Using a local file for now to make my life easy as I write this without an internet connection...\n", |
403 | | - "\n", |
404 | | - "wham_data_file = '/Volumes/DK_Storage/Data/wham/wham-ss-DR1-v161116-170912.fits'\n", |
405 | | - "'''\n", |
| 435 | + "wham_data_file = download_file(tutorial_path + \n", |
| 436 | + " 'wham-ss-DR1-v161116-170912.fits',\n", |
| 437 | + " cache=True, show_progress = True)\n", |
406 | 438 | "\n", |
407 | 439 | "# Open the FITS file for reading\n", |
408 | 440 | "wham_data_hdu = fits.open(wham_data_file)" |
|
411 | 443 | { |
412 | 444 | "cell_type": "code", |
413 | 445 | "execution_count": null, |
414 | | - "metadata": {}, |
| 446 | + "metadata": { |
| 447 | + "collapsed": true |
| 448 | + }, |
415 | 449 | "outputs": [], |
416 | 450 | "source": [ |
417 | 451 | "# Display some basic information on the FITS image file\n", |
|
428 | 462 | { |
429 | 463 | "cell_type": "code", |
430 | 464 | "execution_count": null, |
431 | | - "metadata": {}, |
| 465 | + "metadata": { |
| 466 | + "collapsed": true |
| 467 | + }, |
432 | 468 | "outputs": [], |
433 | 469 | "source": [ |
434 | 470 | "# View the Primary Header\n", |
|
438 | 474 | { |
439 | 475 | "cell_type": "code", |
440 | 476 | "execution_count": null, |
441 | | - "metadata": {}, |
| 477 | + "metadata": { |
| 478 | + "collapsed": true |
| 479 | + }, |
442 | 480 | "outputs": [], |
443 | 481 | "source": [ |
444 | 482 | "# View the Table Header\n", |
|
455 | 493 | { |
456 | 494 | "cell_type": "code", |
457 | 495 | "execution_count": null, |
458 | | - "metadata": {}, |
| 496 | + "metadata": { |
| 497 | + "collapsed": true |
| 498 | + }, |
459 | 499 | "outputs": [], |
460 | 500 | "source": [ |
461 | 501 | "wham_data_hdu[1].columns" |
|
471 | 511 | { |
472 | 512 | "cell_type": "code", |
473 | 513 | "execution_count": null, |
474 | | - "metadata": {}, |
| 514 | + "metadata": { |
| 515 | + "collapsed": true |
| 516 | + }, |
475 | 517 | "outputs": [], |
476 | 518 | "source": [ |
477 | 519 | "#Read in data as a Table\n", |
|
519 | 561 | { |
520 | 562 | "cell_type": "code", |
521 | 563 | "execution_count": null, |
522 | | - "metadata": {}, |
| 564 | + "metadata": { |
| 565 | + "collapsed": true |
| 566 | + }, |
523 | 567 | "outputs": [], |
524 | 568 | "source": [ |
525 | 569 | "wham_data" |
|
555 | 599 | { |
556 | 600 | "cell_type": "code", |
557 | 601 | "execution_count": null, |
558 | | - "metadata": {}, |
| 602 | + "metadata": { |
| 603 | + "collapsed": true |
| 604 | + }, |
559 | 605 | "outputs": [], |
560 | 606 | "source": [ |
561 | 607 | "# Match our catalogs\n", |
|
577 | 623 | { |
578 | 624 | "cell_type": "code", |
579 | 625 | "execution_count": null, |
580 | | - "metadata": {}, |
| 626 | + "metadata": { |
| 627 | + "collapsed": true |
| 628 | + }, |
581 | 629 | "outputs": [], |
582 | 630 | "source": [ |
583 | 631 | "# Create a sub Table of the WHAM matched data\n", |
|
598 | 646 | { |
599 | 647 | "cell_type": "code", |
600 | 648 | "execution_count": null, |
601 | | - "metadata": {}, |
| 649 | + "metadata": { |
| 650 | + "collapsed": true |
| 651 | + }, |
602 | 652 | "outputs": [], |
603 | 653 | "source": [ |
604 | 654 | "# Construct a new Table from the two existing Tables\n", |
|
653 | 703 | { |
654 | 704 | "cell_type": "code", |
655 | 705 | "execution_count": null, |
656 | | - "metadata": {}, |
| 706 | + "metadata": { |
| 707 | + "collapsed": true |
| 708 | + }, |
657 | 709 | "outputs": [], |
658 | 710 | "source": [ |
659 | 711 | "# Calculate H-Alpha rest wavelength\n", |
|
710 | 762 | { |
711 | 763 | "cell_type": "code", |
712 | 764 | "execution_count": null, |
713 | | - "metadata": {}, |
| 765 | + "metadata": { |
| 766 | + "collapsed": true |
| 767 | + }, |
714 | 768 | "outputs": [], |
715 | 769 | "source": [ |
716 | 770 | "# Function to convert H-Alpha intensity to an Emission Measure\n", |
|
765 | 819 | { |
766 | 820 | "cell_type": "code", |
767 | 821 | "execution_count": null, |
768 | | - "metadata": {}, |
| 822 | + "metadata": { |
| 823 | + "collapsed": true |
| 824 | + }, |
769 | 825 | "outputs": [], |
770 | 826 | "source": [ |
771 | 827 | "# Display our final Table\n", |
|
793 | 849 | { |
794 | 850 | "cell_type": "code", |
795 | 851 | "execution_count": null, |
796 | | - "metadata": {}, |
| 852 | + "metadata": { |
| 853 | + "collapsed": true |
| 854 | + }, |
797 | 855 | "outputs": [], |
798 | 856 | "source": [ |
799 | 857 | "# Write data to file \n", |
|
915 | 973 | { |
916 | 974 | "cell_type": "code", |
917 | 975 | "execution_count": null, |
918 | | - "metadata": {}, |
| 976 | + "metadata": { |
| 977 | + "collapsed": true |
| 978 | + }, |
919 | 979 | "outputs": [], |
920 | 980 | "source": [ |
921 | 981 | "# Initiate a matplotlib figure object\n", |
|
960 | 1020 | "outputs": [], |
961 | 1021 | "source": [ |
962 | 1022 | "# Download the Kinematic Data Table\n", |
963 | | - "wham_data_file = download_file('http://www.astro.wisc.edu/wham/ss/wham-ss-DR1-v161116-170912.fits',\n", |
964 | | - " cache=True, show_progress = True)\n", |
| 1023 | + "wham_data_file = download_file(tutorial_path + \n", |
| 1024 | + " 'wham-ss-DR1-v161116-170912.fits',\n", |
| 1025 | + " cache=True, show_progress = True)\n", |
965 | 1026 | "\n", |
966 | 1027 | "# Open the FITS file for reading\n", |
967 | 1028 | "wham_data_hdu = fits.open(wham_data_file)" |
|
0 commit comments