This notebook contains various code blocks performing data processing tasks developed for the NEO dome short produced for the Adler Planetarium. Spring 2015
The Orbital parameters and covariance matrix were obtained from JPL Horizons: http://ssd.jpl.nasa.gov/sbdb.cgi?sstr=2014%20WR365;old=0;orb=0;cov=1;log=0;cad=0#elem
#Variable order : e,q,node,peri,i
mean=np.array([.57279095148,1.175127196458,2.2195714987,56.968278363537,3.13449695])
cov=np.array([[1.137287462358005E-5,3.300800163773148E-6,-2.269402074737977E-5,-2.968256075575697E-5,4.56616711758885E-5],\
[3.300800163773148E-6,9.583940510872261E-7,-7.167778951468698E-6,-7.647531668944469E-6,1.323753645963288E-5],\
[-2.269402074737977E-5,-7.167778951468698E-6,.000938145104567499,-.001422809143814682,-6.782284163996406E-5],\
[-2.968256075575697E-5,-7.647531668944469E-6,-.001422809143814682,.002540308468290081,-.0001578292284344169],\
[4.56616711758885E-5,1.323753645963288E-5,-6.782284163996406E-5,-.0001578292284344169,.0001839390116515019]])
import numpy as np
nBundle = 200 # the number of orbits in the orbit bundle
orbitBundle = np.random.multivariate_normal(mean,cov,nBundle)
writefile=open('2014WR365.raw',"w")
for i in range(nBundle):
outline = "%f %f %f %f %f 0.0 0.0 1.0 0.0\n" % (orbitBundle[i,1],orbitBundle[i,0],orbitBundle[i,4],orbitBundle[i,2],orbitBundle[i,3])
writefile.write(outline)
factor=0.1; #how much better the errors are
secondBundle=np.random.multivariate_normal(np.random.multivariate_normal(mean,cov),factor*factor*cov,nBundle)
for i in range(nBundle):
outline = "%f %f %f %f %f 0.0 0.0 2.0 0.0\n" % (secondBundle[i,1],secondBundle[i,0],secondBundle[i,4],secondBundle[i,2],secondBundle[i,3])
writefile.write(outline)
writefile.close()
writefile=open('2014WR365.raw',"w")
readfile=open('data/mpcorb_2014WR365_noAPO.dat',"r")
for line in readfile:
cols=line.split()
if (len(cols)==25):
outline = "%s %s %s %s %s 0.0 0.0 1.0 0.0\n" % (cols[10],cols[8],cols[7],cols[6],cols[5])
writefile.write(outline)
readfile.close()
readfile=open('data/mpcorb_2014WR365_withAPO.dat',"r")
for line in readfile:
cols=line.split()
if (len(cols)==25):
outline = "%s %s %s %s %s 0.0 0.0 2.0 0.0\n" % (cols[10],cols[8],cols[7],cols[6],cols[5])
writefile.write(outline)
readfile.close()
writefile.close()
#Set up astropy and astroquery
from astropy.table import Table,Column
Strikes = Table.read('data/Park Forest Meteorite Fall.csv', format='ascii.csv')
Strikes['elevation'] = 217
Strikes['colormap'] = 'magenta'
for i in range(len(Stars['Weight (g)'])):
pc=Stars['Weight (g)'][i]
if pc>454:
Strikes['colormap'][i]='cyan'
if pc>4540:
Strikes['colormap'][i]='yellow'
Strikes
Latitude | Longitude | Weight (g) | elevation | colormap |
---|---|---|---|---|
41.504764 | -87.682127 | 2500 | 217 | cyan |
41.492279 | -87.680312 | 50 | 217 | magenta |
41.4827299 | -87.670138 | 1000 | 217 | cyan |
41.483404 | -87.686928 | 344 | 217 | magenta |
41.495513 | -87.686539 | 900 | 217 | cyan |
41.464059 | -87.699057 | 160 | 217 | magenta |
41.5086561 | -87.6829963 | 3400 | 217 | cyan |
41.498318 | -87.694615 | 957 | 217 | cyan |
41.5007469 | -87.681909 | 892 | 217 | cyan |
41.472989 | -87.680222 | 150 | 217 | magenta |
41.47975 | -87.680852 | 50 | 217 | magenta |
... | ... | ... | ... | ... |
41.4606033 | -87.6373587 | 39 | 217 | magenta |
41.4892417 | -87.6792076 | 1230 | 217 | cyan |
41.4728823 | -87.6741107 | 110 | 217 | magenta |
41.47188 | -87.6769489 | 220 | 217 | magenta |
41.4802211 | -87.6741368 | 333 | 217 | magenta |
41.4697895 | -87.6742358 | 88 | 217 | magenta |
41.4697875 | -87.6378176 | 10 | 217 | magenta |
41.4697875 | -87.6378176 | 20 | 217 | magenta |
41.4680825 | -87.6469169 | 125 | 217 | magenta |
41.4463365 | -87.6313963 | 48 | 217 | magenta |
41.50657 | -87.686637 | 5259 | 217 | yellow |
#Connect to WWT and set up Layer Group
from pywwt.mods import *
wwt = WWTClient(host="127.0.0.1") #Can pass a IP address here if WWT is running on a remote machine
#Set up WWT layer
SgrStream_layer = wwt.new_layer("Earth","Park Forest Strewnfield", Strikes.colnames)
#Set visualization parameters in WWT
props_dict = {'AltColumn': u'3',\
'AltType': u'Altitude',\
'AltUnit': u'Meters',\
"CoordinatesType":"Spherical",\
"MarkerScale":"Screen",\
"PointScaleType":"Constant",\
"ScaleFactor":"8",\
"ShowFarSide":"True",\
"RaUnits":"Degrees",\
"PlotType":"Circle",\
"ColorMapColumn":"4",\
'ScaleFactor': u'0.0078125',\
'SizeColumn': u'2',\
"TimeSeries":"False"}
SgrStream_layer.set_properties(props_dict)
#Send data to WWT client
SgrStream_layer.update(data=Strikes, purge_all=True, no_purge=False, show=True)
Connecting to WWT on host 127.0.0.1.
SgrStream_layer.get_properties()
{'AltColumn': u'3', 'AltType': u'Altitude', 'AltUnit': u'Meters', 'Astronomical': u'False', 'AutoUpdate': u'False', 'BeginRange': u'12/31/9999 11:59:59 PM', 'CartesianCustomScale': u'1', 'CartesianScale': u'Meters', 'Class': u'SpreadSheetLayer', 'ColorMapColumn': u'4', 'ColorValue': u'ARGBColor:255:255:255:255', 'CoordinatesType': u'Spherical', 'DataSourceUrl': u'', 'Decay': u'16', 'DynamicData': u'False', 'Enabled': u'True', 'EndDateColumn': u'-1', 'EndRange': u'1/1/0001 12:00:00 AM', 'EndTime': u'12/31/9999 11:59:59 PM', 'FadeSpan': u'00:00:00', 'FadeType': u'None', 'GeometryColumn': u'-1', 'HyperlinkColumn': u'-1', 'HyperlinkFormat': u'', 'LatColumn': u'0', 'LngColumn': u'1', 'MarkerColumn': u'-1', 'MarkerIndex': u'0', 'MarkerMix': u'Same_For_All', 'MarkerScale': u'World', 'Name': u'Park Forest Strewnfield', 'NameColumn': u'0', 'Opacity': u'1', 'PlotType': u'Circle', 'PointScaleType': u'Log', 'RaUnits': u'Degrees', 'ScaleFactor': u'0.0078125', 'ShowFarSide': u'True', 'SizeColumn': u'2', 'StartDateColumn': u'-1', 'StartTime': u'1/1/0001 12:00:00 AM', 'TimeSeries': u'False', 'Version': u'202', 'XAxisColumn': u'-1', 'XAxisReverse': u'False', 'YAxisColumn': u'-1', 'YAxisReverse': u'False', 'ZAxisColumn': u'-1', 'ZAxisReverse': u'False'}