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

Home » Public Forums » archive » Re: bad column in image
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: bad column in image [message #66703] Wed, 03 June 2009 09:48 Go to next message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
Amanda wrote:
> I was just using the where function, like this: arr(where(arr[1440,*]
> GT 1000))=mean(arr) but I don't know if that's how I should be doing
> it.
>
> Amanda

Amanda, pay close attention to the meaning of the index returned by the
where function. In this call, you will have the index where the value is
gt 1000 in your column of interest. arr[1440,*] is a 1D array. Then,
with these index, you are applying them to arr, which is a 2D array.
Therefore, you end up writing the mean value to the first LINE of your
array...

Jean
Re: bad column in image [message #66706 is a reply to message #66703] Wed, 03 June 2009 09:11 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Amanda writes:

> I was just using the where function, like this: arr(where(arr[1440,*]
> GT 1000))=3Dmean(arr) but I don't know if that's how I should be doing
> it.

No, that's not the way you should be doing it. :-)

I would do it like this:

badcol = arr[1440,*]
indices = Where(badcol GT 1000, count)
IF count GT 0 THEN badcol[indices] = Mean(arr)
arr[1440,*] = badcol

Using the mean of the array is sketchy. Perhaps some
kind of interpolation method would be better:

http://www.dfanning.com/math_tips/easyinterp.html

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: bad column in image [message #66707 is a reply to message #66706] Wed, 03 June 2009 09:03 Go to previous messageGo to next message
Amanda is currently offline  Amanda
Messages: 12
Registered: August 2006
Junior Member
I was just using the where function, like this: arr(where(arr[1440,*]
GT 1000))=mean(arr) but I don't know if that's how I should be doing
it.

Amanda


On Jun 3, 3:08 am, David Fanning <n...@dfanning.com> wrote:
> Amanda writes:
>> I'm trying to get a bad column out of an image by selecting the column
>> and then setting all values equal to the mean of the image (probably
>> not the best way to go about it, but I'm not very good at this). But
>> I'm having trouble selecting the column. No matter what row or column
>> number I put in, i.e. array=[1440,*], and then set those values to the
>> mean, it will only change the row on the top of the image. I'm
>> probably missing something very simple or doing something very stupid.
>
> You're probably right. But it's very difficult to tell
> unless we see a few clues. :-)
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: bad column in image [message #66713 is a reply to message #66707] Tue, 02 June 2009 19:08 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Amanda writes:

> I'm trying to get a bad column out of an image by selecting the column
> and then setting all values equal to the mean of the image (probably
> not the best way to go about it, but I'm not very good at this). But
> I'm having trouble selecting the column. No matter what row or column
> number I put in, i.e. array=[1440,*], and then set those values to the
> mean, it will only change the row on the top of the image. I'm
> probably missing something very simple or doing something very stupid.

You're probably right. But it's very difficult to tell
unless we see a few clues. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: bad column in image [message #66816 is a reply to message #66706] Fri, 05 June 2009 12:22 Go to previous message
Amanda is currently offline  Amanda
Messages: 12
Registered: August 2006
Junior Member
Ok, the interpolation sounds like a much better idea, but is
"interpol" only for vectors? I tried using it with mine and only got a
synthax error. I know there's also an "interpolation" function, but I
have no idea how to use it.

Amanda

On Jun 3, 5:11 pm, David Fanning <n...@dfanning.com> wrote:
> Amanda writes:
>> I was just using the where function, like this: arr(where(arr[1440,*]
>> GT 1000))=3Dmean(arr) but I don't know if that's how I should be doing
>> it.
>
> No, that's not the way you should be doing it. :-)
>
> I would do it like this:
>
>    badcol = arr[1440,*]
>    indices = Where(badcol GT 1000, count)
>    IF count GT 0 THEN badcol[indices] = Mean(arr)
>    arr[1440,*] = badcol
>
> Using the mean of the array is sketchy. Perhaps some
> kind of interpolation method would be better:
>
>   http://www.dfanning.com/math_tips/easyinterp.html
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: heap memory used: 18446743890746993974 :S ?????????
Next Topic: IDLdoc 3.2 released

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

Current Time: Wed Oct 08 13:53:47 PDT 2025

Total time taken to generate the page: 0.21267 seconds