Skip to content

Instantly share code, notes, and snippets.

@vhaasteren
vhaasteren / mockpulsar.py
Last active April 27, 2023 07:48
Create Enterprise mock pulsars
"""
For simulations one often needs to read in par/tim files. But on some machines
it is hard to install PINT or tempo2/libstempo. And reading in par/tim files is
a bit slow, especially when reading in lots of them. Here we allow use of
Enterprise with mock pulsar.
Generate some mock par files like so:
def example_usage():
import mockpulsar, os
npsrs = 100
@vhaasteren
vhaasteren / CholeskyWrapper.h
Created February 14, 2024 18:29
Cholesky Decomposition on Metal
// CholeskyWrapper.h
#import <Foundation/Foundation.h>
@interface CholeskyWrapper : NSObject
- (void)performCholeskyDecompositionWithMatrix:(float *)matrix size:(NSUInteger)size;
@end
@vhaasteren
vhaasteren / gist:1fb63796fcd3cc813a9a00b05af80bf4
Last active March 7, 2024 16:12
Fast bulk interpolation using a CUDA and Apple Metal
#!/usr/bin/python
# -*- coding: utf-8 -*-
# vim: tabstop=4:softtabstop=4:shiftwidth=4:expandtab
"""
cuda_interpolation: Fast bulk interpolation using numpy, cuda, and cupy
author: Rutger van Haasteren
email: rutger@vhaasteren.com
date: March, 2024