Adding/Subtracting/Multiplying images together [message #67468] |
Tue, 21 July 2009 13:37  |
Barbara
Messages: 17 Registered: July 2009
|
Junior Member |
|
|
I am extremely new to IDL, and am working with an astronomy professor
looks at fits files. I have been able to split the header and image
apart, however now I must be able to add images, then multiply them,
and find the average image. Does anyone know how to do this?
|
|
|
|
|
Re: Adding/Subtracting/Multiplying images together [message #92835 is a reply to message #92829] |
Wed, 09 March 2016 06:04   |
Russell[1]
Messages: 101 Registered: August 2011
|
Senior Member |
|
|
Soniya...
This is a very tough question to answer, because it depends critically on the properties of the images to add and the (desired) property of the result. In broad-brush terms, you will need to interpolate one image to the WCS of the other, before proceeding. If you are familiar with the IDL astrolib, then you can use hastrom, but that will only bi-linear interpolate --- and you might actually want/need something fancier (such as sinc-interpolation). That issue withstanding, the notion of "adding" is not actually that clear when you have a pixelated image, look up the process of drizzling:
http://drizzlepac.stsci.edu
of course that is relevant to HST only, but the mathematical underpinning is generic to any telescope/camera. You might also look at SWarp:
http://www.astromatic.net/software/swarp
which does very similar things.
However, be very (no VERRRRRYYYY) cautious with this. Any interpolation you do (bilinear, sinc, drizzle, etc.) will by it's VERY nature, introduce pixel correlation to your image. If you're a grad student, you've probably heard senior faculty or postdocs complain about "correlated errors"? Well, this is the worst manifestation of that problem. So, you need to be very careful in interpreting the results and understanding properties of your resultant image.
Good luck,
Russell
PS. I tried to make this sound very grave, because it is actually a tough problem. However it's so bad, many people have developed many ways of cracking this nut. I've just pointed you to the two most common approaches.
On Wednesday, March 9, 2016 at 3:27:33 AM UTC+1, soniya...@gmail.com wrote:
> On Wednesday, 22 July 2009 06:37:21 UTC+10, Barbara wrote:
>> I am extremely new to IDL, and am working with an astronomy professor
>> looks at fits files. I have been able to split the header and image
>> apart, however now I must be able to add images, then multiply them,
>> and find the average image. Does anyone know how to do this?
>
> As a follow up to this question how to add if the wcs of the images dont match ? Then I guess
> image_added = image_1 + image_2 this wouldn't work.. Is that right?
|
|
|
Re: Adding/Subtracting/Multiplying images together [message #92836 is a reply to message #92835] |
Wed, 09 March 2016 07:04  |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
On Wednesday, March 9, 2016 at 9:04:54 AM UTC-5, rrya...@gmail.com wrote:
> Soniya...
>
> This is a very tough question to answer, because it depends critically on the properties of the images to add and the (desired) property of the result.
I agree with this and only add a couple of comments. First, hastrom.pro uses the IDL internal function POLY_2D(), and so allows both bilinear and cubic interpolation. I find that setting CUBIC=-0.5 works well for high signal to noise data.
Among the reasons for co-adding images are to create a prettier picture, to improve photometry, and to identify weak features not visible on a single image. For a prettier (higher S/N) picture, the particular interpolation method is not very important. For precision photometry of a bright source, it is often better to perform the photometry on individual images and then statistically coadd the photometry results. (I was involved recently in a project like this where drizzle interpolation gave surprisingly poor results.) In other cases, yes it is something of an art to determine the best interpolation method (and not all methods are easily available in IDL).
|
|
|