In [15]:
from astropy.io import ascii
from astropy.table import Table,Column
In [79]:
zebra = ascii.read('data/ST2010-3506 Grey Zebra Kalama.csv')
In [53]:
animal
Out[53]:
In [55]:
count = 0
for row in animal:
if (row[2] !='--'):
if (count==0):
animal_filtered=Table(row)
else:
animal_filtered.add_row(row)
count=count+1
animal_filtered
Out[55]:
In [56]:
from pywwt.mods import *
In [57]:
#Connect to WWT
wwt = WWTClient(host="127.0.0.1") #Can pass a IP address here if WWT is running on a remote machine
In [26]:
wwt.new_layer_group("Earth","Savannah")
In [58]:
#Set up WWT layer
savannah_layer = wwt.new_layer("Earth", "Lion Scar", animal_filtered.colnames)
#Set visualization parameters in WWT
props_dict = {"CoordinatesType":"Spherical",\
"MarkerScale":"Screen",\
"PointScaleType":"Constant",\
"ScaleFactor":"8",\
"ShowFarSide":"True",\
"RaUnits":"Degrees",\
"PlotType":"Circle",\
"ColorValue":"ARGBColor:255:255:255:255",\
"TimeSeries":"False"}
savannah_layer.set_properties(props_dict)
#Send data to WWT client
savannah_layer.update(data=animal_filtered, purge_all=True, no_purge=False, show=True)
In [59]:
%config InlineBackend.rc = {}
import matplotlib
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn
In [85]:
fig = plt.figure (figsize=(8,8))
p1 = fig.add_subplot(311)
p1.hist(animal_filtered['SPEED'],bins=100,range=[0, 15])
p2 = fig.add_subplot(312)
p2.hist(elephant['SPEED'],bins=100,range=[0, 15])
p3 = fig.add_subplot(313)
p3.hist(zebra['SPEED'],bins=100,range=[0, 15])
p1.set_ylabel("Lion")
p2.set_ylabel("Elephant")
p3.set_ylabel("Zebra")
plt.xlabel("SPEED (km/hr)")
Out[85]:
In [ ]: