Skip to content

Instantly share code, notes, and snippets.

View rsnemmen's full-sized avatar

Rodrigo Nemmen rsnemmen

View GitHub Profile
@rsnemmen
rsnemmen / sedplot.py
Created December 6, 2022 23:16
Module for creating pretty broadband SED plots
"""
Module containing the methods required to make a pretty SED plot.
This replaces the IDL scripts sedpars.pro and nmmn.sed.pro.
"""
import numpy, pylab, os, scipy
import astropy.io.ascii as ascii
import nmmn.sed,nmmn.lsd
#!/bin/sh
#
# Applies the given awk pattern matching to all specified files
# in current dir.
#
# ./awkBatch.sh <awk pattern> <extension>
#
# Example:
# ./awkBatch.sh /void/ c
# lists all instances of lines with "void" in *.c files in current dir.
@rsnemmen
rsnemmen / corona-evolucao.ipynb
Last active March 16, 2020 15:10
Jupyter notebook com analise simples da evolução do COVID-19 no Brasil
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rsnemmen
rsnemmen / save safari url to markdown.scpt
Created December 18, 2019 13:00
Apple script to save urls of all currently open safari tabs to markdown file
-- Set up the initial document
set output to (("List of open tabs in Safari" & linefeed as string) & "=======================" & linefeed as string) & linefeed as string
tell application "Safari"
-- Count the number of Windows
set numWindows to number of windows
repeat with w from 1 to numWindows
@rsnemmen
rsnemmen / save-url-safari-tabs.scpt
Last active April 2, 2022 22:07
Apple script to save the URLs of all currently open tabs in Safari to a text file
-- Set up the initial document
set output to ("List of open tabs in Safari" & linefeed as string) & "=======================" & linefeed as string
tell application "Safari"
-- Count the number of Windows
set numWindows to number of windows
repeat with w from 1 to numWindows
@rsnemmen
rsnemmen / colormaps.ipynb
Created November 1, 2019 12:35
Exploring different colormaps in matplotlib
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rsnemmen
rsnemmen / R censored data regression, upper limits, from Feigelson and Babu book.ipynb
Created September 1, 2019 21:44
Linear correlation coefficient in the presence of upper limits in astronomy using R
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rsnemmen
rsnemmen / install.sh
Last active August 12, 2019 13:06
Installation script for the supporting data files, Fermi LAT hands-on lesson by Nemmen & Cafardo
#!/bin/sh
# Create a new directory somewhere in your machine, let's say `fermi`:
mkdir fermi
cd fermi
echo "Created fermi dir"
echo
# Clone the repository with the lesson notebook.
git clone https://github.com/black-hole-group/fermipy-tutorial.git
echo "Downloaded lesson files from github"
@rsnemmen
rsnemmen / publication-quality-plots.ipynb
Created January 23, 2019 22:39
Jupyter notebook: creating publication quality plots with matplotlib
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rsnemmen
rsnemmen / copyStructArrayToDevice.cu
Created May 31, 2018 12:46
CUDA C program that illustrates how to transfer an array of structs to the GPU
/*
This example should illustrate how to transfer an array of
structs to the device with CUDA.
Inspired on https://stackoverflow.com/questions/43175162/copying-array-of-structs-from-host-to-device-cuda
*/
#include <stdio.h>
#define TPB 64