{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Data to Dome: Visualizing Gamma Ray Bursts in WWT" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For this month’s tutorial we will create a visualization of Gamma Ray Bursts. The tutorial was created for A KICP short course for museum and planetarium staff about the Evolving Universe (http://kicp-courses.uchicago.edu/2014/index.php) held this September. Here we will only visualize the data in WWT. While similar visualizations are possible in other planetarium software packages, the process of creating them is somewhat awkward. The time domain is the next great frontier for astronomy, I encourage software vendors to follow along with the tutorial and think about how they can streamline the process of creating a similar visualization using their software.

\n", "Mark Subbarao (msubbarao at adlerplanetarium.org)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##### Python Setup" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from astropy.table import Table,Column\n", "from astropy.time import Time\n", "from astropy import units\n", "from astropy.coordinates import SkyCoord\n", "from astroquery.vizier import Vizier" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [], "source": [ "#Create Vizier object, turn off default row limit\n", "v = Vizier()\n", "v.ROW_LIMIT = -1" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##### WWT Setup" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from pywwt.mods import *" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "#Connect to WWT\n", "wwt = WWTClient() #Can pass a IP address here if WWT is running on a remote machine\n", "wwt.new_layer_group(\"Sky\",\"Dynamic Universe\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Gamma Ray Bursts" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For out data catalog we'll choose The second Fermi/GBM GRB catalog (4yr) (von Kienlin+, 2014)\n", "Vizier catalog: J/ApJS/211/13/GBM\n", "Which contains Fermi events from July 2007 to July 2012" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": true }, "outputs": [], "source": [ "Cats = v.get_catalogs('J/ApJS/211/13/GBM')" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "<Table masked=True length=954>\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
_RAJ2000_DEJ2000TIDGRBf_GRBObsTimeRAJ2000DEJ2000ErrLocAlgTimeErangeOtherDet_2yrLCSimbadNameRemDetT90e_T90T90stT50e_T50T50stFl.we_Fl.wPF1.we_PF1.wPF2.we_PF2.wPF3.we_PF3.wFl.ne_Fl.nPF1.ne_PF1.nPF2.ne_PF2.nPF3.ne_PF3.n
degdeg"h:m:s"degdegdegmskeVssssssmJ / m2mJ / m2ph s / cm2ph s / cm2ph s / cm2ph s / cm2ph s / cm2ph s / cm2mJ / m2mJ / m2ph s / cm2ph s / cm2ph s / cm2ph s / cm2ph s / cm2ph s / cm2
float64float64int32bytes7bytes3bytes13float32float32float32bytes9int16int16bytes6bytes28int16bytes2bytes10bytes1bytes13float32float32float64float32float32float64float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32
41.90008.500080714086080714B02:04:12.053441.908.507.5Fermi-GBM1051247-291K1LCGRB080714B3+4+85.3762.360-0.7682.8160.810-0.2566.8e-074.1e-083.821.062.240.361.540.183.5e-071.7e-081.520.740.910.360.430.18
187.5000-74.000080714425080714C10:12:01.8376187.50-74.008.7Fermi-GBM17409647-2911LCGRB080714C0+9+1040.1921.145-4.35211.7761.619-1.2801.8e-062.1e-084.001.452.960.462.020.219.8e-071.4e-081.030.450.710.190.460.08
188.1000-60.200080714745080714A17:52:54.0234188.10-60.20--Swift13102447-291K, R, IA, S, Me, A1LCGRB080714A559.64911.276-0.51225.0887.9402.5606.3e-061.4e-078.891.617.780.836.930.393.3e-066e-084.411.663.270.712.820.36
214.70009.900080715950080715Ai22:48:40.1634214.709.902.0Fermi-GBM2925623-47K, Me, A1LCGRB080715A0+1+2+9+107.8720.2720.1286.1440.2641.0885e-067.9e-0819.420.9513.580.459.910.222.5e-063.5e-0810.700.956.610.453.830.22
147.3000-70.000080717543080717A13:02:35.2207147.30-70.004.7Fermi-GBM17409647-2911LCGRB080717A2+1036.6092.985-5.37613.0560.8101.0244.5e-067.7e-086.241.083.430.492.890.232.4e-064.5e-082.141.031.300.471.050.23
153.2000-61.300080719529080719A12:41:40.9578153.20-61.3013.8Fermi-GBM16409647-291K, A1LCGRB080719A6+7+916.12817.887-4.3528.4481.280-2.0487.7e-072.9e-082.770.831.770.291.120.163.9e-071.5e-080.590.180.320.080.230.04
98.5000-43.900080720316080720A07:35:35.547698.50-43.904.8Fermi-GBM19819247-2911LCGRB080720Aa--------------------------------------------
176.8000-60.200080723557080723Bi13:22:21.3751176.80-60.20--Swift825647-291K, IA, IS, Me, A1LCGRB080723B458.3691.9852.36840.5130.23114.2087.2e-052.5e-0740.972.2438.241.0930.450.493.9e-051.1e-0721.191.7919.811.0915.140.48
113.3000-19.700080723913080723C21:55:23.0583113.30-19.709.9Fermi-GBM56447-291W1LCGRB080723C0+1+30.1920.345-0.0640.0640.143-0.0641.3e-071.4e-085.260.704.130.321.410.137.5e-085.2e-092.620.662.140.320.690.13
...........................................................................................................................
182.7000-45.7000120701654120701B15:41:48.3152182.70-45.7014.8Fermi-GBM612847-291IA, Me0LCGRB120701B8+10+111.0241.451-0.9600.1281.313-0.1928.4e-086.3e-086.682.134.501.021.760.454.9e-082.9e-081.560.501.050.240.410.11
227.800036.8000120702891120702A21:23:19.1712227.8036.808.5Fermi-GBM1151247-291S0LCGRB120702Ap6+7+935.0734.924-1.02415.3602.1111.0241.6e-065.8e-083.161.102.310.401.680.211e-063.4e-081.160.410.660.140.440.06
69.500034.7000120703417120703B10:01:11.688269.5034.702.6Fermi-GBM12102447-291K, R, IA, Me0LCGRB120703B3+4+564.5133.083-0.51236.6092.0643.8401.1e-055.2e-0810.061.368.280.637.640.325.5e-062.8e-083.580.562.900.252.550.12
210.500046.3000120703498120703C11:56:56.8702210.5046.305.2Fermi-GBM13102447-2910LCGRB120703C4+877.5682.187-2.04834.30411.5310.7682.6e-065.3e-084.801.373.950.542.540.271.5e-063.3e-081.900.541.220.210.730.08
339.4000-29.7000120703726120703Ai17:25:17.0323339.40-29.70--Swift14204847-291K, R, IA, S, Me0LCGRB120703A6+7+9+10+118.9601.3790.7681.5360.3624.6088.3e-069.8e-0819.751.1918.730.6117.180.304.3e-065.2e-0811.920.7310.300.368.600.17
291.1000-34.4000120707800120707Ai19:12:17.4295291.10-34.401.0Fermi-GBM16409647-291Mo, K, R, IA, S, W0LCGRB120707A8+1140.9604.2381.52016.6400.72414.0649.4e-057.1e-0776.707.1367.093.3760.331.595.2e-053.4e-0728.342.5324.611.2322.600.59
318.4000-50.1000120709883120709Ai21:11:40.3666318.40-50.100.5Fermi-LAT46447-291K, IA, Me, L0LCGRB120709A6+7+927.3280.958-0.12811.7760.36210.8161.4e-053.8e-0818.351.4115.390.6511.050.296.3e-062.1e-0810.910.778.500.365.000.16
120.4000-31.1000120710100120710A02:23:17.0507120.40-31.104.8Fermi-GBM925647-291S, Me, W0LCGRB120710A0+3+4+6+7131.8401.0560.00094.7205.38226.1125.3e-062.1e-086.561.354.640.553.800.252.7e-061.1e-081.990.441.170.170.900.08
94.7000-71.0000120711115120711Ai02:44:53.294394.70-71.00--INTEGRAL825647-291K, R, IA, IS, S, Me, M, L0LCGRB120711A2+1044.0330.72462.46525.0880.72471.6810.000192.3e-0744.672.8131.571.2226.720.586.6e-057.7e-0819.051.6814.420.6412.190.28
127.9000-31.8000120711446120711C10:42:54.5709127.90-31.8011.0Fermi-GBM13102447-291IA, W0LCGRB120711C0+1+387.5523.874-1.28045.3121.3795.3761.9e-062e-083.831.182.260.361.280.171e-061.2e-080.730.340.540.100.310.05
" ], "text/plain": [ "\n", "_RAJ2000 _DEJ2000 TID GRB ... e_PF2.n PF3.n e_PF3.n \n", " deg deg ... ph s / cm2 ph s / cm2 ph s / cm2\n", "float64 float64 int32 bytes7 ... float32 float32 float32 \n", "-------- -------- --------- ------- ... ---------- ---------- ----------\n", " 41.9000 8.5000 80714086 080714B ... 0.36 0.43 0.18\n", "187.5000 -74.0000 80714425 080714C ... 0.19 0.46 0.08\n", "188.1000 -60.2000 80714745 080714A ... 0.71 2.82 0.36\n", "214.7000 9.9000 80715950 080715A ... 0.45 3.83 0.22\n", "147.3000 -70.0000 80717543 080717A ... 0.47 1.05 0.23\n", "153.2000 -61.3000 80719529 080719A ... 0.08 0.23 0.04\n", " 98.5000 -43.9000 80720316 080720A ... -- -- --\n", "176.8000 -60.2000 80723557 080723B ... 1.09 15.14 0.48\n", "113.3000 -19.7000 80723913 080723C ... 0.32 0.69 0.13\n", " ... ... ... ... ... ... ... ...\n", "182.7000 -45.7000 120701654 120701B ... 0.24 0.41 0.11\n", "227.8000 36.8000 120702891 120702A ... 0.14 0.44 0.06\n", " 69.5000 34.7000 120703417 120703B ... 0.25 2.55 0.12\n", "210.5000 46.3000 120703498 120703C ... 0.21 0.73 0.08\n", "339.4000 -29.7000 120703726 120703A ... 0.36 8.60 0.17\n", "291.1000 -34.4000 120707800 120707A ... 1.23 22.60 0.59\n", "318.4000 -50.1000 120709883 120709A ... 0.36 5.00 0.16\n", "120.4000 -31.1000 120710100 120710A ... 0.17 0.90 0.08\n", " 94.7000 -71.0000 120711115 120711A ... 0.64 12.19 0.28\n", "127.9000 -31.8000 120711446 120711C ... 0.10 0.31 0.05" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Cats[0]" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [], "source": [ "grbCat=Cats[0]\n", "grbCat.keep_columns([\"GRB\",\"RAJ2000\",\"DEJ2000\",\"Time\",\"ObsTime\",\"Fl.w\",\"Fl.n\"])\n", "grbCat.rename_column('RAJ2000', 'RA')\n", "grbCat.rename_column('DEJ2000', 'dec')" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "<Table masked=True length=954>\n", "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
GRBObsTimeRAdecTimeFl.wFl.n
"h:m:s"degdegmsmJ / m2mJ / m2
bytes7bytes13float32float32int16float32float32
080714B02:04:12.053441.908.505126.8e-073.5e-07
080714C10:12:01.8376187.50-74.0040961.8e-069.8e-07
080714A17:52:54.0234188.10-60.2010246.3e-063.3e-06
080715A22:48:40.1634214.709.902565e-062.5e-06
080717A13:02:35.2207147.30-70.0040964.5e-062.4e-06
080719A12:41:40.9578153.20-61.3040967.7e-073.9e-07
080720A07:35:35.547698.50-43.908192----
080723B13:22:21.3751176.80-60.202567.2e-053.9e-05
080723C21:55:23.0583113.30-19.70641.3e-077.5e-08
.....................
120701B15:41:48.3152182.70-45.701288.4e-084.9e-08
120702A21:23:19.1712227.8036.805121.6e-061e-06
120703B10:01:11.688269.5034.7010241.1e-055.5e-06
120703C11:56:56.8702210.5046.3010242.6e-061.5e-06
120703A17:25:17.0323339.40-29.7020488.3e-064.3e-06
120707A19:12:17.4295291.10-34.4040969.4e-055.2e-05
120709A21:11:40.3666318.40-50.10641.4e-056.3e-06
120710A02:23:17.0507120.40-31.102565.3e-062.7e-06
120711A02:44:53.294394.70-71.002560.000196.6e-05
120711C10:42:54.5709127.90-31.8010241.9e-061e-06
" ], "text/plain": [ "\n", " GRB ObsTime RA dec Time Fl.w Fl.n \n", " \"h:m:s\" deg deg ms mJ / m2 mJ / m2 \n", " bytes7 bytes13 float32 float32 int16 float32 float32 \n", "------- ------------- ------- ------- ----- --------- ---------\n", "080714B 02:04:12.0534 41.90 8.50 512 6.8e-07 3.5e-07\n", "080714C 10:12:01.8376 187.50 -74.00 4096 1.8e-06 9.8e-07\n", "080714A 17:52:54.0234 188.10 -60.20 1024 6.3e-06 3.3e-06\n", "080715A 22:48:40.1634 214.70 9.90 256 5e-06 2.5e-06\n", "080717A 13:02:35.2207 147.30 -70.00 4096 4.5e-06 2.4e-06\n", "080719A 12:41:40.9578 153.20 -61.30 4096 7.7e-07 3.9e-07\n", "080720A 07:35:35.5476 98.50 -43.90 8192 -- --\n", "080723B 13:22:21.3751 176.80 -60.20 256 7.2e-05 3.9e-05\n", "080723C 21:55:23.0583 113.30 -19.70 64 1.3e-07 7.5e-08\n", " ... ... ... ... ... ... ...\n", "120701B 15:41:48.3152 182.70 -45.70 128 8.4e-08 4.9e-08\n", "120702A 21:23:19.1712 227.80 36.80 512 1.6e-06 1e-06\n", "120703B 10:01:11.6882 69.50 34.70 1024 1.1e-05 5.5e-06\n", "120703C 11:56:56.8702 210.50 46.30 1024 2.6e-06 1.5e-06\n", "120703A 17:25:17.0323 339.40 -29.70 2048 8.3e-06 4.3e-06\n", "120707A 19:12:17.4295 291.10 -34.40 4096 9.4e-05 5.2e-05\n", "120709A 21:11:40.3666 318.40 -50.10 64 1.4e-05 6.3e-06\n", "120710A 02:23:17.0507 120.40 -31.10 256 5.3e-06 2.7e-06\n", "120711A 02:44:53.2943 94.70 -71.00 256 0.00019 6.6e-05\n", "120711C 10:42:54.5709 127.90 -31.80 1024 1.9e-06 1e-06" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "grbCat" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "#Plot the Catalog\n", "%config InlineBackend.rc = {}\n", "import matplotlib\n", "import matplotlib.pyplot as plt\n", "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "#Plot the Catalog\n", "coordsCol=SkyCoord(grbCat['RA'],grbCat['dec'],'icrs')\n", "fig = plt.figure (figsize=(8,6))\n", "ax = fig.add_subplot(111,projection=\"mollweide\", axisbg='white')\n", "ax.grid(True)\n", "ax.get_xaxis().tick_bottom()\n", "ax.scatter(coordsCol.galactic.l.wrap_at(180.*units.degree).radian,\\\n", " coordsCol.galactic.b.radian,s=6,lw=0)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Extracting the event time from this table is tricky. The time of day is in the ObsTime column, but the date is embedded in the GRB name. We'll extract the date from the GRB name and combine that with ObsTime to make a astropy time object. " ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [], "source": [ "timeList=[]\n", "grbList=grbCat['GRB']\n", "for i in range(len(grbList)):\n", " timeString= grbList[i][2:4].decode()+'/'+grbList[i][4:6].decode()+'/'+'20'+grbList[i][0:2].decode()+' '+grbCat['ObsTime'][i].decode()\n", " timeList.append(timeString)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##### Export Catalog to WWT" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "WWT contains its own time format, unfortunately one that astropy cannot write, so we'll have to create our own custom string." ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "<Table masked=True length=954>\n", "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
GRBObsTimeRAdecTimeFl.wFl.nTimeAndDate
"h:m:s"degdegmsmJ / m2mJ / m2
bytes7bytes13float32float32int16float32float32str24
080714B02:04:12.053441.908.505126.8e-073.5e-0707/14/2008 02:04:12.0534
080714C10:12:01.8376187.50-74.0040961.8e-069.8e-0707/14/2008 10:12:01.8376
080714A17:52:54.0234188.10-60.2010246.3e-063.3e-0607/14/2008 17:52:54.0234
080715A22:48:40.1634214.709.902565e-062.5e-0607/15/2008 22:48:40.1634
080717A13:02:35.2207147.30-70.0040964.5e-062.4e-0607/17/2008 13:02:35.2207
080719A12:41:40.9578153.20-61.3040967.7e-073.9e-0707/19/2008 12:41:40.9578
080720A07:35:35.547698.50-43.908192----07/20/2008 07:35:35.5476
080723B13:22:21.3751176.80-60.202567.2e-053.9e-0507/23/2008 13:22:21.3751
080723C21:55:23.0583113.30-19.70641.3e-077.5e-0807/23/2008 21:55:23.0583
........................
120701B15:41:48.3152182.70-45.701288.4e-084.9e-0807/01/2012 15:41:48.3152
120702A21:23:19.1712227.8036.805121.6e-061e-0607/02/2012 21:23:19.1712
120703B10:01:11.688269.5034.7010241.1e-055.5e-0607/03/2012 10:01:11.6882
120703C11:56:56.8702210.5046.3010242.6e-061.5e-0607/03/2012 11:56:56.8702
120703A17:25:17.0323339.40-29.7020488.3e-064.3e-0607/03/2012 17:25:17.0323
120707A19:12:17.4295291.10-34.4040969.4e-055.2e-0507/07/2012 19:12:17.4295
120709A21:11:40.3666318.40-50.10641.4e-056.3e-0607/09/2012 21:11:40.3666
120710A02:23:17.0507120.40-31.102565.3e-062.7e-0607/10/2012 02:23:17.0507
120711A02:44:53.294394.70-71.002560.000196.6e-0507/11/2012 02:44:53.2943
120711C10:42:54.5709127.90-31.8010241.9e-061e-0607/11/2012 10:42:54.5709
" ], "text/plain": [ "\n", " GRB ObsTime RA ... Fl.w Fl.n TimeAndDate \n", " \"h:m:s\" deg ... mJ / m2 mJ / m2 \n", " bytes7 bytes13 float32 ... float32 float32 str24 \n", "------- ------------- ------- ... --------- --------- ------------------------\n", "080714B 02:04:12.0534 41.90 ... 6.8e-07 3.5e-07 07/14/2008 02:04:12.0534\n", "080714C 10:12:01.8376 187.50 ... 1.8e-06 9.8e-07 07/14/2008 10:12:01.8376\n", "080714A 17:52:54.0234 188.10 ... 6.3e-06 3.3e-06 07/14/2008 17:52:54.0234\n", "080715A 22:48:40.1634 214.70 ... 5e-06 2.5e-06 07/15/2008 22:48:40.1634\n", "080717A 13:02:35.2207 147.30 ... 4.5e-06 2.4e-06 07/17/2008 13:02:35.2207\n", "080719A 12:41:40.9578 153.20 ... 7.7e-07 3.9e-07 07/19/2008 12:41:40.9578\n", "080720A 07:35:35.5476 98.50 ... -- -- 07/20/2008 07:35:35.5476\n", "080723B 13:22:21.3751 176.80 ... 7.2e-05 3.9e-05 07/23/2008 13:22:21.3751\n", "080723C 21:55:23.0583 113.30 ... 1.3e-07 7.5e-08 07/23/2008 21:55:23.0583\n", " ... ... ... ... ... ... ...\n", "120701B 15:41:48.3152 182.70 ... 8.4e-08 4.9e-08 07/01/2012 15:41:48.3152\n", "120702A 21:23:19.1712 227.80 ... 1.6e-06 1e-06 07/02/2012 21:23:19.1712\n", "120703B 10:01:11.6882 69.50 ... 1.1e-05 5.5e-06 07/03/2012 10:01:11.6882\n", "120703C 11:56:56.8702 210.50 ... 2.6e-06 1.5e-06 07/03/2012 11:56:56.8702\n", "120703A 17:25:17.0323 339.40 ... 8.3e-06 4.3e-06 07/03/2012 17:25:17.0323\n", "120707A 19:12:17.4295 291.10 ... 9.4e-05 5.2e-05 07/07/2012 19:12:17.4295\n", "120709A 21:11:40.3666 318.40 ... 1.4e-05 6.3e-06 07/09/2012 21:11:40.3666\n", "120710A 02:23:17.0507 120.40 ... 5.3e-06 2.7e-06 07/10/2012 02:23:17.0507\n", "120711A 02:44:53.2943 94.70 ... 0.00019 6.6e-05 07/11/2012 02:44:53.2943\n", "120711C 10:42:54.5709 127.90 ... 1.9e-06 1e-06 07/11/2012 10:42:54.5709" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "grbList=grbCat['GRB']\n", "timeList=[]\n", "for i in range(len(grbList)):\n", " timeString= grbList[i][2:4].decode()+'/'+grbList[i][4:6].decode()+'/'+'20'+grbList[i][0:2].decode()+' '+grbCat['ObsTime'][i].decode()\n", " timeList.append(timeString)\n", "grbCat.add_column(Column(timeList,name='TimeAndDate'))\n", "grbCat" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "collapsed": false }, "outputs": [ { "ename": "NameError", "evalue": "name 'wwt' is not defined", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[1;31m#Set up WWT layer\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mgrb_layer\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mwwt\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mnew_layer\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Dynamic Universe\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m\"Gamma Ray Bursts\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mgrbCat\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcolnames\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 3\u001b[0m \u001b[1;31m#Set visualization parameters in WWT\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0mprops_dict\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m{\u001b[0m\u001b[1;34m\"CoordinatesType\"\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;34m\"Spherical\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m\"MarkerScale\"\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;34m\"Screen\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m\"PointScaleType\"\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;34m\"Constant\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m\"ScaleFactor\"\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;34m\"64\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m\"ShowFarSide\"\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;34m\"True\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m\"RaUnits\"\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;34m\"Degrees\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m\"PlotType\"\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;34m\"Gaussian\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m\"ColorValue\"\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;34m\"ARGBColor:255:255:255:255\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m\"TimeSeries\"\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;34m\"False\"\u001b[0m\u001b[1;33m}\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0mgrb_layer\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mset_properties\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mprops_dict\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[0;31mNameError\u001b[0m: name 'wwt' is not defined" ] } ], "source": [ "#Set up WWT layer\n", "grb_layer = wwt.new_layer(\"Dynamic Universe\", \"Gamma Ray Bursts\", grbCat.colnames)\n", "#Set visualization parameters in WWT\n", "props_dict = {\"CoordinatesType\":\"Spherical\",\\\n", " \"MarkerScale\":\"Screen\",\\\n", " \"PointScaleType\":\"Constant\",\\\n", " \"ScaleFactor\":\"64\",\\\n", " \"ShowFarSide\":\"True\",\\\n", " \"RaUnits\":\"Degrees\",\\\n", " \"PlotType\":\"Gaussian\",\\\n", " \"ColorValue\":\"ARGBColor:255:255:255:255\",\\\n", " \"TimeSeries\":\"False\"}\n", "grb_layer.set_properties(props_dict)\n", "#Send data to WWT client\n", "grb_layer.update(data=grbCat, purge_all=True, no_purge=False, show=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now inside WWT we can choose how we visualize the data, we can show all the data at once or playback the events as they happen watching the GRB’s go off like popcorn across the sky. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [] } ], "metadata": { "anaconda-cloud": {}, "kernelspec": { "display_name": "Python [conda root]", "language": "python", "name": "conda-root-py" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.5.2" } }, "nbformat": 4, "nbformat_minor": 0 }