Skip to content

Instantly share code, notes, and snippets.

View michaelaye's full-sized avatar

Michael Aye michaelaye

View GitHub Profile
@michaelaye
michaelaye / spice_bug.py
Created July 10, 2011 18:42
Example script to show return problem of PySPICE
from spice import *
furnsh('mars.mk')
utc = '2006 JAN 30 12:00:00.000'
et = utc2et(utc)
print et
@michaelaye
michaelaye / mars.mk
Created July 10, 2011 18:43
Meta kernel to load required kernels
\begindata
KERNELS_TO_LOAD = (
'/Users/aye/Data/spice/mars/naif0009.tls'
'/Users/aye/Data/spice/mars/mars_iau2000_v0.tpc'
'/Users/aye/Data/spice/mars/mar063.bsp'
'/Users/aye/Data/spice/mars/mgs_ext22.bsp'
)
\begintext
@michaelaye
michaelaye / gist:4016025
Created November 5, 2012 08:31
pandas parsing bug?
import pandas
from StringIO import StringIO
s = '"09-Apr-2012", "01:10:18.300", 2456026.548822908, 12849, 1.00361, 1.12551, 330.65659, 0355626618.16711, 73.48821, 314.11625, 1917.09447, 179.71425, 80.000, 240.000, -350, 70.06056, 344.98370, 1, 1, -0.689265, -0.692787, 0.212036, 14.7674, 41.605, -9999.0, -9999.0, -9999.0, -9999.0, -9999.0, -9999.0, 000, 012, 128'
sfile = StringIO(s)
# it's 33 columns
pandas.io.parsers.read_csv(sfile, names=range(33), na_values=['-9999.0'])[29]
@michaelaye
michaelaye / vpy_illum_angles.py
Created January 23, 2013 18:58
Visual python file to show some illumination angles of planetary observations.
#!/Library/Frameworks/Python.framework/Versions/2.7/bin/python
from visual import *
scene = display(title='Illumination angles', x=200, y=200, width=600, height=600)
scene.forward = (0, 1,-1)
scene.range=60
scene.up = (0,0,1)
plane = box(pos = (0,0,0),length=100,height=100,width=0.1,
opacity=0.5,color=color.orange)
<?xml version="1.0"?>
<root>
<deviceproductdef>
<productname>APPLE_INTERNAL_KEYBOARD_TRACKPAD_0x024c</productname>
<productid>0x024c</productid>
</deviceproductdef>
<deviceproductdef>
<productname>APPLE_WIRELESS_KEYBOARD_0x22c</productname>
<productid>0x22c</productid>
</deviceproductdef>
@michaelaye
michaelaye / phase_function_table.ipynb
Created March 5, 2013 07:40
Working with the phase function table with pandas.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@michaelaye
michaelaye / file_utils.py
Last active December 19, 2015 08:29
little class to manage my filename needs to manage data-files that start with a timestr. Pretty handy to have something like this
import os
from datetime import datetime as dt
class FileName(object):
"""Managing class for file name attributes """
def __init__(self, fname):
super(FileName, self).__init__()
self.basename = os.path.basename(fname)
self.dirname = os.path.dirname(fname)