pyDIS: a Python-based longslit reduction package
A lot of people talk a big game about the need for new and open software tools in science.
On my shelf are at least 4 books that could teach you how to reduce photometric (imaging) data well. There are many tutorials for writing your own aperture photometry pipeline. I even wrote one myself with about 500 lines of code! This data analysis problem is considered “easy”.
Most of these books, and most people who write simple photo-pipelines like mine, ignore spectroscopy. By adding the wavelength dimension (and losing at least 1 spatial dimension) we make the problem exponentially harder. I don’t know of a good book that walks you through this - if you have one, please send me the title so I can buy it!
The best manual for CCD spectroscopy with IRAF is from 1992, and is seriously helpful. A good “theory” paper on CCD spectroscopy that I’ve used is Wagner (1992).
In my experience, when a practitioner of astronomy wants to reduce spectroscopy, they first seek out another wizard who remembers the order of divine incantations to whisper to IRAF. Then they pray. Then they swear.
So, what’s wrong with that?
I have two philosophical bones to pick here:
- Single object, longslit spectroscopy is “simple” data. It shouldn’t be daunting to use, especially when it becomes increasing valueable as a compliment to “Big Photometry”. It’s 2015, there should be a great toolbox for this!
- Data from instruments should come reduced for you! We build (custom made, hugely expensive) general-use instruments so everyone can do science without having to be an optics or electrical engineer. Large surveys know this well: people need to use their data without being a computer scientist or image processing professional. When you build an instrument, build a pipeline!
A brighter future.
Introducing: pyDIS
My first goal with pyDIS is to provide a turn-key solution for reducing and understanding longslit spectroscopy, which could ideally be done in real time. So far I have only used data from the low/medium resolution APO 3.5-m “Dual Imaging Spectrograph” (DIS). Therefore, many instrument specific assumptions are being made. As of now, the software works for a first-order reduction of data, and may be good enough for some science purposes!
pyDIS can reduce an entire night of DIS data in under 1 minute with almost no button clicking (provided your data is simple, moderate S/N and you have all the right standards and calibrations…)
I am not an expert Python programmer, nor a deep expert on spectroscopy. I am just a frustrated scientist who wants this tool to exist!
My second goal is to “put up or shut up”. I’m tired of people (like me) saying “boo IRAF”, or “we need new tools”, and not building them. That’s why I applaud projects like astropy, emcee, and astroML: they aren’t just complaining, they’re doing. So this is my attempt at doing.
A call to arms.
pyDIS is not done, and not fully stable. Still, I think it’s more complete than most other packages out there for quickly analyzing longslit spectroscopy (well, if you’re using DIS).
I know other spectroscopy pipelines exist, even some powerful ones in Python. My plea for you is: make them simple to use! Many I have looked at appear too complicated for me to use, especially without a robust worked example (not just a Hello World). Some are basically impossible to use for other instruments (and maybe pyDIS is too…)
It’s is a classic argument: if you write good documentation, people will use your code.
If you hate what I’ve created: good! Make it better, or make something else! Does pyDIS unnecessarily reproduce or ignore functionality from your amazing codebase? Let me know how I can fix that!
If you like what I’ve created: help! Try to use it, send me feedback.
If you’re building a new general purpose instrument: please write a reduction pipeline.