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 joblib | |
| import os | |
| cachedir = 'cache' | |
| if not os.path.isdir(cachedir): os.mkdir(cachedir) | |
| mem = joblib.Memory(cachedir=cachedir, verbose=True) | |
| @mem.cache | |
| def my_long_function(i): | |
| return i + i |
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 sys | |
| import numpy as np | |
| def reformat_txt(inname, outname): | |
| """ | |
| Function that converts txt-file with dyn. spectra in format: | |
| https://www.dropbox.com/sh/l6kr87oxsxpg367/AACbXZNX4KU1KNEYWjphKbhoa/FRB010724/ascii_files?dl=0 | |
| #ch0 t1 value |
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 scipy.ndimage as ndimage | |
| # The array you gave above | |
| data = np.array( | |
| [ | |
| [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0], | |
| [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0], | |
| [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | |
| [0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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
| def delta_dm_max(nu_max, nu_min, dt): | |
| """ | |
| Return difference in DM that corresponds to arrival time shift between | |
| highest and lowest frequency channels equals to time resolution. | |
| :param nu_max: | |
| Frequency of highest frequency channel [MHz]. | |
| :param nu_min: | |
| Frequency of lowest frequency channel [MHz]. | |
| :param dt: |
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 emcee | |
| import numpy as np | |
| from scipy import stats | |
| try: | |
| import matplotlib.pyplot as plt | |
| except: | |
| plt = None | |
| vround = np.vectorize(round) |
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 | |
| from scipy import stats | |
| try: | |
| import matplotlib.pyplot as plt | |
| except: | |
| plt = None | |
| def posterior_trials(n_max, data, alpha, beta, delta=0.005): | |
| """ |
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 | |
| from scipy import stats | |
| from emcee import PTSampler, EnsembleSampler | |
| try: | |
| import matplotlib.pyplot as plt | |
| except: | |
| plt = None | |
| def lnlike_geom(p, y): |
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 numpy.fft import fft, ifft, fft2, ifft2, fftshift | |
| import numpy as np | |
| def fft_convolve2d(x,y): | |
| """ 2D convolution, using FFT""" | |
| fr = fft2(x) | |
| fr2 = fft2(np.flipud(np.fliplr(y))) | |
| m,n = fr.shape | |
| cc = np.real(ifft2(fr*fr2)) | |
| cc = np.roll(cc, -m/2+1,axis=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
| diff -r 96a023de3ddf make/sun/font/Makefile | |
| --- a/make/sun/font/Makefile Wed Jun 06 18:39:46 2012 -0700 | |
| +++ b/make/sun/font/Makefile Fri Jun 08 12:52:01 2012 +0900 | |
| @@ -128,7 +128,7 @@ | |
| ifeq ($(USING_SYSTEM_FT_LIB), false) | |
| FREETYPE_LIB = $(LIB_LOCATION)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX).6 | |
| endif | |
| - OTHER_LDLIBS += -L$(FREETYPE_LIB_PATH) -lfreetype | |
| + OTHER_LDLIBS += -L$(FREETYPE_LIB_PATH) -lfreetype -lfontconfig | |
| endif |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <scheme name="Solarized Dark" version="1" parent_scheme="Default"> | |
| <option name="LINE_SPACING" value="1.0" /> | |
| <option name="EDITOR_FONT_SIZE" value="14" /> | |
| <option name="EDITOR_FONT_NAME" value="Consolas" /> | |
| <colors> | |
| <option name="ADDED_LINES_COLOR" value="" /> | |
| <option name="ANNOTATIONS_COLOR" value="2b36" /> | |
| <option name="ANNOTATIONS_MERGED_COLOR" value="" /> | |
| <option name="CARET_COLOR" value="dc322f" /> |