Skip to content

Instantly share code, notes, and snippets.

View ChrisBeaumont's full-sized avatar

Chris Beaumont ChrisBeaumont

View GitHub Profile
"""
This test module exercises the IPython qt import logic using pytest
It should be run with PyQt4 and PySide installed, as
py.test test_ipython_qt.py --boxed
It requires pytest and pytest-xdist
"""
from subprocess import check_output
@ChrisBeaumont
ChrisBeaumont / perseus_yt.py
Last active December 17, 2015 23:09
Rendering Perseus in yt
import numpy as np
import os
from yt.frontends.stream.api import load_uniform_grid
from yt.mods import ColorTransferFunction
from astropy.io import fits
from scipy.ndimage.measurements import label
from scipy.ndimage.morphology import binary_opening
def thresh(image, lo, hi):
@ChrisBeaumont
ChrisBeaumont / custom.css
Last active June 22, 2022 15:20
Demystifying Python Descriptors
<style>
@font-face {
font-family: "Computer Modern";
src: url('http://mirrors.ctan.org/fonts/cm-unicode/fonts/otf/cmunss.otf');
}
div.cell{
width:800px;
margin-left:16% !important;
margin-right:auto;
}
@ChrisBeaumont
ChrisBeaumont / segmentation.ipynb
Last active December 19, 2015 11:39
Blob segmentation with python scikit-image
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.
@ChrisBeaumont
ChrisBeaumont / _healpy_pixel_lib.log
Last active December 30, 2015 15:18
Healpy installation error logs
ldd /home/vagrant/anaconda/envs/test/lib/python2.7/site-packages/healpy/_healpy_pixel_lib.so
linux-vdso.so.1 => (0x00007fff28f0c000)
libpython2.7.so.1.0 => /usr/lib/libpython2.7.so.1.0 (0x00007f90f6243000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f90f5f43000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f90f5c46000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f90f5a30000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f90f5813000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f90f5452000)
libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007f90f51f4000)
libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007f90f4e19000)
@ChrisBeaumont
ChrisBeaumont / data.csv
Last active December 31, 2015 14:29
testing d3po<->glue mashattack
J-K Pixel Axis 0 World 0 H-K J-H Spectral Type EW NA EW Ca H2OK2 Index [Fe/H]
0.8120003 0 0 0.2609997 0.5510006 nan 4.1302047 2.5678225 0.8856874 -0.1703601
0.8410001 1 1 0.243 0.598 nan 4.4665532 2.2672496 0.8618297 -0.0832374
0.8839998 2 2 0.3260002 0.5579996 nan 5.9497361 3.4705281 0.8493133 0.1951554
0.835 3 3 0.2869997 0.5480003 nan 4.9369497 4.1303015 0.9326374 0.0237309
0.8550005 4 4 0.2890005 0.566 nan 4.7328906 2.0805767 0.8393655 -0.0205419
0.8449993 5 5 0.2779999 0.5669994 nan 5.9279079 3.9511623 0.8810213 0.1923087
0.8930001 6 6 0.296 0.5970001 nan 6.6394548 3.2767606 0.8216949 0.2658672
0.9359999 7 7 0.3309994 0.6050005 nan 6.119504 1.8434182 0.8068823 0.2160206
0.8599997 8 8 0.2539997 0.6059999 nan 6.1938062 3.6349468 0.8940281 0.2244418
@ChrisBeaumont
ChrisBeaumont / SciDB_afl.ipynb
Created March 7, 2014 20:01
scidbpy AFL Prototype
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ChrisBeaumont
ChrisBeaumont / toast_plank.py
Created March 18, 2014 15:58
Test Planck Toast
from toasty import toast, healpix_sampler, normalizer
from astropy.io import fits
import logging
#print progress
FORMAT = ' %(asctime)-15s %(message)s'
logging.basicConfig(format=FORMAT)
logger = logging.getLogger('toasty.tile')
logger.setLevel(logging.DEBUG)