Skip to content

Instantly share code, notes, and snippets.

View restrepo's full-sized avatar

Diego Restrepo restrepo

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@restrepo
restrepo / doi.ipynb
Created August 28, 2017 14:27
doi api examples
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
'''
#!/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============"
#!/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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@restrepo
restrepo / h-index.py
Last active July 1, 2020 17:14
Simple formula to calculation of the h-index
def hIndex(citations):
"""
https://github.com/kamyu104/LeetCode/blob/master/Python/h-index.py
:type citations: List[int]
:rtype: int
# Given an array of citations (each citation is a non-negative integer)
# of a researcher, write a function to compute the researcher's h-index.
#
# According to the definition of h-index on Wikipedia:
@restrepo
restrepo / COCOVID-19.py
Created March 23, 2020 22:57
Datos oficiales COVID-19 Colombia de @MinSaludCol en https://infogram.com/covid-2019-ins-colombia-1hnq41zg9ord63z
import requests
import pandas as pd
r=requests.get('https://infogram.com/covid-2019-ins-colombia-1hnq41zg9ord63z')
head='"data":[[["ID de caso",'
tail=']]]'
js='{}{}{}'.format( head.split(':')[-1],
r.text.split(head)[-1].split(tail)[0],
tail
@restrepo
restrepo / COCOVID-19.ipynb
Last active March 23, 2020 23:07
Datos oficiales COVID-19 Colombia de @MinSaludCol en https://infogram.com/covid-2019-ins-colombia-1hnq41zg9ord63z
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@restrepo
restrepo / covid_lat.ipynb
Created March 25, 2020 21:57
covid_lat.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.