Due to the current gap in continued funding from the U.S. National Science Foundation (NSF), the NSF Unidata Program Center has temporarily paused most operations. See NSF Unidata Pause in Most Operations for details.

Resampling

Hello...

Why is temporField.getSample(0) missing when driving the following code:

Elin

import visad.*;
import visad.java3d.DisplayImplJ3D;
import visad.java3d.DirectManipulationRendererJ3D;
import java.rmi.RemoteException;
import java.awt.*;
import javax.swing.*;

import visad.bom.PickManipulationRendererJ3D;




/**
 *
 * @author  elins
 */
public class VisAdTest {
    

//The domain quantities and the dependent quantity  
  private RealType x, y, z, w;
  //One tuple to pack x, y and z as a domain
  private RealTupleType domain;
  //A tuple of Reals (a subclass of VisAd Data)
  //which will hold cursor data.
  private RealTuple cursorCoords;//Ny
  //The function (x, y, z)-> w
  private FunctionType grid_type;
  //The data values for the domain are represented by the Set
  private Set domain_set;
  //The data class FlatField
  private FlatField vals_ff;
  
  
  // The DataReference from data to display
  private DataReferenceImpl data_ref, cursorDataRef;//Ny
  
  private DisplayImplJ3D display;
  private ScalarMap xMap, yMap, zMap, iso_map, wMap, tempIsoMap;

  
  
  
    
    /** Creates a new instance of VisAdTest */
    public VisAdTest(String[] args) 
       throws RemoteException, VisADException {
           
                                               

        
         float[][] threeDSamples = new float[][]{{ 1.0f, 3.0f, 1.0f, 3.0f,
1.0f, 3.0f, 1.0f, 3.0f, 2.0f },
                                                 { 1.0f, 1.0f, 3.0f, 3.0f,
1.0f, 1.0f, 3.0f, 3.0f, 2.0f },
                                                 { 1.0f, 1.0f, 1.0f, 1.0f,
3.0f, 3.0f, 3.0f, 3.0f, 2.0f }};
                                                  
                                            

       float[][] fi_Samples = new float[][]{{ 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
1.0f, 1.0f, 1.0f, 2.0f }};                                        
           
       //Declarations
       x = RealType.getRealType("gridx", SI.meter, null);
       y = RealType.getRealType("gridy", SI.meter, null);
       z = RealType.getRealType("gridz", SI.meter, null);
       w = RealType.getRealType("gridw", SI.kelvin, null);
       
       
       domain = new RealTupleType(x, y, z);
       
       grid_type = new FunctionType(domain, w);
       
       
       DelaunayWatson delan = new DelaunayWatson(threeDSamples);
//       
//       System.out.println("DOMAIN " + grid_type.getDomain());
//       //Construction of an Irregular3DSet and a FlatField:
//       //domain_set ds = new Irregular3DSet(grid_type.getDomain(),
threeDSamples);
       domain_set = new Irregular3DSet(grid_type.getDomain(), threeDSamples,
null, null, null, delan);
       
       vals_ff = new FlatField(grid_type, domain_set);
       
       vals_ff.setSamples(fi_Samples, false);//Uten denne starter cursor i
midten
       
     
     
       
      
       Linear3DSet new3DSet = new Linear3DSet(1.0, 3.0, 6, 1.0, 3.0, 6, 1.0,
3.0, 6);
      int resampMode = Data.NEAREST_NEIGHBOR;
           int errorMode = Data.NO_ERRORS;
           FlatField temporField = (FlatField)vals_ff.resample(new3DSet,
resampMode, errorMode);

        
        Data tem1 = temporField.getSample(0);
           System.out.println("TEM1 " + tem1);
       
        
    }
           
     /**
     * @param args the command line arguments
     */
    public static void main(String[] args) 
        throws RemoteException, VisADException {
      new VisAdTest(args);
    }
    
}//Ongoing End


---------------------------------------------------------------------
From: Elin R. Sivertsen---Elin.Sivertsen@xxxxxx
Title: CandScient
Place: IFE/OECD Halden Reactor Project
Department: Halden VR Centre


  • 2003 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: