Skip to content

Instantly share code, notes, and snippets.

View mwtoews's full-sized avatar

Mike Taves mwtoews

View GitHub Profile
@mwtoews
mwtoews / heads_to_raster.py
Created September 29, 2022 00:25
MODFLOW Heads to raster
#!/usr/bin/env python3
r"""Convert MODFLOW Heads to raster file.
Examples
--------
$ python heads_to_raster.py \
--hds-fname ni_3_s4_2000.hds \
--out-fname ni_hds.tif \
--top-left 1492000.0 6234000.0 \
--resolution 2000.0 --projection EPSG:2193
@mwtoews
mwtoews / blend_text_array.py
Last active September 28, 2022 23:01
Blend two text arrays
#!/usr/bin/env python3
r"""Blend two text arrays.
Examples
--------
$ python blend_text_array.py \
--a1-fname si_3_s4_2000_orig.rch.dat \
--a2-fname topnet.rch_mean.dat \
--out-fname si_3_s4_2000.rch.dat
"""
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Check built-in super function to see if could be made better via PEP 3135.
Created on Sat Mar 20 21:23:36 2021
"""
import ast
import os
import git
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Slack filter by user.
Splits a single slack export into multiple exports, as viewed by
each user.
Created on Mon Jan 11 15:03:45 2021
@mwtoews
mwtoews / requirements.txt
Last active August 14, 2020 03:04
General Python requirements
gdal
numpy
ipython
pytest
rasterio
fiona
shapely
geopandas
scipy
pyproj
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Download pest++ binaries, and install them in ./bin
"""
import os
import requests
import sys
import urllib
@mwtoews
mwtoews / NZHydSoc_2019_Mike_Toews_abstract.pdf
Last active December 11, 2019 04:02
NZHS 2019 - Toews & Hemmings - A surface water network method for generalising streams and rapid groundwater model development
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
/**********************************************************************
*
* PostGIS - Spatial Types for PostgreSQL
* http://postgis.net
*
* PostGIS is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
@mwtoews
mwtoews / testlwrandom.c
Created January 31, 2019 10:28
test portability of PRNG
/**********************************************************************
*
* PostGIS - Spatial Types for PostgreSQL
* http://postgis.net
*
* PostGIS is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
@mwtoews
mwtoews / testlwrandom.out
Created January 31, 2019 10:26
output from testlwrandom.c
TEST10
R8_UNI computes pseudorandom values.
Two seeds, S1 and S2, are used.
R S1 S2
12345 34567
0.575025 493972830 1406600364
0.945577 390105768 506978341