Skip to content

Instantly share code, notes, and snippets.

@Ogaday
Ogaday / README.md
Created February 2, 2026 20:28
Trichrome process

Here's my process using the free and open source image editor, GIMP (I'm using version 2.10)

  1. Launch GIMP
  2. Open your R/G/B/IR images: File > Open as layers / CTRL-ALT-O
  3. Optional: Add tags to your image layers: Right click layer > Color Tag > Choose R/G/B/Gray (IR)
  4. Set mode to grayscale: Image > Mode > Grayscale
  5. Align layers:
    • Disable layer visibility (press the eye) for each layer except the bottom one
    • For the next layer, make visible and, making sure the layer is selected, set mode > subtract.
  • Select the move tool and use your arrow keys to make sure the layer is aligned with the layer below.
@Ogaday
Ogaday / fit.ipynb
Created September 4, 2025 16:27
Example models
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Ogaday
Ogaday / default_params.py
Created July 17, 2025 17:29
Pyomo default parameters
"""Looking parameter defaults based on another parameter in Pyomo.
We have a model described as:
min sum(x * Y[s] for s in S)
Where Y[s] has a default value of x if not supplied.
"""
import pyomo.environ as pyo
"""Create all auto docstring doc files for mkdocs if using explicit mkdocs navigation."""
import os
from pathlib import Path
API_DOCS_PATH = Path("docs/api/")
def to_module(path: Path) -> str:
return ".".join(path.parts)
@Ogaday
Ogaday / Ipopt.md
Created March 24, 2025 15:22
Installing Ipopt

Installing Ipopt

https://coin-or.github.io/Ipopt/INSTALL.html

  • ASL is required to use Ipopt from Pyomo
  • I likely already had BLAS/LAPACK installed from other projects, I don't know if my libraries are optimised.
# Install dependencies
sudo apt-get install gcc g++ gfortran git patch wget pkg-config liblapack-dev libmetis-dev
@Ogaday
Ogaday / wsl_mount.md
Last active September 17, 2024 21:11
Mounting ext4 drives via WSL
# Admin windows powershell console
GET-CimInstance -query "SELECT * from Win32_DiskDrive"
wsl --mount \\.\PHYSICALDRIVE1 --bare
# WSL
lsblk -lf
sudo mkdir /media/My\ Passport
"""
Using piecewise transformations to overcome nonlinearity in storage asset optimisation.
"""
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pyomo.environ as pyo
from IPython.display import display
@Ogaday
Ogaday / compose.yaml
Last active March 6, 2024 13:54
Clickhouse in Docker
services:
warehouse:
image: clickhouse/clickhouse-server
ports:
- "8123:8123"
- "8443:8443"
- "9000:9000"
- "9440:9440"
healthcheck:
test: wget --no-verbose http://localhost:8123/
@Ogaday
Ogaday / class_logger_example.py
Created December 15, 2023 13:02
Class loggers
import logging
class Foo:
def __init__(self):
"""
>>> f = Foo()
>>> f.logger()
<Logger class_logger_example.Foo (WARNING)>
"""