Skip to content

Instantly share code, notes, and snippets.

View benjaminrose's full-sized avatar

Benjamin Rose benjaminrose

View GitHub Profile

Keybase proof

I hereby claim:

  • I am benjaminrose on github.
  • I am brose (https://keybase.io/brose) on keybase.
  • I have a public key whose fingerprint is 09FC E7D0 0CA1 377C A875 A53C 7D10 0876 030D 5508

To claim this, I am signing this object:

@benjaminrose
benjaminrose / sep.mask_ellipse vs matplotlib ellipse.ipynb
Created June 15, 2016 19:31
An example of how to use `sep.mask_ellipse` with `matplotlib.patches.Ellipse`.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@benjaminrose
benjaminrose / Understanding seps ellipical scaling.ipynb
Last active May 23, 2016 14:21
This was a notebook I made trying to understand `sep` and `Source Extractor`'s scaling of elliptical parameters.
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.
@benjaminrose
benjaminrose / save_data.py
Last active June 2, 2021 23:24
This is an useful example of how I like to save my data using numpy and savetxt.
import numpy as np
#create random data
data1 = np.random.rand(10)
data2 = np.random.rand(10)
data3 = np.random.rand(10)
#stack data into one ojbect
data_list = np.dstack((data1, data2, data3))
@benjaminrose
benjaminrose / ApJ-template.tex
Last active August 29, 2015 14:25
A templates for my latex documents
% \documentclass[apj, iop]{emulateapj}
% use for a preview of the final version
\documentclass[manuscript]{aastex}
%[manuscript] = defualt, and how you submit
%[preprint] = one-column, single-spaced document
%[preprint2] = double-column, single-spaced document
\usepackage{graphicx}% Include figure files
\usepackage{color}%for preprints
\usepackage{hyperref}
@benjaminrose
benjaminrose / AllSky.py
Created February 19, 2015 19:51
An example of using all sky projections in matplotlib.pyplot.
import matplotlib.pyplot as plt
import numpy as np #casue it rocks
# get random values to plot
#needs to be in radians from (-pi,pi) & (-pi/2, pi/2)
a = np.random.rand(100)*2*np.pi - np.pi
d = np.random.rand(100)*np.pi - np.pi/2
#todo(make values astropy.cooridnates and use wrap_at(180*u.degree). Allows for more varriable data.
#make figure
@benjaminrose
benjaminrose / scale_conversion.py
Created January 2, 2015 17:47
Convert [0,36-) to [-180,180)
'this still needs better testing, espcially to work with numpy'
'needs to work with degrees and radians'
def convert(x):
'x is a list, would like it to work with numpy'
ind = x>180
for i,j in enumerate(ind):
if j:
l[i]-=360
return x