Skip to content

Instantly share code, notes, and snippets.

View ChrisBeaumont's full-sized avatar

Chris Beaumont ChrisBeaumont

View GitHub Profile
"""
Load dendrograms into a Glue session
"""
from glue.core.data_factories import load_data
try:
# v>=0.5
from glue.core.data_factories.dendro_loader import load_dendro
from glue.core.data_factories.tables import astropy_tabular_data
except ImportError:
from glue import custom_viewer, qglue
from glue.clients.ds9norm import DS9Normalize
image = custom_viewer('image',
contrast=(0.0, 1.0),
image='att'
)
@image.plot_data
def draw(axes, image, contrast):
==786== Memcheck, a memory error detector
==786== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==786== Using Valgrind-3.11.0.SVN and LibVEX; rerun with -h for copyright info
==786== Command: /Users/cbeaumont/anaconda/bin/python test.py
==786== Parent PID: 445
==786==
--786-- /Users/cbeaumont/anaconda/bin/python:
--786-- dSYM directory is missing; consider using --dsymutil=yes
--786-- /Users/cbeaumont/anaconda/lib/libpython2.7.dylib:
--786-- dSYM directory is missing; consider using --dsymutil=yes
@ChrisBeaumont
ChrisBeaumont / arup_dups.sh
Created April 6, 2015 23:30
arup duplicates
In [40]: from collections import defaultdict
In [41]: data = defaultdict(list)
In [42]: for row in json.load(open('arup.json')):
data[getkey(row)].append(row)
....:
In [43]: for vals in data.values():
if not all(v == vals[0] for v in vals):
import numpy as np
from glue import custom_viewer, qglue
pcoord = custom_viewer('Parallele Coordinates')
def _plot_pcoords(axes, dataframe, **kwargs):
colnames = dataframe.columns
@ChrisBeaumont
ChrisBeaumont / word2vec.ipynb
Created March 13, 2015 16:00
word2vec examples
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
gene,transcript,is_default
APC,NM_001127510.2,False
APC,NM_001127511.2,False
APC,NM_000038.5,True
ATM,NM_000051.3,True
BARD1,NM_001282543.1,False
BARD1,NM_001282545.1,False
BARD1,NM_001282548.1,False
BARD1,NM_001282549.1,False
BARD1,NR_104212.1,False
@ChrisBeaumont
ChrisBeaumont / readme.md
Last active August 29, 2015 14:10
MOS demo

Demo for thinking about how to integrate lists of spectra with Glue.

Setup

This demo requires using the in-development "table" branch of GitHub. The best way to set this up is to install Glue in "development" mode:

Checkout glue source code from github:

git clone https://github.com/glue-viz/glue.git
@ChrisBeaumont
ChrisBeaumont / config.py
Last active August 29, 2015 14:10
Local moment maps
import shifted_maps
@ChrisBeaumont
ChrisBeaumont / sampling.ipynb
Last active August 29, 2015 14:09
sampling from arbitrary distributions
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.