from visad import FunctionType, Linear1DSet, FlatField, Real from visad.python.JPythonMethods import * domain = getRealType("temp_F") range = getRealType("temp_Kelvin") convertTemp = FunctionType(domain, range) domain_set = Linear1DSet(-40, 212, 2) values = ( (233.15, 373.15), ) # deg K values for -40F and 212F convertData = FlatField(convertTemp, domain_set) convertData.setSamples(values) e = Real(14.0) v = convertData.evaluate(e) print "value for 14.0F =",v vf = (v.getValue() - 273.15) * 9 / 5. + 32 print " or (doing some math) = ",vf