This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Hi Folks, I've got a weird one for you. I have a process that writes out netcdf files that typically works fine. The process takes an array of lat/lon values and for each element in the array it increments a 2D array in my netcdf file. The 2D array is essentially a counter for the number of lat/lon values in my initial array that map to each pixel (in lat/lon space) in my netcdf file. However, there is an abnormal case that shows up when I write a large number of times to the netcdf file (1050705 times) where a horizontal band of the data in the netcdf seems to be getting lost somewhere. Here's what I've done to test: Written smaller netcdf files using the exact same code with data in the missing zone. The data in this test case shows up fine. Stepped through with a debugger to make sure my code is actually writing the values into the netcdf array, I can see the values being entered and feel confident that this is working. I've viewed the data file in multiple data viewers to make sure it isn't a glitch in the data viewer (openev, gdal_translate (to an image)) About my setup: I'm using netcdfUI-2.2.18.jar (was using 2.2.16, but updated before sending this email, to make sure). Writing my data to a ucar.ma2.ArrayInt (and my values aren't coming near overflowing the 16bit limit) Java 1.5.0_3 Windows XP Here's a snapshot of what the problem looks like when visualized: http://www.mbari.org/staff/achase/vdm/netcdf-wierdness.jpg The banding I'm referring to is right in the middle of the screen. I set the viewing options to show pixels with any value as white and no data as black. Any thoughts? Anybody come across a problem like this before? Here's the gdalinfo output for the file: Driver: netCDF/Network Common Data Format Size is 512, 512 Coordinate System is `' Metadata: NC_GLOBAL#creationDate=01/24/2007 NC_GLOBAL#lastModified=01/24/2007 NC_GLOBAL#description=Test File NC_GLOBAL#title=Test Data NC_GLOBAL#keywords=test NC_GLOBAL#Conventions=CF-1.0 Subdatasets: SUBDATASET_1_NAME=NETCDF:"physical-object.nc":physical-object SUBDATASET_1_DESC=[4001x5001] physical-object (16-bit integer) Corner Coordinates: Upper Left ( 0.0, 0.0) Lower Left ( 0.0, 512.0) Upper Right ( 512.0, 0.0) Lower Right ( 512.0, 512.0) Center ( 256.0, 256.0) And for the variable in question: C:\workspace\vdm\snapshot_creator>gdalinfo NETCDF:"physical-object.nc":physical- object Driver: netCDF/Network Common Data Format Size is 5001, 4001 Coordinate System is `' Origin = (-125.000000000000000,38.000999999999998) Pixel Size = (0.000999800039992,-0.000999750062484) Metadata: NC_GLOBAL#creationDate=01/24/2007 NC_GLOBAL#lastModified=01/24/2007 NC_GLOBAL#description=Test File NC_GLOBAL#title=Test Data NC_GLOBAL#keywords=test NC_GLOBAL#Conventions=CF-1.0 physical-object#units=count physical-object#fillvalue=0 physical-object#missing_value=0 latitude#units=degrees_north (+N/-S) longitude#units=degrees_east (+E/-W) Corner Coordinates: Upper Left (-125.0000000, 38.0010000) Lower Left (-125.0000000, 34.0010000) Upper Right (-120.0000000, 38.0010000) Lower Right (-120.0000000, 34.0010000) Center (-122.5000000, 36.0010000) Band 1 Block=5001x1 Type=Int32, ColorInterp=Undefined NoData Value=0 Metadata: NETCDF_VARNAME=physical-object Thanks, Andrew Andrew C. Chase Software Engineer Monterey Bay Aquarium Research Institute (831) 775-1865 :: Work (831) 419-8566 :: Cell [NOTE: New number as of May 22, 2005] =============================================================================== To unsubscribe netcdf-java, visit: http://www.unidata.ucar.edu/mailing-list-delete-form.html ===============================================================================