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.
you can extract the byte array through: byte[] data = (byte[]) fullA.getStorage(); William Ruddick wrote:
John / Support -I have a huge 5120x5120 byte array representing a Sataelite image, that I am reading out of a NetCDF file using theNetCDF Java Libraries v.2.It is taking me an average of 10 seconds on a P2 233 Windows 200 machine with 512M ram.I believe this is taking twice as long as it should be. Do you have any suggestions?My code is a follows:////////////////////////////////// fullimagebytes = new byte[(int)5120*5120]; ucar.nc2.Variable lVar = cdfFile.findVariable("image");ucar.ma2.Array fullA = lVar.read(); // This statement takes on average 5 secondsucar.ma2.IndexIterator iter = fullA.getIndexIteratorFast(); int xi = 0; while (iter.hasNext()) { // This loop takes another 5 seconds on averagefullimagebytes[xi] = iter.getByteNext(); xi++;} //////////////////////////////////I believe there should be some way to go directly from a ucar.nc2.Variable to a primitive byte array in 5 seconds or less.Thanks,NOAA International Division - FX-Net -William Ruddick ruddick@xxxxxxxxxxxx <mailto:ruddick@xxxxxxxxxxxx> 303-497-6757
netcdf-java
archives: