Page 2 of 2

Re: building new color tables from ascii text?

Posted: Wed Apr 21, 2021 7:31 pm
by bobc
Hi Joleen,

There are no updates to report with inquiry 2385. I spent some time experimenting in the Jython Shell and discovered how you can apply min/max values after importing an enhancement. Here's how that works:

Code: Select all

a = importEnhancement('C:/Users/rcarp/joleen_enhancements/clavrx_cloud_type.cmap', 'NAME4', 'CATEGORY')
enh = a.getJavaInstance()
enh.setRange(ucar.unidata.util.Range(0, 14))
From the Jython Shell, you can run:

Code: Select all

print(see(enh))
This will print out the different commands you can run on the "enh" data object. Note that there is a function called "setBreakpoints", but I haven't been able to get it to work successfully yet. I tried running it as:

Code: Select all

enh.setBreakpoints(java.util.ArrayList([1.0,2.0,3.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0]))
While this doesn't error and the lister function returns a list of breakpoints:

Code: Select all

print(enh.getBreakpoints())
> [1.0, 2.0, 3.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0]
if I go to the Color Table Editor and open the enhancement I can see the min/max (0 / 14) values set earlier, but no breakpoints are drawn in the enhancement.

Hopefully this is enough information to help you going forwards, but please let me know if you have any other problems/questions.

Thanks,
Bob