This file contains 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 __future__ import division, print_function, absolute_import | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib.patches import Arc | |
from matplotlib.collections import PatchCollection | |
__all__ = ['arcs'] | |
def arcs(x, y, w, h=None, rot=0.0, theta1=0.0, theta2=360.0, | |
c='b', vmin=None, vmax=None, **kwargs): |
This file contains 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.special import gammaincinv | |
def b(n): | |
# 2 * n - 1 / 3 + 4 / (405 * n) + 46 / (25515 * n**2) + 131 / (1148175 * n**3) | |
return gammaincinv(2 * n, 0.5) | |
def d(n): | |
# 3 * n - 1 / 3 + 8 / (1215 * n) + 184 / (229635 * n**2) + 1048 / (31000725 * n**3) | |
return gammaincinv(3 * n, 0.5) |
This file contains 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 numpy import pi, exp | |
from scipy.special import gamma, gammaincinv, gammainc | |
# Normalisation constant | |
def b(n): | |
return gammaincinv(2*n, 0.5) | |
# Total luminosity of a 2D Sérsic profile | |
def sersic_total_lum(Ie, re, n): | |
bn = b(n) |
This file contains 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
""" | |
A handy script for querying the new parsec website of padova isochrones. | |
author: syrte (http://github.com/syrte) | |
## Features | |
- Easy to use | |
- Flexibility | |
- Friendly error prompts | |
- Support latest also previous versions of parsec website |
This file contains 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 glob | |
import numpy as np | |
import healpy | |
from astropy.io import fits | |
LEVEL_HPIX = 12 | |
NSIDE_HPIX = 2**LEVEL_HPIX | |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
""" | |
Add exponentiated variance (EV) acquisition function to skopt. | |
Author: | |
Zhaozhou Li (lizz.astro@gmail.com) | |
""" | |
import numpy as np | |
import warnings | |
import skopt.acquisition |
This file contains 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 json | |
for file in sys.argv[1:]: | |
print('# file: %s' % file) | |
print('# vi: filetype=python') | |
print('') | |
code = json.load(open(file)) |
This file contains 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
""" | |
exec and load Zhao+2009 model | |
cf http://202.127.29.4/dhzhao/mandc.html | |
""" | |
import os | |
from astropy.io import ascii |
This file contains 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
# -*- coding:utf-8 -*- | |
from __future__ import division | |
from numpy import sqrt, exp, log, abs, diff, sin, cos, linspace, interp | |
from numpy import empty_like, atleast_1d, asarray | |
from numpy.testing import assert_almost_equal | |
from scipy.optimize import bisect as root | |
from numpy import e, pi | |
from scipy.integrate import romberg | |
mid = lambda x: (x[1:] + x[:-1]) / 2. |
NewerOlder