Loading
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
import pylab as pl | |
from scipy.misc import derivative | |
import inspect | |
def cramer_rao(model, p0, X, noise, show_plot=False): | |
"""Calulate inverse of the Fisher information matrix for model | |
sampled on grid X with parameters p0. Assumes samples are not | |
correlated and have equal variance noise^2. | |
Parameters |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
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
CC=clang++ | |
FLAGS= `root-config --cflags` -std=c++11 | |
LINK_FLAGS= `root-config --glibs` | |
DEPS = breedSFC.h | |
PROGRAMS = playground tests | |
PROGRAMS_OBJS = $(foreach X,$(PROGRAMS),$(X).o) | |
OBJS = breedSFC.o |
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
class careful_autoscale: | |
def __init__(self, ax=None): | |
self.ax = ax if ax else gca() | |
def __enter__(self): | |
self.xl = self.ax.get_xlim() | |
self.yl = self.ax.get_ylim() | |
self.lines = self.ax.get_lines() | |
self.lines_visibility = [ l.get_visible() for l in self.lines ] | |
[ l.set_visible(False) for l in self.lines ] |
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
def brighten(color, v): | |
return np.array(matplotlib.colors.to_rgb(color)) ** (1 - v) |
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
# use color ANSI escape sequences on windows | |
if os.name == "nt": | |
import colorama | |
colorama.init() | |
def welcome(): | |
BLACK = "\033[0;30m" | |
RED = "\033[0;31m" | |
GREEN = "\033[0;32m" | |
YELLOW = "\033[0;33m" |
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 coloredlogs | |
import logging | |
if __name__=="__main__": | |
# only configure logging in the main program, everywhere else just import and use it | |
# set up logging | |
logfile_folder = "N:/data/log/" | |
logfile_date = datetime.datetime.now().strftime("%Y%m%d_%H%M%S") | |
logfile_filename = f"bunker5_{logfile_date}.log" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer