about 2 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 2 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 2 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 2 years ago - No comments
Here's an easy way to display FITS images (or any array) in DS9 using Python (with PyFITS, NumPy and Numdisplay, which is part of stsci_python). First launch DS9, then in Python: import numdisplay import pyfits arr = pyfits.getdata('file.fits') numdisplay.display(arr) Easy! Alternatively, the Kapteyn package seems excellent, and uses Python's matplotlib for displaying images. It requires…
about 2 years ago - No comments
Two methods of approximating a point-spread function in IDL: 1. StarFinder seems to do a great job at finding point sources in crowded fields. It includes a routine for generating the Airy pattern. For a 51 x 51 array, with the peak at [25, 25], and an FWHM of 8.0 pixels, this is the command:…
about 2 years ago - No comments
I've finally made the transition from IDL 6.4 to IDL 7. Here are my handy hints... IDL Workbench rocks! (This is because it is basically Eclipse, which is a proper development environment, unlike that hideous old IDLDE.) Another reason for using IDL Workbench (for me at least, and for now) is that IDL help doesn't…
about 4 years ago - No comments
IDLdoc 3.0 (more info here) gives my badly-written bits of IDL the deceptive appearance of being well designed, useful and user-friendly. So I've made a few available here for your enjoyment.