Re: help with imdisp [message #80631] |
Wed, 27 June 2012 17:40 |
Russell Ryan
Messages: 122 Registered: May 2012
|
Senior Member |
|
|
On Wednesday, June 27, 2012 4:29:00 PM UTC-4, Kyle Schindler wrote:
> Hi,
> I am new to IDL I only have a few weeks experiance.
> I have an array ch1,ch2,ch3, and ch4 each are from a FITS file which is ch1 FLOAT = Array[1763, 1957]
> I am trying to cancel out the background noise then use impdisp to display ch1/ch2, ch3/ch4 ect..
>
> I first use where to subtract out the noise
>
> ch10 = where(ch1 gt .01)
> values = ch1[ch10]; now this gives me a new array
> ;VALUES FLOAT = Array[701724]
> ;For imdisp to work I need need to have a two dimension array.
> ;so I use
> makech12d = array_indices(ch1,values)
> ;MAKECH12D LONG = Array[2, 701724]
> ;This prints out basically all zeros and a few ones the 2nd column is all zeros
> ; first column is all whole #'s even if its float
> ;I did this with ch3 and used this code
> b = makech32d/makech12d
> impdisp,b(x1-nx:x1+nx,y1-ny:y1+ny),range=[-2.0,2],channel=1, margin=0.02
> % Illegal subscript range: B.
>
>
> how can I get the array values to be an array that is closer to [1763, 1957] rather than [2, 701724] and fix my error
Looks like you're trying to show some IRAC imaging with no noise? Well, your problem isn't with imdisp, but understanding what you want.
Do you want to replace the sky pixels with some constant? If so, let's call that constant c, then you just need:
new_img = (chi1 gt 0.01)*ch1 + (ch1 le 0.01)*c
Now, just send that new_img to imdisp.
But, if you're looking at some color map or something (that is the ratio of two images), make sure you don't run into problems by dividing by zero. For example:
color = ch1/ch2
could diverge for pixels where ch2 =0 . So instead, do something like:
color = ch1/(ch2>epsilon)
where epsilon = 0.0001 or something.
Russell
|
|
|