This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
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