Short and basic
Longer
http://nbviewer.ipython.org/github/jrjohansson/scientific-python-lectures/blob/master/Lecture-4-Matplotlib.ipynb http://www.labri.fr/perso/nrougier/teaching/matplotlib/
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8" .> | |
<title>g2</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link href="https://cdn.rawgit.com/jiffyclub/snakeviz/v0.4.0/snakeviz/static/snakeviz.css" rel="stylesheet"> | |
<!-- DataTables CSS --> | |
<link href="https://cdn.rawgit.com/jiffyclub/snakeviz/v0.4.0/snakeviz/static/vendor/jquery.dataTables.min.css" rel="stylesheet"> | |
</head> |
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8" .> | |
<title>tmppou4ttv_</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link href="https://cdn.rawgit.com/jiffyclub/snakeviz/v0.4.0/snakeviz/static/snakeviz.css" rel="stylesheet"> | |
<!-- DataTables CSS --> | |
<link href="https://cdn.rawgit.com/jiffyclub/snakeviz/v0.4.0/snakeviz/static/vendor/jquery.dataTables.min.css" rel="stylesheet"> | |
</head> |
import numpy, pylab, scipy | |
from scipy import optimize | |
# Uses MEANCLIP from above | |
from meanclip import meanclip | |
def msky(inarray, do_plot=0, verbose=0, ptitle='', func=0): | |
""" | |
Find modal sky on an array. |
import numpy | |
# Uses MEANCLIP from above | |
from meanclip import meanclip | |
def mytotal(inarray, axis, type='meanclip'): | |
""" | |
Collapse 2-D array in one dimension. | |
.. note:: MYTOTAL routine from ACS library. |
import numpy | |
def robust_sigma(in_y, zero=0): | |
""" | |
Calculate a resistant estimate of the dispersion of | |
a distribution. For an uncontaminated distribution, | |
this is identical to the standard deviation. | |
Use the median absolute deviation as the initial | |
estimate, then weight points using Tukey Biweight. |
""" | |
Simpler version of `PSF_GAUSSIAN` in IDL. | |
:Authors: Pey Lian Lim (Python) | |
:Organization: Space Telescope Science Institute | |
:History: | |
* 2010/08/17 PLL converted from IDL to Python. | |
""" | |
# External modules | |
import numpy |