Skip to content

Instantly share code, notes, and snippets.

View ellielinc's full-sized avatar

Elizabeth Lincoln ellielinc

View GitHub Profile
@ellielinc
ellielinc / ControlData.jl
Last active November 28, 2018 23:25
Generates temperature maps with manually chosen temperatures, sizes, and positions of star spots then writes the artificially observed flux and phase data into a file. Written for Julia 0.6.4. Repository ROTIR.jl by Fabien Baron has been updated for Julia 1.0.1 and will no longer be compatible with this script.
#Generate fake light-curve
include("lci.jl");
include("lciplot.jl");
include("geometry.jl");
include("oiplot.jl");
include("oistars.jl");
using PyPlot
using PyCall
using ROTIR.jl
@ellielinc
ellielinc / Errorbars.jl
Last active November 29, 2018 23:01
Uses multiple gridsearches to minimize the chi square of the best-fit diameter and limb darkening coefficient of a star with the linear visibililty function and generates errorbars for the best-fit parameters by calculating the probability density of those parameters.
function errorbar_LDlin_prob(data::OIdata,
dataname="", diam_min=1.0, diam_max=9.0, LD_min=0.01, LD_max=0.9, iter=200)
chisq=param->norm((abs2.(visibility_ldlin(param,data.v2_baseline))-data.v2)./data.v2_err).^2;
###taken from bic.jl in numericalmethods
function logsumexp(X)
# Compute log(sum(exp(X))) while avoiding numerical over/underflow.
return log(sum(exp.(X-maximum(X))))+maximum(X)
end