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 os | |
| import urllib | |
| import string | |
| URL = "http://sma1.sma.hawaii.edu/beamcalc.html" | |
| VALID_SIDEBANDS = ['lower', 'upper'] | |
| VALID_PWVS = [0.2, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0] |
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 atpy | |
| import numpy as np | |
| def join(table1, table2): | |
| # Check that primary key is set in Table 1 | |
| if table1._primary_key is None: | |
| raise Exception("Primary key of table 1 has to be set") |
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
| diff --git a/wrappers/python/setup.py b/wrappers/python/setup.py | |
| index 7907702..8fdfee0 100755 | |
| --- a/wrappers/python/setup.py | |
| +++ b/wrappers/python/setup.py | |
| @@ -5,11 +5,14 @@ from Cython.Distutils import build_ext | |
| ext_modules = [Extension("freenect", ["freenect.pyx"], | |
| libraries=['usb-1.0', 'freenect', 'freenect_sync'], | |
| - runtime_library_dirs=['/usr/local/lib', '/usr/local/lib64', '/usr/lib/'], | |
| + runtime_library_dirs=['/usr/local/lib', '/usr/lib/', '/opt/local/lib'], |
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
| def pnpoly(vx, vy, x, y): | |
| ''' | |
| Check if a point (x,y) is inside a polygon (vx, vy) | |
| Polygon vertices have to be given as Numpy arrays | |
| ''' | |
| xi = vx | |
| xj = np.roll(vx, 1) | |
| yi = vy | |
| yj = np.roll(vy, 1) | |
| c = ((yi > y) != (yj > y)) & (x < (xj - xi) * (y - yi) / (yj - yi) + xi) |
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 | |
| import numpy.ma as ma | |
| import matplotlib.pyplot as plt | |
| import matplotlib.colors as colors | |
| def make_colormap(color): | |
| r, g, b = colors.colorConverter.to_rgb(color) |
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 string | |
| import urllib | |
| from xml.etree.ElementTree import ElementTree | |
| from StringIO import StringIO | |
| search_author = "Goodman, A." | |
| base_url = '''http://adsabs.harvard.edu/cgi-bin/nph-abs_connect?db_key=AST&''' | |
| parameters = {} |
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
| class log_to_file(): | |
| def __init__(self, filename): | |
| self.f = open(filename, 'wb') | |
| def __enter__(self): | |
| self.stdout = sys.stdout | |
| self.stderr = sys.stderr | |
| sys.stdout = self.f | |
| sys.stderr = self.f |
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 multiprocessing as mp | |
| import numpy as np | |
| import matplotlib | |
| matplotlib.use('Agg') | |
| import matplotlib.pyplot as plt | |
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
| # The following is Steven Bethard's functions to pickle methods - required to | |
| # use multiprocessing.Pool with model.run | |
| import copy_reg | |
| import types | |
| def _pickle_method(method): | |
| func_name = method.im_func.__name__ | |
| obj = method.im_self | |
| cls = method.im_class |
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
| Freezing version number to astropy/version.py | |
| running build_sphinx | |
| creating docs/_build | |
| creating docs/_build/doctrees | |
| creating docs/_build/html | |
| running build | |
| running build_py | |
| creating build/lib.macosx-10.6-x86_64-2.7 | |
| creating build/lib.macosx-10.6-x86_64-2.7/astropy | |
| copying astropy/__init__.py -> build/lib.macosx-10.6-x86_64-2.7/astropy |