Skip to content

Instantly share code, notes, and snippets.

View kbarbary's full-sized avatar

Kyle Barbary kbarbary

View GitHub Profile
@kbarbary
kbarbary / performance.py
Created June 3, 2012 17:34 — forked from astrofrog/performance.py
photutils performance
import time
import numpy as np
import photutils
from collections import OrderedDict
c = OrderedDict()
name = "Small data, single small aperture"
c[name] = {}
@kbarbary
kbarbary / animate_source.py
Last active November 14, 2016 03:45
animate_source function for sncosmo
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Animate one or more sncosmo Source spectral time series."""
from __future__ import division
import math
import numpy as np
from astropy.utils.misc import isiterable
from astropy.extern import six
@kbarbary
kbarbary / sncosmo-fitting-example.ipynb
Created August 1, 2013 03:02
sncosmo fitting example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"metadata": {
"name": "Introduction"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@kbarbary
kbarbary / simulation.py
Created October 15, 2013 16:30
sncosmo simulation function example. This is just a preliminary working function that simulates SN data.
"""Tools for simulation of transients."""
import sys
import math
from copy import deepcopy
import numpy as np
from scipy.interpolate import InterpolatedUnivariateSpline as Spline1d
from astropy.table import Table
from astropy import cosmology
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kbarbary
kbarbary / sample-and-plot.ipynb
Created December 9, 2013 22:15
sncosmo lightcurve MCMC example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kbarbary
kbarbary / sncosmo-demo-0.4.ipynb
Created May 16, 2014 15:04
SNCosmo v0.4 demo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kbarbary
kbarbary / fitsio-hdu-types.ipynb
Created May 25, 2014 20:08
FITSIO HDU types demo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kbarbary
kbarbary / sn-cosmology-pgm.py
Created October 13, 2014 21:18
Daft script for SN cosmology PGM
#!/usr/bin/env python
from matplotlib import rc
from daft import PGM, Node, Plate
rc("font", family="serif", size=12)
rc("text", usetex=True)
pgm = PGM([7.0, 4.2], origin=[0.5, 0.2], observed_style='inner')