[AstroPy] Image combine

Neil Crighton neilcrighton@gmail....
Tue Mar 6 15:08:31 CST 2012


Hi,

I started to write a Cython version of imcombine that allows weight
images to be used and includes outlier rejection. It can operate on a
series of images too large to all fit in memory by using memory mapped
arrays. It's not thoroughly tested though. Let me know if you're
interested in the code and I'll email to you.

Cheers, Neil

On 6 March 2012 20:01, Kathleen Labrie <klabrie@gemini.edu> wrote:
> 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@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@scipy.org
>>> http://mail.scipy.org/mailman/listinfo/astropy
>>
>>
>>
>> --
>> Erik Tollerud
>> _______________________________________________
>> AstroPy mailing list
>> AstroPy@scipy.org
>> http://mail.scipy.org/mailman/listinfo/astropy
>
> _______________________________________________
> AstroPy mailing list
> AstroPy@scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy


More information about the AstroPy mailing list