Package ucar.nc2

Examples of ucar.nc2.NetcdfFileWriteable.create()


    String filename = "C:/data/unicode/helloNorm.nc";
    NetcdfFileWriteable ncfile = NetcdfFileWriteable.createNew(filename);
    ucar.nc2.Dimension dim = ncfile.addDimension(helloGreek, 20);
    ncfile.addVariable(helloGreek, DataType.CHAR, helloGreek);
    ncfile.addVariableAttribute(helloGreek, "units", helloGreek);
    ncfile.create();
    ArrayChar.D1 data = new ArrayChar.D1(dim.getLength());
    data.setString(helloGreek);
    ncfile.write(helloGreek, data);
    ncfile.close();
View Full Code Here


            dataFile.addVariableAttribute("pressure", "units", "hPa");
            dataFile.addVariableAttribute("temperature", "units", "celsius");

            // Write the coordinate variable data. This will put the latitudes
            // and longitudes of our data grid into the netCDF file.
            dataFile.create();


            ArrayFloat.D1 dataLat = new ArrayFloat.D1(latDim.getLength());
            ArrayFloat.D1 dataLon = new ArrayFloat.D1(lonDim.getLength());
View Full Code Here

                        dataTemp.set(record, lvl, lat, lon, SAMPLE_TEMP + i++);
                    }
            }

            //Create the file. At this point the (empty) file will be written to disk
            dataFile.create();

            // A newly created Java integer array to be initialized to zeros.
            int[] origin = new int[4];

            dataFile.write("latitude", lats);
View Full Code Here

           // Define a netCDF variable. The type of the variable in this case
           // is ncInt (32-bit integer).
           dataFile.addVariable("data", DataType.INT, dims);
                
           // create the file
           dataFile.create();

            // This is the data array we will write. It will just be filled
            // with a progression of numbers for this example.
           ArrayInt.D2 dataOut = new ArrayInt.D2( xDim.getLength(), yDim.getLength());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.