[AstroPy] Image combine

Kathleen Labrie klabrie at gemini.edu
Tue Mar 6 14:01:07 EST 2012


Hi,

I think Jose mostly refer to the rejection, masking, scaling, weighing
algorithms that iraf imcombine offers.    I agree the arithmetic is easy
enough to do with numpy and pyfits, even the median.  It's the rest
of imcombine that can get tricky (and bloated).

For the record, here at Gemini, we will soon embark it that foolish adventure
of trying to reproduce at least some of the imcombine features (but only
the ones we need due to time and resource constraints).   We are still
at the point of defining which features we really need though, so I don't 
think it will help Jose much for now.

I am very interested to hear if someone has written some code for a 
imcombine-like routine.

Cheers,
Kathleen

On Mar 6, 2012, at 8:52 AM, Erik Tollerud wrote:

> I'm not aware of a function that does it exactly with the interface of
> imcombine, but it can be done pretty easily with pyfits:
> 
> import pyfits
> 
> f1 = pyfits.open('filename1')
> f2 = pyfits.open('filename2')
> 
> h1 = f1[0].header
> im1 = f1[0].data
> im2 = f2[0].data
> 
> newimage = im1 + im2
> 
> newhdu = pyfits.PrimaryHDU(data=newimage,header=h1)
> newhdu.writeto('newfilename')
> 
> 
> That example is specific to addition, of course (the im1 + im2 part,
> but it should be clear how to generalize it to other arithmetic
> operations.
> 
> 
> 2012/3/6 Jose Miguel Ibáñez <ppmime at gmail.com>:
>> Hello everyone,
>> 
>> does anyone know of an implementation of the iraf.imcombine task in
>> python+numpy ? (of course, not using pyraf.imcombine call)
>> 
>> 
>> Thanks !
>> Jose
>> _______________________________________________
>> AstroPy mailing list
>> AstroPy at scipy.org
>> http://mail.scipy.org/mailman/listinfo/astropy
> 
> 
> 
> -- 
> Erik Tollerud
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy




More information about the AstroPy mailing list