Skip to content

Instantly share code, notes, and snippets.

View aminnj's full-sized avatar

Nick Amin aminnj

  • Austin, TX
View GitHub Profile
@aminnj
aminnj / rgbpoly.ipynb
Created August 20, 2021 03:33
matplotlib color scale to rgb polynomial
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aminnj
aminnj / juliaremotedaemon.md
Created August 8, 2021 04:58
Remote DaemonMode with julia
@aminnj
aminnj / convert.md
Created July 28, 2021 01:33
ROOT tree from julia to python

Since writing out ROOT files is currently not possible with UnROOT, one can write out Arrow files directly from an UnROOT.LazyTree object which can be read back in julia. With some consideration of the chunking, this won't use much memory.

using UnROOT
using Arrow
using Tables

treename = "Events"
filename = "18BCCE71-15B8-194B-8738-EC993C8DD3BD.root"
@aminnj
aminnj / LorentzVectorPtEtaPhiM.ipynb
Last active July 26, 2021 04:40
julia fast lorentz vector (PtEtaPhiM)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aminnj
aminnj / pyhfcombine.ipynb
Last active June 9, 2021 19:24
pyhf combine comparison
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aminnj
aminnj / charwidths.js
Created June 9, 2021 02:34
arial character widths
var d1 = document.createElement("div");
d1.id = "test3";
d1.innerHTML = "test";
d1.style = "width: fit-content; padding: 0px; margin: 0px; font-family: Arial, sans-serif;";
document.documentElement.appendChild(d1);
var d2 = document.createElement("div");
d2.id = "test3";
document.documentElement.appendChild(d2);
@aminnj
aminnj / nanogentree.ipynb
Last active July 29, 2021 14:53
gen particle tree from nanoaod
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aminnj
aminnj / darklight.mplstyle
Last active May 28, 2021 01:36
matplotlib theme for github dark/light mode
axes.edgecolor: 707070
axes.formatter.limits: -5, 4
axes.formatter.use_mathtext: True
axes.labelcolor: 707070
axes.labelsize: x-large
axes.titlesize: large
axes.xmargin: 0.05
font.family: sans-serif
font.sans-serif: Helvetica, Arial, Liberation Sans, Bitstream Vera Sans, DejaVu Sans
hatch.linewidth: 0.5
@aminnj
aminnj / simplefit.py
Created May 22, 2021 19:15
minimal fitting function for python with error band drawing
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches
import matplotlib.lines
import matplotlib.legend
from scipy.optimize import curve_fit
from io import BytesIO
from tokenize import tokenize, NAME
@aminnj
aminnj / fillbetweenlegend.ipynb
Created May 22, 2021 05:18
incrementally add matplotlib legend entries for fillbetween + line
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.