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
| $ make html | |
| sphinx-build-2.7 -b html -d _build/doctrees . _build/html | |
| Making output directory... | |
| Running Sphinx v1.1.2 | |
| loading pickled environment... not yet created | |
| loading intersphinx inventory from http://docs.python.org/objects.inv... | |
| loading intersphinx inventory from http://docs.scipy.org/doc/scipy/reference/objects.inv... | |
| loading intersphinx inventory from http://docs.scipy.org/doc/numpy/objects.inv... | |
| loading intersphinx inventory from http://matplotlib.sourceforge.net/objects.inv... | |
| [autosummary] generating autosummary for: ascii/ascii_api.rst, ascii/base_classes.rst, ascii/fixed_width_gallery.rst, ascii/index.rst, ascii/read.rst, ascii/write.rst, configs.rst, development/building_packaging.rst, development/codeguide.rst, development/codeguide_emacs.rst, ..., wcs/api.rst, wcs/api_distortion.rst, wcs/api_sip.rst, wcs/api_units.rst, wcs/api_wcs.rst, wcs/api_wcsprm.rst, wcs/examples.rst, wcs/history.rst, wcs/index.rst, wcs/relax.rst |
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
| from astropy.config import messaging | |
| print '=' * 78 | |
| print "By default, only messages with level INFO and above are shown:" | |
| print '-' * 78 | |
| messaging.debug("Nothing much here") | |
| messaging.info("For information") | |
| messaging.warn("Be careful") | |
| messaging.error("Big time problem!") |
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 warnings | |
| from astropy.config import logger | |
| print '=' * 78 | |
| print "By default, only messages with level INFO and above are shown:" | |
| print '-' * 78 | |
| logger.debug("Nothing much here") | |
| logger.info("For information") |
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 matplotlib.pyplot as plt | |
| import numpy as np | |
| values = np.random.poisson(10., 100) | |
| s = plt.cm.ScalarMappable() | |
| s.set_clim(0., 20.) | |
| s.set_cmap(plt.cm.RdBu) | |
| s.set_array(values) |
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
| from scipy.optimize import curve_fit | |
| import numpy as np | |
| # Define images | |
| image1 = np.random.random((100, 200)) | |
| image2 = np.random.random((100, 200)) | |
| image3 = np.random.random((100, 200)) | |
| # Combine into a 3D cube |
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 merge_structured_arrays(array1, array2): | |
| n1 = len(array1) | |
| n2 = len(array2) | |
| array_out = array1.copy() | |
| array_out.resize(n1 + n2) | |
| array_out[n1:] = array2 | |
| return array_out |
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
| # How to interpolate values from scattered points onto a grid | |
| import numpy as np | |
| from scipy.interpolate import Rbf | |
| np.random.seed(2) | |
| # Generate fake data (replace with real data) | |
| N = 10 | |
| x = np.random.random(N) * 2. - 1. |
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 distance(ra1, dec1, ra2, dec2): | |
| return np.degrees(np.arccos(np.sin(np.radians(dec1)) | |
| * np.sin(np.radians(dec2)) | |
| + np.cos(np.radians(dec1)) | |
| * np.cos(np.radians(dec2)) | |
| * np.cos(np.radians(ra1) - np.radians(ra2)))) | |
| def distance_approx(ra1, dec1, ra2, dec2): |
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 time | |
| import numpy as np | |
| import photutils | |
| from collections import OrderedDict | |
| c = OrderedDict() | |
| name = "Small data, single small aperture" | |
| c[name] = {} |
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 cookielib,urllib2,urllib,htmllib,formatter,os,sys | |
| import pyfits | |
| from math import cos,radians | |
| import multiprocessing as mp | |
| import time | |
| class LinksExtractor(htmllib.HTMLParser): # derive new HTML parser | |
| def __init__(self, formatter) : # class constructor | |
| htmllib.HTMLParser.__init__(self, formatter) # base class constructor |