Data points in interactive 3D display using VisAd
Source code name: "visad3D_surf.py"
Programming language: Python
Topic: Plots/3D
DMelt Version 1.9. Last modified: 07/02/1971. License: Pro
https://datamelt.org/code/cache/visad3D_surf_8387.py
To run this script using the DMelt IDE, copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.


from visad import DataReferenceImpl,RealType,RealTupleType,FunctionType
from visad import FlatField,ConstantMap,Display,ScalarMap,DisplayImpl
from visad.java3d import DisplayImplJ3D
from javax.swing import *

display = DisplayImplJ3D("display");
vis_radiance = RealType.getRealType("vis_radiance");
display.addMap(ScalarMap(RealType.Latitude, Display.YAxis));
display.addMap(ScalarMap(RealType.Longitude, Display.XAxis));
display.addMap(ScalarMap(vis_radiance, Display.ZAxis));

gmc = display.getGraphicsModeControl();
gmc.setTextureEnable(True);
gmc.setScaleEnable(True);

size = 32
types = [RealType.Latitude, RealType.Longitude]
earth_location = RealTupleType(types)
ir_radiance = RealType.getRealType("ir_radiance")
types2 = [vis_radiance, ir_radiance]
radiance = RealTupleType(types2);
image_tuple = FunctionType(earth_location, radiance)
imaget1 = FlatField.makeField(image_tuple, size, False)

map72flow = ScalarMap(vis_radiance, Display.Flow1X)
display.addMap(map72flow);
display.addMap(ScalarMap(ir_radiance, Display.Flow1Y))
ref_imaget1 = DataReferenceImpl("ref_imaget1")
ref_imaget1.setData(imaget1)
display.addReference(ref_imaget1, None)

jframe = JFrame("VisAD")
jframe.getContentPane().add(display.getComponent())
jframe.setSize(600, 600)
jframe.setVisible(True)


You see the box below because you did not login.