Skip to content

Instantly share code, notes, and snippets.

View perrette's full-sized avatar

Mahé Perrette perrette

View GitHub Profile
@perrette
perrette / 2015-06-22-first-attempt.ipynb
Created June 29, 2015 14:05
Tests mapping Greenland
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@perrette
perrette / Makefile
Last active December 18, 2015 17:24
Try out f90wrap module ! (https://github.com/jameskermode/f90wrap)
# requires: https://github.com/jameskermode/f90wrap
# basically this is a wrapper around f2py...:
# - the fortran code is rewritten by f90wrap into a f90wrap_module.f90
# so that there is no type defined (which are not supported by f2py break)
# - the same step also produces a python module that wraps the newly written f90wrap_module.f90 into fortran
# - compile the fortran wrapper with a few nice additions such as
# handling optional arguments, and defining the f90wrap_abort() function to raise an error in python
# without crashing the program...
# name of python module to be created
@perrette
perrette / Tutorial.ipynb
Last active January 1, 2016 15:49
Dimarray notebooks
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
gistup
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.
@perrette
perrette / catchment_basin.ipynb
Last active May 27, 2016 18:31
Catchment basin determination using Barnes' priority flood algorithm. Python bindings added at https://github.com/perrette/Barnes2013-Depressions
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@perrette
perrette / lib.f90
Last active June 3, 2017 08:04
conflict between fortran+iso_c_binding (via ctypes or cython) and matplotlib when reading namelist
module mylib
use iso_c_binding, only: c_double
implicit none
double precision :: g
contains
@perrette
perrette / concave_hull_and_smoothed_outline.ipynb
Created May 27, 2016 18:27
Draw concave hull of an outline with scipy and shapely. Also explore smoothing methods.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file has been truncated, but you can view the full file.
{"config": {"background": "#F1F4F4", "padding": 0, "view": {"continuousWidth": 600, "continuousHeight": 300, "strokeOpacity": 0}, "autosize": {"contains": "padding", "type": "fit-x"}, "title": {"font": "IBM Plex Sans", "fontsize": 16, "fontSize": 16}, "text": {"font": "IBM Plex Sans", "fontsize": 14}, "header": {"font": "IBM Plex Sans", "titleFont": "IBM Plex Sans", "titleFontSize": 20, "labelFont": "IBM Plex Sans", "labelFontSize": 18}, "axis": {"labelFont": "IBM Plex Sans", "titleFont": "IBM Plex Sans", "labelFontSize": 14, "titleFontSize": 16}, "mark": {"font": "IBM Plex Sans", "fontSize": 14}, "legend": {"labelFont": "IBM Plex Sans", "titleFont": "IBM Plex Sans", "labelFontSize": 14, "titleFontSize": 14}}, "vconcat": [{"layer": [{"data": {"url": "https://vega.github.io/vega-datasets/data/world-110m.json", "format": {"feature": "countries", "type": "topojson"}}, "mark": {"type": "geoshape", "fill": "lightgray", "stroke": "none"}, "height": 480, "projection": {"type": "naturalEarth1"}, "width": 800}, {"data