Re: netCDF Java - Java Ncgen

Anh Tran wrote:
Institution: Data Center
Package Version: 2.2.12
Operating System: Windows
Hardware Information: Pentium 4
Inquiry: Dear John,
I try what you suggested by providing the full path for the files.  However it 
didn't work.  It give me the following errors:  (The system cannot find the path specified)
        at Method)
        at ucar.nc2.dataset.NetcdfDataset.openFile(
        at ucar.nc2.dataset.NetcdfDataset.openDataset(
        at ucar.nc2.ncml.NcMLReader.readNcML(
        at ucar.nc2.ncml.NcMLReader.readNcML(
        at ucar.nc2.ncml.NcMLReader.writeNcMLToFile(
        at dfo.Meds.argoNetcdf.CreateNetcdf.main(

Can you help me? Thanks

The file cant be opened at that path name "D:\\java 

check the path name really exists
maybe you dont have write permission?
try using your current directory??

BTW, you can use "/" instead of "\\", even on windows.


 * Created on 17-Jan-06
 * To change the template for this generated file go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
package dfo.Meds.argoNetcdf;

import ucar.ma2.*;
import ucar.nc2.*;
import ucar.nc2.ncml.*;
import ucar.nc2.dataset.*;
import ucar.nc2.FileWriter;

 * @author Tran
 * To change the template for this generated type comment go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
public class CreateNetcdf {
    public static void main(String[] args){
        try {
            InputStream in = new FileInputStream("D:\\java 
        }catch (IOException e){
} }



<?xml version='1.0' encoding='UTF-8'?>
<netcdf xmlns=''
    location='' >

  <dimension name='lat' length='3' />
  <dimension name='lon' length='4' />
  <dimension name='time' length='2' isUnlimited='true' />

  <attribute name='title' value='Example Data' />

  <variable name='rh' type='int' shape='time lat lon' >
    <attribute name='long_name' value='relative humidity' />
    <attribute name='units' value='percent' />
  <variable name='T' type='double' shape='time lat lon' >
    <attribute name='long_name' value='surface temperature' />
  <variable name='lat' type='float' shape='lat' >
    <attribute name='units' value='degree_north' />
  <variable name='lon' type='float' shape='lon' >
    <attribute name='units' value='degree_east' />
  <variable name='time' type='int' shape='time' >
    <attribute name='units' value='hours' />

  • 2006 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: