Skip to content

Instantly share code, notes, and snippets.

View rodluger's full-sized avatar
👽

Rodrigo Luger rodluger

👽
View GitHub Profile
@rodluger
rodluger / vplanet_workflow.md
Last active December 18, 2018 19:22
vplanet workflow

Working with a public repo and a private repo

We currently have a public vplanet repo and a private vplanet-private repo. Here's what we decided our workflow should look like:

All development is done on the (non-master) branches of vplanet-private and synced to master via pull requests. When a change is ready to be incorporated into the current released version of the code, we go to our local clone of the public vplanet repository and pull from master on vplanet-private to local dev. Then, on the GitHub UI, we issue a pull request for master on vplanet.

Setting up tracking on your local machine

@rodluger
rodluger / vplanet_migration.md
Last active June 20, 2018 15:18
Migrate from bitbucket to github

Migration to GitHub

Create the empty repo vplanet-dev on GitHub. Then, on your local machine, cd into the vplanet directory and run

git remote rename origin bitbucket
git remote add origin https://github.com/VirtualPlanetaryLaboratory/vplanet-dev.git
git push origin master
git remote rm bitbucket
@rodluger
rodluger / vplanet_bfg.md
Last active June 20, 2018 17:40
Removing large files from git history

Cleaning the vplanet repo

Most of what we need to know is here. First we download BFG and create the alias

alias bfg='java -jar bfg-1.13.0.jar'

Note that we need the latest version of the Java Runtime Environment installed.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rodluger
rodluger / degeneracies.py
Created September 19, 2020 16:39
Degeneracies in the light curve inversion problem for mapping stars and planets
import starry
import matplotlib.pyplot as plt
import numpy as np
from tqdm import tqdm
# Settings
starry.config.lazy = False
np.random.seed(12)
# Load a map of the earth
@rodluger
rodluger / brute-force-gp.py
Last active September 24, 2020 19:43
A brute-force implementation of a Gaussian process for stellar light curves
"""
A very simple / slow / inefficient / unstable implementation of a Gaussian
process for stellar light curves. We sample lots of surface maps from a
given distribution of spot sizes / locations / contrasts and compute the
empirical mean and covariance of the resulting distribution. In the limit
that our number of samples is infinite, this yields the meand and covariance
of the desired GP!
"""
import starry
import numpy as np
@rodluger
rodluger / SyntheticLikelihood.ipynb
Created October 27, 2020 19:22
A toy synthetic likelihood problem
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rodluger
rodluger / eigensolver.ipynb
Created February 21, 2021 21:52
Eigendecomposition trick for applying covariance matrix inverses w/ different white noise
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rodluger
rodluger / distributed_hack.py
Created June 2, 2021 23:10
Hack to allow importing `pymc3` without an internet connection
# Hack to allow importing `pymc3` without an internet connection
# This was fixed in https://github.com/dask/distributed/pull/3991
try:
import distributed
except Exception as e:
try:
import socket
getaddrinfo = socket.getaddrinfo
socket.getaddrinfo = lambda *args: [