comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: combing fits files and taking the median average
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: combing fits files and taking the median average [message #80897 is a reply to message #80896] Tue, 17 July 2012 07:24 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Tuesday, July 17, 2012 10:09:10 AM UTC-4, Mandy Bailey wrote:
> I'm new to IDL but slowly getting the hang of things. I have four fits files, each being spectra of the same targets taken on consecutive nights. I would like to combine these into one file to analyse but I want the median average not just the average. For the latter I could simply add each file together and divide by 4 of course but I cannot see a way to take the median average when combining the files.
>
> The routine MEDIAN doesn't appear to work for combining multiple images as far as I can see.
>
> Any ideas gratefully received, thanks
> Mandy

You can stack the images into a 3D image, and then use the DIMENSION keyword of MEDIAN().

Example,
img_3d = dblarr(nx,ny,3)
img_3d(*,*,0) = img_1
img_3d(*,*,1) = img_2
img_3d(*,*,2) = img_3

img_med = median(img_3d, 3)

You may have bigger problems though. If your images need to be registered then the problem becomes a lot harder.

Craig
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: anything new?
Next Topic: Reading special sentence in txt file in IDL

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 16 01:28:57 PDT 2025

Total time taken to generate the page: 1.12113 seconds