Skip to content

Instantly share code, notes, and snippets.

View restrepo's full-sized avatar

Diego Restrepo restrepo

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env bash
SARAH_VERSION=4.13.0
wget http://www.hepforge.org/archive/sarah/SARAH-${SARAH_VERSION}.tar.gz
tar zxf SARAH-${SARAH_VERSION}.tar.gz
ln -s SARAH-${SARAH_VERSION} SARAH
wget http://www.hepforge.org/archive/spheno/SPheno-4.0.3.tar.gz
tar zxf SPheno-4.0.3.tar.gz
ln -s SPheno-4.0.3 SPHENO
sed -ri 's/(^F90\s*=\s*)ifort/\1gfortran/' SPHENO/Makefile
#!/usr/bin/env bash
# Based on: https://answers.launchpad.net/mg5amcnlo/+question/271396
# Also works with http://home.thep.lu.se/~torbjorn/pythia8/pythia8219.tgz which allows to install madevent
PYTHIA_VERSION=8219 #8212
echo "========= STEP 1: install MadGraph============"
wget https://launchpad.net/mg5amcnlo/2.0/2.6.x/+download/MG5_aMC_v2.6.2.tar.gz
tar zxf MG5_aMC_v2.6.2.tar.gz
echo "========= STEP 2: install hepmc with MadGraph============"
import numpy as np
def neutrino_data():
'''From arxiv:1405.7540 (table I)
and asumming a Normal Hierarchy:
Output:
mnu1in: laightest neutrino mass
Dms2: \Delta m^2_{12}
Dma2: \Delta m^2_{13}
ThetSol,ThetAtm,ThetRec: in radians
'''
@restrepo
restrepo / master2single.py
Created December 4, 2012 18:18
Convert a LaTeX master file into a flatten LaTeX with all the files included
#!/usr/bin/env python
"""Convert a master latex file,
into a single document by including
automatically all the LaTeX documents
which are arguments of
\include or \input
ignoring any \includeonly
"""
import sys
if len(sys.argv)==3:
@restrepo
restrepo / Least Action
Created May 16, 2014 19:21
Least Action
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@restrepo
restrepo / doi.ipynb
Created August 28, 2017 14:27
doi api examples
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.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def Fme(x,xmin=0.996,xmax=1.005,xfit=1.001):
"""Fixing near to one values
xmin: close to 1 from below
xmax: close to 1 from above
xfit: optimized 1 limit
"""
x=np.asarray(x)
if x.shape:
x[np.logical_and(x>xmin,x<xmax)]=xfit
else: