Skip to content

Instantly share code, notes, and snippets.

View vterron's full-sized avatar

Víctor Terrón vterron

View GitHub Profile
@vterron
vterron / gtk-bug-632538-workaround.py
Last active August 29, 2015 14:04
Workaround for GTK+ bug 632538
#! /usr/bin/env python
import gtk
# Workaround for GTK+ bug 632538
if gtk.gtk_version < (2, 24, 19):
gtk.Button()
settings = gtk.settings_get_default()
settings.props.gtk_button_images = True
@vterron
vterron / ferM_0110_D_F.skysubas.fits
Last active August 29, 2015 14:04
First attempt at debugging issue #23
This file has been truncated, but you can view the full file.
@vterron
vterron / a688sa.fits
Last active August 29, 2015 14:04
Second attempt at debugging issue #23
This file has been truncated, but you can view the full file.
#! /usr/bin/env python
import collections
import functools
import random
class Item(collections.namedtuple('_Item', "value weight")):
@classmethod
def random(cls):
@vterron
vterron / memcached_decorator.py
Created February 22, 2015 17:54
A Python multiple-server memcached decorator
#! /usr/bin/env python
# Author: Victor Terron (c) 2015
# Email: `echo vt2rron1iaa32s | tr 132 @.e`
# License: GNU GPLv3
""" A memcached function decorator. """
from __future__ import division
from __future__ import print_function
@vterron
vterron / splitfits.py
Last active August 29, 2015 14:16
Extract an extension from a multi-extension FITS file
#! /usr/bin/env python
# Author: Victor Terron (c) 2015
# Email: `echo vt2rron1iaa32s | tr 132 @.e`
# License: GNU GPLv3
description = """
Extract an extension from a multi-extension FITS file and write it as a
standalone FITS file. This new file inherits the keywords from the primary
header, regardless of the presence or not of the INHERIT keyword. Thanks to
@vterron
vterron / export-curves.py
Last active August 29, 2015 14:18
Export all the light curves from a LEMON database
#! /usr/bin/env python
""" Take a LEMONdB file and export the light curves of all the astronomical
objects, in all the photometric filters, to an output directory. The curves
are saved as SVG files. """
# Author: Victor Terron (c) 2015
# Email: `echo vt2rron1iaa32s | tr 132 @.e`
# License: GNU GPLv3
@vterron
vterron / imcombine.py
Created May 4, 2015 17:31
Python interface to IRAF's imcombine (via PyRAF)
#! /usr/bin/env python
# Author: Victor Terron (c) 2015
# Email: `echo vt2rron1iaa32s | tr 132 @.e`
# License: GNU GPLv3
""" Python interface to IRAF's imcombine (via PyRAF) """
import sys
import tempfile
@vterron
vterron / sep_demo.py
Created May 21, 2015 10:25
A convenience function to detect astronomical objects with SEP
#! /usr/bin/env python
# Author: Victor Terron (c) 2015
# Email: `echo vt2rron1iaa32s | tr 132 @.e`
# License: GNU GPLv3
import sep as sextractor
import sys
import astropy.io.fits
import astropy.wcs
@vterron
vterron / coordinates
Last active August 29, 2015 14:21
Zillionth attempt at debugging issue #57
100.1191901 9.8177770