about 6 months ago - No comments
It's been a while since I posted anything here. And today won't mark a significant change in that pattern, I'm afraid. But my python-IDL interface, pIDLy, has been mentioned elsewhere a couple of times, so I thought I might as well put the links up here. First, IDL guru Michael Galloy found pIDLy, liked it,…
about 11 months ago - 2 comments
One of my most important roles within HerMES has been to generate the LaTeX for the lists of authors and affiliations in the astronomy journal papers (previous posts here and here). HerMES is a big consortium, so some of the papers have something like 100 authors (with each author contributing, say, 10 or 20 words,…
about 11 months ago - No comments
I thought I'd better figure out what Git and GitHub are. Git is a revision control system, enabling you to keep track of changes to computer software (for example). GitHub is a web-based hosting service for Git repositories. (The GitHub logo is the "octocat", by the way.) It's all very simple to use too. My…
about 2 years ago - 6 comments
Okay, a bit boring, but as promised, here are some Python functions to generate LaTeX source for long authors lists for MNRAS and A&A. First, a small utility: def getSortedInstituteCodes(authorList, authorInstituteCodes): """Return a list of institute codes, in the correct order for authorList. authorList = ["J.~Bloggs", "A.N.~Other"] authorInstituteCodes = {"J.~Bloggs":1, "A.N.~Other":[1,"Sussex"]} """ instituteCodes =…
about 3 years ago - No comments
You (both of you) might well be interested in the new Astropython site, which looks excellent. Here's the site's own description: Research in astronomy includes the analysis of astronomical images, parsing and manipulation of large catalogs, statistical yet often visual inference, and the creation of data visualizations for publication and dissemination of results. The purpose…
about 3 years ago - No comments
They're coming thick and fast now. Here's a Python function to accompany the previous post. It's not maximally efficient, but should make sense... from scipy import stats def gaussian_pixel(minxy, maxxy, sigma, meanxy=(0.,0.), norm=None): """Return the value of a pixel sampling a 2D Gaussian, normalized such that the area under the Gaussian is 1 (default) or…
about 4 years ago - No comments
You have an image. Each pixel has a value with some uncertainty. How do you visualize the uncertainty in each pixel? Like this: Here's the Python code import numpy as np from matplotlib import pyplot as plt class FlickerImage(object): def __init__(self, im, err): self.im = im.copy() self.err = err.copy() finite = np.isfinite(self.im + self.err)…
about 5 years ago - No comments
Now Python and IDL can talk to each other (okay, Python talks to IDL and IDL does what it's told), using pIDLy (pronounce as you please). I experimented with a few other solutions available online but couldn't get them to work. So I cobbled this one together with surprisingly little trouble, thanks largely to pexpect.
about 1 year ago
You might also be interested in:
https://github.com/timstaley/pyds9_ex
It's a lightweight wrapper to pyds9, which adds some ready made python wrappers to common actions such as pan, zoom, scale, etc. I also use a bit of python trickery so you can write these functions for a single frame, then automatically apply them to all frames if you so desire. It’s a work in progress rather than a polished product, but it should be easy for anyone with a little python / ds9 knowledge to get stuck in. Collaborators welcome!