[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[IDV #MIQ-112560]: IDV - manual input to Jython routines
- Subject: [IDV #MIQ-112560]: IDV - manual input to Jython routines
- Date: Tue, 02 Oct 2007 08:23:00 -0600
Hi HP-
> Institution: EUMETSAT
> Package Version: 2.4b1 build date:@DATE@
> Operating System: Linux
> Hardware Information: Java: home: /home/user/IDV_2.4b1/jre version: 1.5.0_11
> j3d:1.3.1
> Inquiry: Hi
>
> I would like to implement Jython routines that, beside requesting
> fields from the Field Selector as inout variabes, in addition
> would ask for ad-hoc numbers, like
>
> def NCOL_RGB(ch01,ch02,ch03,minrefl,maxref):
> img1 = 255*max_data(min_data((ch03-minrefl)/(maxrefl-minrefl),1.),0.)
> img2 = 255*max_data(min_data((ch02-minrefl)/(maxrefl-minrefl),1.),0.)
> img3 = 255*max_data(min_data((ch01-minrefl)/(maxrefl-minrefl),1.),0.)
> return combineRGB(img1,img2,img3)
>
> Obviously min/maxrefl limits the enhancement to the
> reflectivity range minref...maxrefl, its values
> be chosen at the moment of the routine call.
>
> I am pretty sure this is already possible but I am lacking anexample.
In your formula, you would have:
NCOL_RGB(ch01,ch02,ch03,minrefl[isuser=true],maxref[isuser=true])
which would pop up a dialog requesting values for minrefl and maxref.
In your Jython, you would want to use int(minrefl), int(maxref) to
convert the string to an integer. See the docs at:
http://www.unidata.ucar.edu/software/IDV/docs/userguide/tools/Formulas.html
which also shows how to have default values.
Don Murray
Ticket Details
===================
Ticket ID: MIQ-112560
Department: Support IDV
Priority: Normal
Status: Open