Skip to content

Instantly share code, notes, and snippets.

View bamford's full-sized avatar

Steven Bamford bamford

View GitHub Profile
@bamford
bamford / madelung.ipynb
Last active June 26, 2018 11:07
Example of using numpy meshgrid to avoid nested loops
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bamford
bamford / julia.ipynb
Last active June 27, 2018 11:51
Fast visualisation of the Julia set in python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bamford
bamford / erf_mc_integration.ipynb
Created June 27, 2018 11:56
Estimating the error function via Monte Carlo integration
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bamford
bamford / MNIST.ipynb
Created September 11, 2018 09:13
Jupiter notebook for Steven Bamford's intro to Keras session at the Nottingham-Birmingham Machine Learning Applications for Astronomy workshop: https://www.nottingham.ac.uk/astronomy/workshop2018/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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):
@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 / gillis12.ipynb
Created November 29, 2019 13:07
Reproducing preprocessing from Gillis (2012, Journal of Machine Learning Research, 13, 3349
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
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
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.