Skip to content

Instantly share code, notes, and snippets.

@krischer
krischer / pandas.ipynb
Created March 25, 2013 11:26
Simple log analysis with Pandas
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@krischer
krischer / embarrassingly_parallel.py
Created June 21, 2015 09:38
Embarrassingly Parallel Code with MPI In Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Simple script illustrating how to perform embarrassingly parallel computations
in Python using MPI/mpi4py. I like this approach a lot as its very easy to get
right without having to deal with the complications arising from forked
processes which the multiprocessing module uses.
This script can be executed with or without `mpirun`; it will just run on one
core if not executed with it. With some more logic its also possible to make
@krischer
krischer / anna.ipynb
Last active May 4, 2023 08:42
anna.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@krischer
krischer / colormaps.ipynb
Created November 23, 2014 22:50
Perceptually Uniform Colormaps in Matplotlib
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@krischer
krischer / syngine_obspy.ipynb
Created November 26, 2015 14:56
Syngine with ObsPy
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@krischer
krischer / relative_calibration.ipynb
Last active March 15, 2019 22:27
Synthetic relative calibration example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@krischer
krischer / cSDL.pyx
Created December 5, 2012 21:49
Cython definition file for SDL 2.x
cdef extern from "i386/types.h" nogil:
ctypedef signed char int8_t
ctypedef short int16_t
ctypedef int int32_t
ctypedef long long int64_t
cdef extern from "iconv.h" nogil:
ctypedef void *iconv_t
cdef extern from "stdlib.h" nogil:
@krischer
krischer / index.html
Created April 20, 2013 20:03
Simple Rotating Globe
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<script>
// The size of the map.
var width = 960;
var height = 500;
@krischer
krischer / get_all_stations.py
Created April 5, 2017 21:01
Asynchronously download information about all stations worldwise and write them to a JSON file.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Requires Python >= 3.5, aiohttp, and pandas.
$ pip install aiohttp pandas
Upon running it will create a file 'networks_stations.json' which contains all
stations it could find across FDSN web service capable data centers. For each
station it contains the epochs and coordinates.
@krischer
krischer / CPUTempCollector.py
Created January 31, 2017 13:12
Custom Diamond Collectors
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Custom collector for
Requires PySensors.
:copyright:
Lion Krischer, 2017
:license: