discriminateFilter() function script

Post any questions, ideas, or topics related to Jython and Python scripting.
Post Reply
User avatar
CNETO
Posts: 7
Joined: Wed Jun 04, 2014 4:48 pm

discriminateFilter() function script

Post by CNETO »

Hello,

I tried to use the discriminateFilter() in one script. First of all: Is that posible?

I tried like this:


Code: Select all

Discriminate_image = discriminateFilter(Image1,Image2,0,233,0,225)


but i got a error mensage:

AttributeError: 'visad.RealTuple' object has no attribute 'getFloats'.

How do i use the discriminateFilter() in a code?
User avatar
barryr
Posts: 213
Joined: Thu Jan 08, 2009 5:42 pm
Contact:

Re: discriminateFilter() function script

Post by barryr »

Hello CNETO,

Thank you for the report. I'm sorry to say that there is a known problem with using the image filters via scripting. It's being worked on in McIDAS-V inquiry 1338 (http://mcidas.ssec.wisc.edu/inquiry-v/?inquiry=1338).

Thanks again,
Barry
User avatar
CNETO
Posts: 7
Joined: Wed Jun 04, 2014 4:48 pm

Re: discriminateFilter() function script

Post by CNETO »

I think i figure it out.
As i just wanted to highlight areas with the presence of pixels of Image1 in range 0 - 233 and image2 in range 0 - 225.
I applied a mask to image one and then I multiplied by a mask of image2, Like this:

Code: Select all

Image1_mask = mask(Image1, '<', 233, True) #This way i set all pixels in that range as 1 and delete the others

image2_mask = mask(Image2, '<', 225, True)*Image2 # set all pixels in that range as 1 and delete the other and multiplied again by Image2

discriminate = Image1_mask * image2_mask



This way, the result is a region that is present pixels in both range and with values of image2_mask
Post Reply