Skip to content

Instantly share code, notes, and snippets.

View The-Ludwig's full-sized avatar

Ludwig Neste The-Ludwig

View GitHub Profile
@The-Ludwig
The-Ludwig / read_lst.py
Created May 12, 2026 13:32
Read in ".lst" (ASCII) files produced by the Toucan 8 software.
import numpy as np
import re
from numpy.typing import ArrayLike
from pathlib import Path
from typing import Tuple
def read_data(filename: str | Path, truncate: bool = True) -> Tuple[float, ArrayLike, ArrayLike]:
"""
Read in the ".lst" data from a text file produced by the toucan 8 software.
@The-Ludwig
The-Ludwig / bsplines.hpp
Last active February 6, 2023 20:31
Efficient BSplines in modern C++: Implemenation of an efficient algorithm to calculate the values of BSplines and their derivatives in modern C++ using `std::vector`. The function to get the BSpline values and their derivative are thoroughly documented.
/**
* @file bsplines.hpp
* @author Jan Ullmann & Ludwig Neste
* @brief Implemenation of an efficient algorithm to calculate the values of
* BSplines and their derivatives in modern C++ using `std::vector`.
* (C++ 17 required, compile with `-std=c++17`)
*
* The used algorithms are similar to and inspired by DeBoors algorithm
* (https://en.wikipedia.org/wiki/De_Boor%27s_algorithm), but distinct.
*