from astropy.coordinates import SkyCoord from astropy.table import Table from astropy.time import Time, TimeDelta from astropy import units as u from datetime import datetime from pywwt.jupyter import WWTJupyterWidget
bursts = Table.read('../data/grb_table_lite.ecsv', format='ascii.ecsv') bursts # print out out to get a sense of what the data are like
Adjust the date formatting to match what WWT accepts:
bursts['dates_JD'] = Time(bursts['dates_JD'], format='jd').isot bursts.rename_column('dates_JD', 'dates_ISO') bursts
wwt = WWTJupyterWidget() wwt
If you're using JupyterLab and not just a plain Jupyter notebook, you can move the WWT view to a separate window pane. This is extremely useful since it lets you keep on typing code without scrolling WWT out of view. Here's how you do that:
If you don't get a menu when you right-click, or the menu doesn't look like the one pictured, you are using a plain Jupyter notebook and will have to scroll back and forth.
lay = wwt.layers.add_table_layer(table=bursts, frame='Sky', lon_att='ra', lat_att='dec')
lay.size_scale *= 20
lay.time_series = True lay.time_att = 'dates_ISO'
lay.time_decay = 1 * u.yr wwt.get_current_time()
grb1 = bursts wwt.center_on_coordinates(SkyCoord(grb1['ra'], grb1['dec'], unit=u.deg))
wwt.set_current_time( (Time(grb1['dates_ISO'], format='isot') - TimeDelta(3 * u.second)))
You can find out more about adding layers in our documentation and contact us with any comments or questions at the WorldWide Telescope Forum or by opening an issue or pull request at
pywwt's main GitHub repository. Thank you for trying out this example notebook on visualizing time series data in