Skip to content

Instantly share code, notes, and snippets.

View ppearson's full-sized avatar

Peter Pearson ppearson

View GitHub Profile
"""
A Python script to use gdal_translate to download VIIRS visibile satellite imagery
for the entire world (in TIFF tiled format), getting the daily composite of daytime
(noon I think?) for each day requested.
A python re-write (with multiprocess threading ability and tweaks to ignored return HTTP codes)
of the bash script provided here: https://hannes.enjoys.it/blog/2021/01/satellite-composite-of-earth-2020/
"""
@ppearson
ppearson / compiler_benchmarks_v2.txt
Last active October 15, 2017 07:07
Compiler Benchmarks v2
Machine:
--------
Dual socket Intel Xeon E5-2643 (SB), 4 physical cores per proc. 8 logical (with hyperthreading). 3.3 GHz.
Ubuntu 16.04, Kernel 4.4.0.
Compilers:
----------
g++ 4.8.5 (Ubuntu package)
@ppearson
ppearson / namespace.py
Last active June 28, 2017 04:44
Namespace inserter
# Python util to add namespace item to a C++ codebase
# Note: does not cope with platform specific #define blocks
import os
basePath = ""
def getListOfFiles(path, extensionMatch):
listOfFiles = []
for root, dirnames, filenames in os.walk(path):
#!/usr/bin/env python
"""\
deheader -- find (optionally remove) unneeded includes in C or C++ sourcefiles.
Usage: deheader [-h] [-i pattern] [-m cmd] [-q] [-r] [-x pattern] [-v] [file...]
-h, --help Emit this help message and quit.
-m, --maker Set the build command (by default 'make')
-i, --ignore Ignore (don't remove) headers matching the argument regexp
-q, --quiet Suppress statistical summary
-r, --remove Remove the final set of unneeded headers
@ppearson
ppearson / compiler_benchmarks.txt
Created December 14, 2014 17:54
Compiler Benchmark Raw numbers
Scene1: CornellBox room (fully-enclosed, with front wall invisible to camera rays), with two area
lights, and Stanford dragon (1M tris) with SSS material and Robot (1.6M tris) with metal material
and car paint material (both microfacet). Using full brute-force multiple-scattering volumetric rendering for SSS with MIS,
two light samples. Max path length 5, diffuse/spec depth 4. 512x512, 128 SPP, MN
Scene2: Anisotropic metal plane (with procedural simplex noise bump texture), voxel volume (67x46x66, trilinear
interpolation) with dense grids for density and temperature with a (pretty bad) blackbody shader
for the emission, toy train (17K tris) with
8-bit image textures for diffuse, spec colour and bump, and RC helicopter (807K tris) with metal, rough
and smooth plastic materials, with quaternion interpolation motion-blur on the rotor blades, multiple
@ppearson
ppearson / nuke.py
Created April 8, 2014 13:34
Nuke config stuff
## add stuff to menu and tab menu
toolbar = nuke.toolbar("Nodes")
colorMenu = toolbar.findItem('Color')
colorMenu.addCommand('Compare')
@ppearson
ppearson / ImagineRenderIop
Last active November 26, 2021 07:54
ImagineRender_Iop
/*
Imagine
Copyright 2011 Peter Pearson.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@ppearson
ppearson / gist:167061
Created August 13, 2009 09:26
apache module
#include <stdio.h>
#include <string.h>
#include "apr.h"
#include "apr_file_io.h"
#include "apr_strings.h"
#include "apr_lib.h"
#define APR_WANT_STRFUNC
#include "apr_want.h"
@ppearson
ppearson / gist:52774
Created January 26, 2009 10:18
Python NMEA to GPX converter script
# NMEA to GPX converter
# Peter Pearson
# version 0.11
import csv
import sys
import time
from time import strftime
def convert_dms_to_dec(value, dir):