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 pandas as pd | |
import numpy as np | |
# Reading file with circular elliptic cores | |
df = pd.read_csv("df_result_cg.csv") | |
df["dr_ratio"] = df["dr_obs"]/df["dr_true"] | |
df["phi_app"] = np.arctan(np.tan(df["fi"])/np.sin(df["theta"])) | |
# These are optional! | |
# This chooses only sources with models with equal number of components |
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.integrate import quad | |
from astropy.cosmology import LambdaCDM | |
# cm in pc | |
pc = 3.086 * 1E+18 | |
def beta(Gamma): | |
""" |
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 george | |
import emcee | |
import pickle | |
from functools import partial | |
import scipy.optimize as op | |
import matplotlib.pyplot as plt | |
from tqdm import tqdm | |
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 pickle | |
import numpy as np | |
from scipy.optimize import minimize | |
import celerite | |
from celerite import terms | |
import emcee | |
import matplotlib.pyplot as plt | |
# Ilya: We only need x, y, yerr 1D arrays. Substitute your's | |
with open("0716+714_umrao_lc.pkl", "rb") as fo: |
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 george | |
import pickle | |
from functools import partial | |
import scipy.optimize as op | |
import matplotlib.pyplot as plt | |
def is_embraced(curve, means, widths): | |
""" |
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 pickle | |
import numpy as np | |
import pymc3 as pm | |
import matplotlib.pyplot as plt | |
def fit_robustly(t, y, yerr, draws=500, chains=None, njobs=4, tune=500, | |
n_new=None, t_new=None, show_traceplot=False, | |
show_fitted_GP=True, file_fig=None, progressbar=True): | |
""" |
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
#!/bin/sh | |
# | |
# Build GCC with support for offloading to NVIDIA GPUs. | |
# | |
work_dir=$HOME/offload/wrk | |
install_dir=$HOME/offload/install | |
# Location of the installed CUDA toolkit |
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 | |
""" | |
Example of using Keras to implement a 1D convolutional neural network (CNN) for timeseries prediction. | |
""" | |
from __future__ import print_function, division | |
import numpy as np | |
from keras.layers import Convolution1D, Dense, MaxPooling1D, Flatten | |
from keras.models import Sequential |
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 | |
import seaborn | |
from keras.layers import Input, Dense, merge, ELU, Dropout | |
from keras.models import Model | |
from keras.regularizers import l2 | |
from keras import backend as K | |
from keras.optimizers import rmsprop, adam |
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.stats import gaussian_kde | |
def get_cdf_of_difference(data_1, data_2, diff_value=0): | |
data_1 = np.asarray(data_1) | |
data_2 = np.asarray(data_2) | |
kde_1 = gaussian_kde(data_1) | |
data_1.sort() | |
data_2.sort() |