looking for correct data type in RGB script

Post any questions, ideas, or topics related to Jython and Python scripting.
User avatar
tdrink
Posts: 157
Joined: Wed Apr 15, 2009 7:45 pm

Re: looking for correct data type in RGB script

Post by tdrink »

Hi HP,

I was able to display 2 different RGBComposites in the same panel:

Formulas -> Three Color (RGB) Image (Auto-scale)

Using version 1.7beta1, build date 2018-01-03
User avatar
bobc
Posts: 939
Joined: Mon Nov 15, 2010 5:57 pm

Re: looking for correct data type in RGB script

Post by bobc »

Hi Tom -

Here's a script that shows the problem in today's nightly:

Code: Select all

addeParms = dict(
    server = 'msg.ssec.wisc.edu',
    dataset = 'MSG',
    descriptor = 'FD',
    time = '12:00:00',
    size = 'ALL',
    )
b1 = loadADDEImage(band=1, **addeParms)
b2 = loadADDEImage(band=2, **addeParms)
b3 = loadADDEImage(band=3, **addeParms)
b4 = loadADDEImage(band=4, **addeParms)
rgb1 = combineRGB(b3, b2, b1)
rgb2 = combineRGB(b4, b1, b2)
layer1 = activeDisplay().createLayer('RGB Composite', rgb1)
layer2 = activeDisplay().createLayer('RGB Composite', rgb2)

After the first RGB display is created, McV locks up. If you change "combineRGB" to "mycombineRGB" then things work as expected in this script. It's the "Three Color (RGB) Image" formula that's the problem.

- Bob
User avatar
tdrink
Posts: 157
Joined: Wed Apr 15, 2009 7:45 pm

Re: looking for correct data type in RGB script

Post by tdrink »

I would replace combineRGB with mycombineRGB, and then remove mycombineRGB. I'm not
sure of the threading model used in the scripting, so the lock up could very well be related
to adding the second RGB (this script would probably be fine if you take out the 2nd composite)
User avatar
bobc
Posts: 939
Joined: Mon Nov 15, 2010 5:57 pm

Re: looking for correct data type in RGB script

Post by bobc »

The are a couple relevant inquiries related to these RGB formulas:

Inquiry 2282: Passing a list of RGB images (created with combineRGB or mycombineRGB) into createLayer does not result in a loop.
Inquiry 2283: Investigate the need of having two formulas to create RGB displays.

One problem with just swapping out combineRGB with mycombineRGB is that, as seen in the 02 Mar 2016, 19:27 post in this thread, is that you can create a loop by using ImageSequenceImpl with combineRGB. However, this ImageSequenceImpl method doesn't allow for creating loops with mycombineRGB.

I agree that it would be optimal to have only one RGB formula.

- Bob
User avatar
hproe
Posts: 503
Joined: Sat Nov 27, 2010 3:46 pm

Re: looking for correct data type in RGB script

Post by hproe »

It appears there is a slight confused with formula 'Three Color (RGB) Image (Auto-scale)' and display type '3 Color (RGB) Image'. What I am speaking about (and have a problem with) is the display type. As Bob correctly states in his code a couple of emails above

Code: Select all

layer1 = activeDisplay().createLayer('RGB Composite', rgb1)

is that display type 'RGB Composite' blocks up McV. When replacing it with '3 Color (RGB) Image' like

Code: Select all

layer1 = activeDisplay().createLayer('3 Color (RGB) Image', rgb1)

the code runs smoothly its end.

And here again I state my problem with '3 Color (RGB) Image'. It gives no access to range and gamma settings of the 3 beams, which on the other hand 'RGB Composite' does. I definitely would like to see an RGB display type that does not block McV and has the range/gamma setting features of 'RGB Composite'. Also, it would be convenient to streamline the RGB-creating methods '(my)combineRGB()'.

HP
User avatar
tdrink
Posts: 157
Joined: Wed Apr 15, 2009 7:45 pm

Re: looking for correct data type in RGB script

Post by tdrink »

Just replace combineRGB with mycombineRGB and both Display Types will work. Use the script above to
verify: you can use 'RGB Composite' or '3 Color (RGB) Image' if you always use mycombineRGB.
So like I said in my previous post just replace the contents of combineRGB with mycombineRGB and
remove the latter.
User avatar
hproe
Posts: 503
Joined: Sat Nov 27, 2010 3:46 pm

Re: looking for correct data type in RGB script

Post by hproe »

I agree with Tom that with mycombine RGB() both Display Types work, but only if you produce a single RGB image. If you run send an RGB time sequence to mycombine, she quits with the error message:
visad.TypeException: FieldImpl.setSample: bad range type

This problem has already been documented (maybe in fuzzy way) further up in this thread and in Inq #2282.
HP
User avatar
tdrink
Posts: 157
Joined: Wed Apr 15, 2009 7:45 pm

Re: looking for correct data type in RGB script

Post by tdrink »

Hi HP, Bob,

I think this one we can fix.

Tom
User avatar
hproe
Posts: 503
Joined: Sat Nov 27, 2010 3:46 pm

Re: looking for correct data type in RGB script

Post by hproe »

Hi Tom & Bob -

Please tell me if it will be fixed (soon). If yes, tell me please.

HP
Post Reply