NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
> > Out of an Ascii-file, currently I am just trying to load the ascii in > ArcView so that I can see, if VisAD or my application is missing values or > the ascii data set. > Ok in the meantime I checked the data set has about 300 000 points, and i am reading 300 000 lines in my application. so the coordinate arrays have a lenght about 300 000 columns = 1000 and rows = 834 1000*834=834000 ( the missing points included) I am putting this in a Linear2DSet and the result is the shape you can see at pictures, I approximately countet the points in the shape in the wireframe modus, which results in approximately 3000 points. So whats wrong? I would have expected about 300 000 points! Is Linear2DSet somehow interpolating? Where am I loosing my points? Thanks Desiree eastValues = RealType.getRealType("eastValues"); northValues = RealType.getRealType("northValues"); heightValues = RealType.getRealType("heightValues"); try { //domain_tuple = new RealTupleType(northValues,eastValues); domain_tuple = new RealTupleType(eastValues,northValues); // Create a FunctionType (domain_tuple -> range_tuple); func_en_h = new FunctionType(domain_tuple, heightValues); //System.out.println("nCols "+nCols); //System.out.println("nRows "+nRows); domain_set = new Linear2DSet(domain_tuple,northMin,northMax,nRows,eastMin, eastMax, nCols); // Get the Set samples to facilitate the calculations //float[][] set_samples = domain_set.getSamples( true ); // We create another array, with the same number of elements of // altitude and temperature, but organized as // float[2][ number_of_samples ] float[][] flat_samples = new float[1][nCols * nRows]; // ...and then we fill our 'flat' array with the generated values // by looping over NCOLS and NROWS // specifiy height for(int c = 0; c < nRows; c++){ for(int r = 0; r < nCols; r++){ //flat_samples[0][c*nRows+r] = height[c*nRows+r]; flat_samples[0][c*nCols+r] = heightNaN[c*nCols+r]; } } System.out.println("fsl "+flat_samples[0].length); // Create a FlatField // Use FlatField(FunctionType type, Set domain_set) vals_ff = new FlatField( func_en_h, domain_set); // ...and put the values above into it // Note the argument false, meaning that the array won't be copied vals_ff.setSamples( flat_samples , false ); // Create Display and its maps // A 2D display display = new DisplayImplJ3D("display1"); // Create the ScalarMaps: latitude to XAxis, longitude to YAxis and // altitude to RGB and temperature to IsoContour // Use ScalarMap(ScalarType scalar, DisplayRealType display_scalar) eastMap = new ScalarMap( eastValues, Display.YAxis ); northMap = new ScalarMap( northValues, Display.XAxis ); heightMap = new ScalarMap(heightValues,Display.ZAxis); eastMap.setRange(-1.0, 1.0); northMap.setRange(-1.0, 1.0); heightMap.setRange(-1.0, 1.0); // Add maps to display display.addMap( eastMap ); display.addMap( northMap ); display.addMap( heightMap ); // Create a data reference and set the FlatField as our data data_ref = new DataReferenceImpl("data_ref"); data_ref.setData( vals_ff ); renderer = new DefaultRendererJ3D(); // Add reference to display display.addReferences(renderer,data_ref); display.addDisplayListener(listener);
visad
archives: