Skip to content

Instantly share code, notes, and snippets.

View SuborbitalPigeon's full-sized avatar

Bruce Cowan SuborbitalPigeon

View GitHub Profile
class Probe:
required_string = ['type']
string = ['probe_manufacturer', 'probe_serial_number', 'probe_tag',
'wedge_manufacturer', 'wedge_serial_number', 'wedge_tag']
required_other = ['element_position', 'element_minor', 'element_major',
'element_shape', 'centre_frequency']
other = ['element_radius_of_curvature', 'element_axis_of_curvature',
'wedge_surface_point', 'wedge_surface_normal', 'dead_element',
'bandwidth']
@SuborbitalPigeon
SuborbitalPigeon / model.lua
Last active December 13, 2016 21:17
FEMM model for group A1
-- Useful functions
function average(a, b)
return (a + b) / 2
end
function get_x_y(radius, angle)
x = radius * cos(angle * (pi / 180))
y = radius * sin(angle * (pi / 180))
return x, y
end
from math import pi
from matplotlib import pyplot as plt
import pandas as pd
import seaborn as sns
A = pi/4 * 0.8**2 # Diameter: 800 mm
speeds = list(range(60, 270, 10))
altitudes = list(range(0, 45000, 1000))

Keybase proof

I hereby claim:

  • I am SuborbitalPigeon on github.
  • I am suborbitalpigeon (https://keybase.io/suborbitalpigeon) on keybase.
  • I have a public key whose fingerprint is 973E D580 A846 6D55 AA74 285B A0D0 4867 BBC3 4355

To claim this, I am signing this object:

from datetime import datetime
import json
import os
import subprocess
from sys import argv
dir = argv[1]
files = []
for dirpath, dirname, filenames in os.walk(dir):
@SuborbitalPigeon
SuborbitalPigeon / numpi.py
Last active August 29, 2015 14:09
Estimates pi using a Monte-Carlo method
import numpy as np
import numpy.random as random
iters = 10e6
# 1. The equation of the area of a unit circle is `ac = pi * 1^2 = pi'
# 2. The area of a 2x2 square is `as = 2^2 = 4'
# 3. The probability of a random point being in the circle is pi / 4
# 4. Given a random point, the point is in the circle if the point's
# radius from the centre is less or equal to 1
@SuborbitalPigeon
SuborbitalPigeon / rpn2.py
Last active August 29, 2015 14:08
Stack calculator
stack = []
def get_numbers():
stack.pop()
b = int(stack.pop())
a = int(stack.pop())
return (a, b)
while True:
val = input()
@SuborbitalPigeon
SuborbitalPigeon / simpson.js
Last active December 1, 2019 15:28
Simpson's rule using GTK+ via gjs
#!/usr/bin/gjs
const GObject = imports.gi.GObject;
const Gtk = imports.gi.Gtk;
const GtkSource = imports.gi.GtkSource;
const Pango = imports.gi.Pango;
var Simpson = GObject.registerClass(
class Simpson extends Gtk.Application
{
@SuborbitalPigeon
SuborbitalPigeon / web.js
Last active December 1, 2019 17:47
A web browser, in JavaScript.
#!/usr/bin/gjs
// TODO
// Proper actions
const Gio = imports.gi.Gio;
const GObject = imports.gi.GObject;
const Gtk = imports.gi.Gtk;
const WebKit2 = imports.gi.WebKit2;
@SuborbitalPigeon
SuborbitalPigeon / numbase.py
Last active October 12, 2015 07:07
Number to base
#!/usr/bin/env python
class Converter:
"""A bunch of converters"""
def __init__(self, number):
self.number = number
def to_base(self, digits):
# TODO: make the digits automatic and input the base instead
div = self.number