NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

[netcdf-java] acces remote NetcdfSubset from NetCDF java library

Hi,

I would like to get data from a NetcdfSubset using the NetCDF java library.
I made different tries without any success.

I am passing through a proxy and I think the parameter were set correctly.
I tried either with the version 4.1 and 4.2 of the library.
With version 4.1 I used this code:

// Set proxy if specified 
if (this.proxyHost != null) {
        httpClient.getHostConfiguration().setProxy(
                this.proxyHost, 
                this.proxyPort);
}
NetcdfDataset.setHttpClient(httpClient);


With version 4.2 I used this code:

// Set proxy if specified 
if (this.proxyHost != null) {
        System.setProperty("http.proxyHost", this.proxyHost);
        System.setProperty("http.proxyPort", String.valueOf(this.proxyPort));
}



The URL I use to get the data is:
http://motherlode.ucar.edu:8080/thredds/ncss/grid/fmrc/NCEP/GFS/Global_0p5deg/runs/NCEP-GFS-Global_0p5deg_RUN_2011-04-01T00:00:00Z?var=U-component_of_wind_height_above_ground,V-component_of_wind_height_above_ground,Temperature_height_above_ground&temporal=range&time_start=2011-04-01T00:00:00&time_end=2011-04-08T12:00:00&spatial=bb&south=15.5&north=16.5&west=-62.0&east=-61.0

When I copy / paste this URL on my browser, I am able to save the nc file.
So I do not know I am doing wrong.

I tried both with either:

this.netcdfFile = NetcdfFile.open(filepath);
this.netcdfFile = NetcdfDataset.openFile(filepath, null);


But I get the same error at the end which is:
Cant read
http://motherlode.ucar.edu:8080/thredds/ncss/grid/fmrc/NCEP/GFS/Global_0p5deg/runs/NCEP-GFS-Global_0p5deg_RUN_2011-04-01T00:00:00Z?var=U-component_of_wind_height_above_ground,V-component_of_wind_height_above_ground,Temperature_height_above_ground&temporal=range&time_start=2011-04-01T00:00:00&time_end=2011-04-08T12:00:00&spatial=bb&south=15.5&north=16.5&west=-62.0&east=-61.0:
not a valid CDM file.

I also tried with:

NetcdfDataset.initNetcdfFileCache(100,200000,15*60);
this.netcdfFile = NetcdfDataset.acquireFile(filepath, null);


But again I got the same error.

Could somebody tell if what I am trying to do is possible. And if so help me
on how to do it.

Thanks,

Alex



--
View this message in context: 
http://netcdf-java.1577316.n2.nabble.com/acces-remote-NetcdfSubset-from-NetCDF-java-library-tp6326804p6326804.html
Sent from the NetCDF-Java mailing list archive at Nabble.com.



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