Skip to content

Instantly share code, notes, and snippets.

View wgaylord's full-sized avatar

William Gaylord wgaylord

View GitHub Profile
import numpy as np
import pylab as plt
import ephem
import datetime
# Setup lat long of telescope
oxford = ephem.Observer()
oxford.lat =np.deg2rad(41.840)
oxford.long = np.deg2rad(-87.640)
oxford.date = ephem.Date('2018/01/01 11:33:00.00')
# Load Satellite TLE data.
import numpy as np
import pylab as plt
import ephem
import datetime
# Setup lat long of telescope
oxford = ephem.Observer()
oxford.lat =41.840
oxford.long = -87.640
oxford.date = datetime.datetime.now()
# Load Satellite TLE data.
import logging
import requests
import lxml.html
import sys
sat = "40014" #SAT norrad_cat_id
transmitter = "NSXo8tGxmxpTUMsmSH34FF" #Transmitter UUID
start="2017-12-1 17:00" #Start date and time
end="2017-12-2 03:00" #Stop date and time
from objc_util import *
import time
import threading
C = ObjCClass
def take_photo_now(filename='photo.jpg'):
session = C('AVCaptureSession').new().autorelease()
session.sessionPreset = 'AVCaptureSessionPresetPhoto'
device = C('AVCaptureDevice').defaultDeviceWithMediaType_('vide')
device_input = C('AVCaptureDeviceInput').deviceInputWithDevice_error_(device, None)
@wgaylord
wgaylord / gist:b9408cbfbfe030509647a5b10bcd910f
Created May 10, 2017 16:07 — forked from ebuckley/gist:1842461
python code to encode/decode morse code
morseAlphabet ={
"A" : ".-",
"B" : "-...",
"C" : "-.-.",
"D" : "-..",
"E" : ".",
"F" : "..-.",
"G" : "--.",
"H" : "....",
"I" : "..",
@wgaylord
wgaylord / ImageMaker.py
Created April 24, 2017 20:28
ImageMaker.py
from PIL import Image
def fix(pixel,d):
r =pixel[0]
g=pixel[1]
b=pixel[2]
factor=d/((r+b+g)/4.0)
return (int(r*factor),int(g*factor),int(b*factor))
def make(bw,color,size,scale):
@wgaylord
wgaylord / input.json
Last active April 4, 2017 23:50 — forked from hansihe/input.json
{
"types": {
"u8": ["native", {
"type": "integer"
}],
"test": ["container", {
"virtual": true,
"fields": [
{
"name": "tag",
------------------------------------------------------------
C:\Python27\Scripts\pip run on 09/14/16 12:31:52
Downloading/unpacking Pillow
Getting page https://pypi.python.org/simple/Pillow/
URLs to search for versions for Pillow:
* https://pypi.python.org/simple/Pillow/
Analyzing links from page https://pypi.python.org/simple/pillow/
Skipping link https://pypi.python.org/packages/00/15/e776f42afb6d79f27710aded08fd50998174f772621f1cda5d44701be1ed/Pillow-2.1.0-py2.6-win32.egg#md5=0a85404ffb50fff762615a47e6d363e9 (from https://pypi.python.org/simple/pillow/); unknown archive format: .egg
Skipping link https://pypi.python.org/packages/00/5a/1807a6341c47d04211ae71e2bdf339ef42bea99429d0fc5f61cf7f57d53d/Pillow-2.8.0-py2.7-win-amd64.egg#md5=48a7745755452bd606d86f951782258b (from https://pypi.python.org/simple/pillow/); unknown archive format: .egg
Skipping https://pypi.python.org/packages/00/8b/855afd7da1bb8ec8fb02886834ebb37b766e9ecbc6abe000ae7960ddcaf5/Pillow-2.8.1-cp34-cp34m-macosx_10_6_intel.
# coding: utf-8
import urllib
import shutil
import zipfile
from jawa import ClassFile
import hashlib
import jawa
import json
import os
import sys
@wgaylord
wgaylord / get_available_memory.py
Created May 22, 2016 15:32 — forked from lukaskollmer/get_available_memory.py
Get memory stats in Pythonista using ctypes
#!/usr/bin/env python3
from ctypes import *
from objc_util import ObjCClass
NSProcessInfo = ObjCClass('NSProcessInfo')
NSByteCountFormatter = ObjCClass('NSByteCountFormatter')
class c_vm_statistics(Structure):
_fields_ = [('free_count', c_uint),
('active_count', c_uint),