Skip to content

Instantly share code, notes, and snippets.

@joezuntz
joezuntz / plot_im3shape_truth.py
Last active August 29, 2015 13:59
My script for plotting im3shape versus truth in the end-end test
import astropy.table
import numpy as np
import pylab
# Filenames
im3shape_cat = 'im3shape-end2end-v3.fits.gz'
truth_cat = 'end2end-truth.fits.gz'
match_cat = 'match.fits.gz'
#Load in data
@joezuntz
joezuntz / gist:4c791f9592d1798577da
Created November 14, 2014 14:12
Bayes Lecture 1 Medium Question Answer
{
"metadata": {
"kernelspec": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"display_name": "IPython (Python 2)",
"language": "python",
"name": "python2"
@joezuntz
joezuntz / lmc_cepheids.txt
Created December 4, 2014 12:58
LMC Cepheids
#ID w_magnitude log10_period
OGLE-LMC-CEP-0002 14.525 0.493892755239
OGLE-LMC-CEP-0005 13.4954 0.749122158504
OGLE-LMC-CEP-0012 14.5421 0.424912362695
OGLE-LMC-CEP-0016 12.033 1.02145626261
OGLE-LMC-CEP-0017 14.34215 0.565523888876
OGLE-LMC-CEP-0018 13.93705 0.60722468956
OGLE-LMC-CEP-0021 13.53005 0.737031510245
OGLE-LMC-CEP-0023 15.21055 0.23091500128
OGLE-LMC-CEP-0025 14.0813 0.5721161324
@joezuntz
joezuntz / extragalactic_cepheids.txt
Created December 4, 2014 13:00
Extragalactic Cepheids
#Cepheid Galaxy z log10_period w_magnitude
C5 NGC925 0.001845 1.686 20.7351
C6 NGC925 0.001845 1.635 21.887
C7 NGC925 0.001845 1.624 22.2274
C8 NGC925 0.001845 1.572 22.16795
C9 NGC925 0.001845 1.545 22.4966
C10 NGC925 0.001845 1.514 22.0534
C11 NGC925 0.001845 1.496 22.5698
C12 NGC925 0.001845 1.493 22.40305
C13 NGC925 0.001845 1.483 21.9409
@joezuntz
joezuntz / wz_distance_modulus
Created December 5, 2014 12:04
Distance Modulus w0+wz
{
"metadata": {
"kernelspec": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"display_name": "IPython (Python 2)",
"language": "python",
"name": "python2"
@joezuntz
joezuntz / valentine.py
Created February 14, 2015 18:41
A Short St. Valentine's Day Python Snippet
import pylab as pl
import numpy as np
Z=-1j*np.array([np.exp(1.j*2**i) for i in xrange(100)])
pl.plot(0.5*Z.real, Z.imag, '-', color='#FF69B4')
pl.show()
{
"metadata": {
"kernelspec": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"display_name": "IPython (Python 2)",
"language": "python",
"name": "python2"
@joezuntz
joezuntz / split_sdss_jpeg.py
Created May 24, 2011 13:40
Split an SDSS jpeg into component g,r,i filter images plotted in red,green,blue respectively
import PIL.Image
import matplotlib
matplotlib.use("Agg")
import numpy as np
import pylab as pl
def make_color_maps():
x=np.arange(0.,1.,0.01)
z=np.zeros_like(x)
R=list(zip(x,z,z))
@joezuntz
joezuntz / plot.py
Last active September 26, 2015 01:38
Short Python command-line plotting code
#!/usr/bin/env python
print "This script has been moved to https://github.com/joezuntz/plot"
@joezuntz
joezuntz / pymc-problem-am-db.py
Created March 1, 2012 11:24
Problem loading AdaptiveMetropolis sampler state from db
import os
import pymc
database_file = "mc.pickle"
number_samples = 1000
a = pymc.Normal("a",mu=0, tau=1)
b = pymc.Normal("b",mu=0, tau=1)
mu = a+b
c = pymc.Normal("c", mu=mu, tau=1, observed=True, value=0.5)