Re: Beginner question

_From owner-netcdf-java@xxxxxxxxxxxxxxxx Mon May 23 09:46:07 2005
Received: (from majordo@localhost)
        by unidata.ucar.edu (UCAR/Unidata) id j4NFirPc005640
        for netcdf-java-out; Mon, 23 May 2005 09:44:53 -0600 (MDT)
Received: from ssec.wisc.edu (mahogany.ssec.wisc.edu [128.104.110.2])
        by unidata.ucar.edu (UCAR/Unidata) with ESMTP id j4NFiqP3005636
        for <netcdf-java@xxxxxxxxxxxxxxxx>; Mon, 23 May 2005 09:44:52 -0600 
(MDT)
Organization: UCAR/Unidata
Keywords: 200505231544.j4NFiqP3005636
Received: from [128.104.110.87] (account tomw HELO [128.104.110.87])
  by ssec.wisc.edu (CommuniGate Pro SMTP 4.2.9)
  with ESMTP-TLS id 5081511; Mon, 23 May 2005 10:44:46 -0500
Reply-To: tomw@xxxxxxxxxxxxx
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) 
Gecko/20050414
X-Accept-Language: en-us, en
MIME-Version: 1.0
CC: netcdf-java@xxxxxxxxxxxxxxxx
References: <a8c73778165ce98afc34f95b4059af11@xxxxxxxxxxx>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Sender: owner-netcdf-java@xxxxxxxxxxxxxxxx
Precedence: bulk

Hussein:

It might depend on how complex the file structure is.  In the simplest of 
cases (a flat file), you might just do this:

1. open the file with nf = Netcdf.open()
2. get a List of the Variables with nf.getVariables()
3. for each Variable, you can get the Attributes and Dimensions
4. then read the slice of the Variable you want.

The key Javadoc classes to look at are Netcdf and Variable...plus some that 
these refer to.  Hope this helps get you started.  There are also some 
examples of reading in the on-line "user documentation" that will be helpful.

tom

p.s. I might add that using Jython is an excellent, quick way to get rolling 
with things like this -- since it allows for quick experimenting and 
exploration.


Hussein Yahia wrote:

> Hello list,
> 
> I am currently involved in a java project for processing data, and I 
> have to write a java module that should be capable of reading netcdf 
> satellite images, and display on screen the various images and 
> information they contain.
> 
> I'm completely new to netcdf, I know nothing about it. What I want to do 
> using java-netcdf  is:
> 
> - open netcdf files, find what's in it, and then read and get all the 
> information it contains (in my case, satellite image data).
> 
> Having read the documentation, it's not very clear to me how to get the 
> contents of a netcdf file, as it can be very general.
> 
> Any help ?
> 
> Thanks in advance
> 
> h. yahia
> -----------------------------------------
> H. Yahia
> Senior researcher
> Clime project
> Inria Rocquencourt
> BP 105
> 78153 Le Chesnay Cedex
> Hussein.Yahia@xxxxxxxx
> http://www-air.inria.fr/People/Hussein.Yahia.html
> Tel : (+ 33 1) 39 63 53 57
> Fax: (+ 33 1) 39 63 58 80
> -----------------------------------------
> 
> 

-- 
Tom Whittaker (tomw@xxxxxxxxxxxxx)
University of Wisconsin-Madison
Space Science and Engineering Center
Cooperative Institute for Meteorological Satellite Studies
Phone/VoiceMail: 608.262.2759