[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fwd: multi band tiff from netCDF]

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.


  • Subject: Re: [Fwd: multi band tiff from netCDF]
  • Date: Mon, 18 Apr 2005 10:26:31 -0600

John Caron wrote:

can you answer this?
cc to address@hidden and address@hidden

-------- Original Message --------
Subject:     multi band tiff from netCDF
Date:     Mon, 18 Apr 2005 16:01:21 +0100
From:     Norman Barker <address@hidden>
Organization:     UCAR/Unidata
To:     <address@hidden>



Hi,

I am using the java classes to convert a netcdf file for one time instance, with 27 levels in Z (atmospheric pressure levels).

I have created a loop with variable i, and attempting to write a band in the tif file for each iteration. What seems to happen is the first band gets written ok, but then after that
the page number gets messed up?

Array data = grid.readDataSlice(0, i, -1, -1);
writer.writeGrid(grid, data, false, xStart, yStart, xInc, yInc, i);

Has anyone got any pseudo code for writing multiband tif files from netCDF?

Many thanks,

Norman Barker

Norman,
The code was not designed for multiband tiff files. We originally believed that multipage was better to store multi variables and/or multi vertical levels. We just realized that multiband was probably better embraced because of the existing tiff readers and the concept of tiff community. This will be my next task to change the software to use multiband to store tiff files, it will be released sometime in the Summer.

Yuan