Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ajdawson
ajdawson / ssh_process.ml
Created October 24, 2016 19:57
Communicating with an ssh process in OCaml
let output_command channel cmd = output_string channel (cmd ^ "\n")
let do_ssh_hostname () =
let oc_in, oc_out = Unix.open_process "ssh -T hostname" in
output_command oc_out "hostname";
flush oc_out;
try
Printf.printf "%s\n" (input_line oc_in)
with
End_of_file -> ();
@ajdawson
ajdawson / lcc_corners.ipynb
Created May 16, 2016 10:49
Map extent for an LCC projection
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ajdawson
ajdawson / concatenation_dim_order_issue
Created June 18, 2015 09:07
Notes on concatenation issue
{
"metadata": {
"name": "",
"signature": "sha256:9221e598320abd5d421920f5f48638d6bb36f9a03f5f437d516a11ccd5476f17"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@ajdawson
ajdawson / smooth9.ipynb
Last active August 29, 2015 14:19
Very basic 9-point smoothing using rolling_window()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ajdawson
ajdawson / cartopy_inclusion.ipynb
Created April 21, 2015 08:16
Testing if a point is in a plot domain.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ajdawson
ajdawson / LambertConformalTicks.ipynb
Last active June 7, 2022 13:47
Adding gridline labels to a cartopy Lambert Conformal projection plot
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ajdawson
ajdawson / nps.ipynb
Created February 16, 2015 09:04
North Polar Stereographic Extents
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ajdawson
ajdawson / gauss_grid.py
Created January 21, 2015 14:04
Gaussian grid generation.
"""Tools for working with Gaussian grids."""
from __future__ import (absolute_import, division, print_function)
import functools
import numpy as np
import numpy.linalg as la
from numpy.polynomial.legendre import legcompanion, legder, legval
@ajdawson
ajdawson / udunits2_test.c
Created October 10, 2014 08:03
Test program for UDUNITS2
#include <stdio.h>
#include <udunits2.h>
int main(int argc, char *argv[])
{
ut_system* unitSystem = ut_read_xml(NULL);
ut_unit *unit0, *unit1, *unit2;
char unit0_str[128], unit1_str[128], unit2_str[128];
unsigned format_opts = UT_ASCII;