This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "metadata": { | |
| "kernelspec": { | |
| "codemirror_mode": { | |
| "name": "ipython", | |
| "version": 2 | |
| }, | |
| "display_name": "IPython (Python 2)", | |
| "language": "python", | |
| "name": "python2" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "metadata": { | |
| "kernelspec": { | |
| "codemirror_mode": { | |
| "name": "ipython", | |
| "version": 2 | |
| }, | |
| "display_name": "IPython (Python 2)", | |
| "language": "python", | |
| "name": "python2" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| def ascii_hist(x, bins): | |
| N,X = np.histogram(x, bins=bins) | |
| total = 1.0*len(x) | |
| width = 50 | |
| nmax = N.max() | |
| for (xi, n) in zip(X,N): | |
| bar = '#'*int(n*1.0*width/nmax) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import astropy.io.fits | |
| import astropy.table | |
| import astropy.io.registry | |
| class I3Table(astropy.table.Table): | |
| """ Im3shape table class. Same as a standard table except it supports | |
| attribute style column access ("table.e1") and does not try to print itself | |
| out when repr'd interactively. | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import sys | |
| import imp | |
| import os | |
| def edit_module(module_name): | |
| path = imp.find_module(module_name)[1] | |
| editor = os.environ.get("EDITOR", "emacs -nw") | |
| cmd = "{0} {1}".format(editor, path) | |
| os.system(cmd) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. make clean; make; run | |
| 2. check version control for changes you forgot you made | |
| 3. check exact command being run | |
| 4. check outputs are actually new | |
| 5. check inputs are actually what you expect. make plots | |
| 6. gdb --args "run_program with_args" | |
| run | |
| 7. valgrind run_program with_args |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| def simulate_schechter_distribution(self, alpha, L_star, L_min, N): | |
| """ | |
| Generate N samples from a Schechter distribution, which is like a gamma distribution | |
| but with a negative alpha parameter and cut off on the left somewhere above zero so that | |
| it converges. | |
| If you pass in stupid enough parameters then it will get stuck in a loop forever, and it | |
| will be all your own fault. |