{
"metadata": {
"name": "",
"signature": "sha256:1b47bc4c8f77db8a25d4b9be3dfd9d68a5941aff595ce18855a08b2293866619"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Pulsing Pulsars in Uniview"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Code to download Pulsar catalog in VizieR and output in a format readable by the USES (Uniview Shader Effect System). Custom shaders are created to pulse the pulsars in realtime"
]
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Imports"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Set up astropy and astroquery \n",
"from astropy.table import Table,Column\n",
"from astropy.coordinates import SkyCoord, Distance, CartesianRepresentation\n",
"from astropy import units as u\n",
"from astroquery.vizier import Vizier"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 1
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Set up Matplotlib\n",
"%config InlineBackend.rc = {}\n",
"import matplotlib\n",
"import matplotlib.pyplot as plt\n",
"%matplotlib inline"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Process Pulsar Catalog"
]
},
{
"cell_type": "heading",
"level": 4,
"metadata": {},
"source": [
"Acquire Catalog"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We will use a catalog of 706 pulsars from (Taylor+ 1995). This is VizieR catalog ID VII/189
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"v=Vizier(columns=['L']) #Need to ask for L explicitly as it is not part of the standard returned elements\n",
"v.ROW_LIMIT = -1\n",
"Cats = v.get_catalogs('VII/189')\n",
"pulsarCat=Cats[0]\n",
"pulsarCat.keep_columns([\"RAJ2000\",\"DEJ2000\",\"dist\",\"P\",\"Age\",\"L\"])\n",
"#Create Column with dist in pc (not kpc) for WWT\n",
"distCol=Column(1000*pulsarCat['dist'].filled(0),name='distance',meta={'ucd': 'pos.distance'}, unit='pc')\n",
"pulsarCat.add_column(distCol)\n",
"del pulsarCat['dist']\n",
"pulsarCat.rename_column('RAJ2000', 'RA')\n",
"pulsarCat.rename_column('DEJ2000', 'dec')\n",
"pulsarCoords=SkyCoord(pulsarCat['RA'],pulsarCat['dec'],unit=(u.degree, u.degree),\\\n",
" distance=Distance(pulsarCat['distance'],u.pc),frame='icrs')\n",
"pulsarGalCoords = pulsarCoords.galactic\n",
"pulsarGalCoords.representation='cartesian'\n",
"#Now we'll add the projection into the Galactic coordinate, minus signs convert from left-handed towards anti-center to right handed towards center\n",
"pulsarCat.add_column(Column(-1.0*pulsarCoords.galactic.represent_as(CartesianRepresentation).x,name='x_gal_coord',meta={'ucd': 'pos.cartesian.x'}),0)\n",
"pulsarCat.add_column(Column(-1.0*pulsarCoords.galactic.represent_as(CartesianRepresentation).y,name='y_gal_coord',meta={'ucd': 'pos.cartesian.y'}),1)\n",
"pulsarCat.add_column(Column(pulsarCoords.galactic.represent_as(CartesianRepresentation).z,name='z_gal_coord',meta={'ucd': 'pos.cartesian.z'}),2)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stderr",
"text": [
"C:\\Anaconda\\lib\\site-packages\\astroquery\\vizier\\core.py:556: UserWarning: VOTABLE parsing raised exception: \n",
" warnings.warn(\"VOTABLE parsing raised exception: {0}\".format(ex))\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 4,
"metadata": {},
"source": [
"Print Catalog"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"pulsarCat"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"
x_gal_coord | y_gal_coord | z_gal_coord | L | RA | dec | P | Age | distance |
---|---|---|---|---|---|---|---|---|
pc | pc | pc | [mJy.kpc2] | deg | deg | s | [yr] | pc |
159.702406285 | -486.532971175 | -477.26387815 | -1.009 | 1.52000 | 18.58306 | 0.6937476704700000 | 6.719 | 700.00 |
794.305967523 | -1593.31716053 | -464.777856515 | 1.676 | 3.57393 | 47.77585 | 1.2406989780800000 | 7.543 | 1840.00 |
-1870.39260492 | 2581.60854767 | -3175.99257085 | 1.491 | 5.95976 | -72.07540 | 0.0057567800116100 | -- | 4500.00 |
-1868.42525015 | 2582.95608052 | -3176.05493824 | 1.284 | 6.05782 | -72.07884 | 0.0053575732859000 | -- | 4500.00 |
-1868.98589738 | 2582.26220404 | -3176.28928547 | 0.000 | 6.02464 | -72.07304 | 0.0035363290000000 | -- | 4500.00 |
-1868.98589738 | 2582.26220404 | -3176.28928547 | 0.000 | 6.02464 | -72.07304 | 0.0026235790000000 | -- | 4500.00 |
-1868.98589738 | 2582.26220404 | -3176.28928547 | 0.000 | 6.02464 | -72.07304 | 0.0040403790000000 | -- | 4500.00 |
-1868.98589738 | 2582.26220404 | -3176.28928547 | 0.000 | 6.02464 | -72.07304 | 0.0032105000000000 | -- | 4500.00 |
-1868.98589738 | 2582.26220404 | -3176.28928547 | 0.000 | 6.02464 | -72.07304 | 0.0034849930000000 | -- | 4500.00 |
-1868.98589738 | 2582.26220404 | -3176.28928547 | 0.000 | 6.02464 | -72.07304 | 0.0021006334000000 | -- | 4500.00 |
-1868.98589738 | 2582.26220404 | -3176.28928547 | 0.000 | 6.02464 | -72.07304 | 0.0043461700000000 | -- | 4500.00 |
... | ... | ... | ... | ... | ... | ... | ... | ... |
114.973253897 | -1125.70324177 | -824.362397462 | 1.468 | 349.49082 | 21.83064 | 1.4446526746999999 | 7.338 | 1400.00 |
1211.09859835 | -2983.39220111 | -31.7987330787 | 2.572 | 350.47994 | 60.40852 | 2.2564878673700002 | 6.706 | 3220.00 |
70.3896015162 | -616.381061248 | -472.778691708 | 0.231 | 350.59315 | 20.95082 | 0.0048084282098382 | 9.893 | 780.00 |
-517.471591703 | 427.687998208 | -896.496585587 | 0.700 | 351.11195 | -60.90108 | 2.3474851960000001 | 7.155 | 1120.00 |
4226.30402348 | -9757.46118059 | 374.039583838 | 2.957 | 351.30579 | 63.28274 | 1.4363084791000000 | 6.896 | 10640.00 |
1879.18073922 | -4438.58982913 | 0.279532256375 | 2.597 | 351.74460 | 61.22681 | 0.2336519310508000 | 7.021 | 4820.00 |
-108.083846043 | -126.082109584 | -461.000199422 | 1.004 | 352.61170 | -20.09127 | 1.6436209539400000 | 6.750 | 490.00 |
1015.80265467 | -2251.43146642 | 10.0657228859 | 1.785 | 354.27408 | 61.85052 | 0.4952787846500000 | 4.612 | 2470.00 |
-91.0604128026 | -847.621752357 | -1753.78030727 | 1.621 | 356.77083 | -6.20000 | 1.1814499999999999 | -- | 1950.00 |
1454.56914514 | -2950.9666276 | -11.1608607905 | 2.265 | 358.51962 | 61.92966 | 0.9447824489830000 | 5.964 | 3290.00 |