Skip to content

Instantly share code, notes, and snippets.

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# PSFEx Im3shape Example"
]
},
{
@joezuntz
joezuntz / im3shape-psfex-example.ipynb
Created July 12, 2016 16:23
im3shape psfex example
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joezuntz
joezuntz / extract_deliverables.py
Created October 12, 2015 12:38
Parser for the LSST DESC SRM
import glob
import re
import pyparsing as pp
import collections
def parse_projects(text):
#the list which will contain the located projects
projects = []
{
"metadata": {
"kernelspec": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"display_name": "IPython (Python 2)",
"language": "python",
"name": "python2"
@joezuntz
joezuntz / valentine.py
Created February 14, 2015 18:41
A Short St. Valentine's Day Python Snippet
import pylab as pl
import numpy as np
Z=-1j*np.array([np.exp(1.j*2**i) for i in xrange(100)])
pl.plot(0.5*Z.real, Z.imag, '-', color='#FF69B4')
pl.show()
@joezuntz
joezuntz / mpi4py_trivial.py
Created February 5, 2015 15:41
Simplest possible mpi4py job splitting
#Suppose you have a collection of tasks, which in this example I'll assume is just running a function f.
#If these tasks are completely separate and independent the most then you can parallelize them easily.
#In this gist I'll show the simplest possible way to do this using mpi4py.
#There are better ways to do this, in particular if the tasks vary significantly in time taken to run.
import mpi4py.MPI
def f(i):
"A fake task - in this case let just open a file and write a number to it"
#open file with name based on task number
@joezuntz
joezuntz / notes.md
Last active September 29, 2020 09:19
Notes on linking (work in progress)

Fixing problems when compiling programs

Most of us in science learn to write and build computer program in an ad-hoc way, copying bits of Makefile from other people, and using trial and error to change things.

That's fine when everything works, but when stuff starts to go wrong it's useful to have an idea of what different steps are happening during compilation, so you can figure out what's going wrong. In this post I'll talk at a a fairly high level about what happens when you compile code, and in a bit more detail about fixing problems you might see when you doing so.

Interpreted vs Compiled