Skip to content

Instantly share code, notes, and snippets.

View bamford's full-sized avatar

Steven Bamford bamford

View GitHub Profile
@bamford
bamford / gmm_tests.ipynb
Created January 28, 2021 09:38
Testing that the likelihood of a GMM doesn't depend on the number of components
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bamford
bamford / trello_json_to_toggl_csv.ipynb
Created January 4, 2021 10:21
Convert a Trello JSON export into a CSV file ready for importing into Toggl Plan
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bamford
bamford / gkgz_morph_env_new_test.ipynb
Last active December 16, 2020 20:00
gzgk_morph_env_new_test
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bamford
bamford / gkgz_morph_env.ipynb
Last active November 23, 2020 13:46
gzgk_morph_env
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bamford
bamford / gzgk_test.ipynb
Last active November 16, 2020 14:26
gzgk_test
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bamford
bamford / firstlook.ipynb
Created October 8, 2020 22:18
First look at GAMA MegaMorph
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bamford
bamford / sersic_profit_astropy_comparison.ipynb
Created April 22, 2020 16:18
Comparing Sérsic profiles by astropy and profit
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bamford
bamford / gillis12.ipynb
Created November 29, 2019 13:07
Reproducing preprocessing from Gillis (2012, Journal of Machine Learning Research, 13, 3349
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bamford
bamford / valid_function.py
Created October 16, 2019 12:47
Test whether a given function is a valid w(z)
from sympy import Symbol, sympify
def test(w):
"""Test if w is valid
Argument w should be a string expression containing the symbol z.
Returns True if w is real and positive, for all real and positive z, otherwise False.
Example:
@bamford
bamford / sersicint.py
Created July 29, 2019 10:42
Python functions to calculate the integral of a Sérsic profile
# Functions to calculate the integral of a Sérsic profile
# Sérsic profiles may be defined in various ways.
# Make sure you are using the correct quantities (e.g. not I0, mu_e, etc.)
# Ie : Intensity at the effective radius
# re : effective radius
# n : sersic index
# r : radius in same units as re
# Equations are taken from Graham and Driver (2005):