Skip to content

Instantly share code, notes, and snippets.

View jrs65's full-sized avatar

Richard Shaw jrs65

View GitHub Profile
@jrs65
jrs65 / test_ph5.c
Last active April 30, 2020 14:43
Fixed incorrect comments.
#include <stdlib.h>
#include <stdio.h>
#include "hdf5.h"
#define _MPI
#define _DSET2
//#define _COMPRESS
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
---
type: config
log_level: info
num_elements: 6
num_local_freq: 1
udp_packet_size: 4928
num_data_sets: 1
samples_per_data_set: 32768
buffer_depth: 4
num_gpu_frames: 128
@jrs65
jrs65 / getdiagonal.py
Created June 27, 2014 16:22
Return a (writable) view of a specified diagonal of a numpy matrix (must be 2D, but need not be square)
import numpy as np
def get_diagonal(A, k):
"""Get matrix diagonal.
Parameters
----------
A : np.ndarray[:,:]
Array to get diagonal of.
k : integer
@jrs65
jrs65 / _worksht.py
Last active December 18, 2015 14:09
Healpy SHT non-determinism
import sys
import numpy as np
import healpy
prefix = sys.argv[1]
nside = 128
np.random.seed(1)