Closed GoogleCodeExporter closed 8 years ago
Can you attach a sample netcdf file that causes this error?
Original comment by bschlin...@gmail.com
on 11 Feb 2013 at 4:32
Attached is a file, as requested. The 'time' variable was the last one written
to the file.
Original comment by barnett....@gmail.com
on 11 Feb 2013 at 4:35
Attachments:
For my reference, Here's the CDL for the attached file:
netcdf /Users/brian/Downloads/Canada_DAILY_EASE-F13-NL2000.37 {
dimensions:
Y = 212;
T = 366;
X = 401;
variables:
double time(T=366);
:units = "hours since 2000-01-01 00:00:00 00:00";
:standard_name = "time";
:long_name = "time";
:_FillValue = -1000000.0; // double
:_CoordinateAxisType = "Time";
double longitude(X=401, Y=212);
:_Netcdf4Dimid = 1; // int
:units = "degrees_east";
:standard_name = "longitude";
:long_name = "longitude";
:_FillValue = -1000000.0; // double
:_CoordinateAxisType = "Lon";
double latitude(X=401, Y=212);
:_Netcdf4Dimid = 1; // int
:units = "degrees_north";
:standard_name = "latitude";
:long_name = "latitude";
:_FillValue = -1000000.0; // double
:_CoordinateAxisType = "Lat";
}
Original comment by bschlin...@gmail.com
on 11 Feb 2013 at 4:40
I executed the following on :
Mac OS X 10.8.2
Matlab version 8.0.0.783 (R2012b)
Java 1.6.0_37-b06-434-11M3909 with Apple Inc. Java HotSpot(TM) 64-Bit Server VM
mixed mode
nctoolbox version: HEAD (694674eae0) from https://github.com/nctoolbox/nctoolbox
>> n = ncgeodataset('/Users/brian/Downloads/Canada_DAILY_EASE-F13-NL2000.37')
n =
ncgeodataset handle
Properties:
location: '/Users/brian/Downloads/Canada_DAILY_EASE-F13-NL2000.37'
netcdf: [1x1 ucar.nc2.dataset.NetcdfDataset]
variables: {3x1 cell}
Methods, Events, Superclasses
>> n.attributes('time')
ans =
'units' 'hours since 2000-01-01 00:00:00 00:00'
'standard_name' 'time'
'long_name' 'time'
'_FillValue' [ -1000000]
'_CoordinateAxisType' 'Time'
>> value4key(n.attributes('time'),'units')
ans =
hours since 2000-01-01 00:00:00 00:00
Original comment by bschlin...@gmail.com
on 11 Feb 2013 at 4:45
Yes, the time variable was the last one written to the file, so it also gives
the proper response on my system (as in step 3 above). However, the latitude
and longitude variables give the error message. Is it the same for you?
Original comment by barnett....@gmail.com
on 11 Feb 2013 at 4:48
Hmmm, I can't duplicate the issue. I don't know how recent your version of
nctoolbox is. The first thing you could do is get the latest from
https://github.com/nctoolbox/nctoolbox/tags and see if that makes the problem
go away. If it doesn't address the issue let me know.
Original comment by bschlin...@gmail.com
on 11 Feb 2013 at 4:50
OK, yes, I can duplicate it with 'latitude' and 'longitude'.
>> n.attributes('latitude')
Error using ncdataset/attributes (line 269)
Java exception occurred:
java.lang.IllegalArgumentException: java.lang.IllegalArgumentException
at ucar.ma2.Array.copyToNDJavaArray(Array.java:770)
Caused by: java.lang.IllegalArgumentException
at java.lang.reflect.Array.multiNewArray(Native Method)
at java.lang.reflect.Array.newInstance(Array.java:90)
at ucar.ma2.Array.copyToNDJavaArray(Array.java:768)
Error in ncgeodataset/subsref (line 378)
B = builtin('subsref',obj,g);
>> n.attributes('longitude')
Error using ncdataset/attributes (line 269)
Java exception occurred:
java.lang.IllegalArgumentException: java.lang.IllegalArgumentException
at ucar.ma2.Array.copyToNDJavaArray(Array.java:770)
Caused by: java.lang.IllegalArgumentException
at java.lang.reflect.Array.multiNewArray(Native Method)
at java.lang.reflect.Array.newInstance(Array.java:90)
at ucar.ma2.Array.copyToNDJavaArray(Array.java:768)
Error in ncgeodataset/subsref (line 378)
B = builtin('subsref',obj,g);
Original comment by bschlin...@gmail.com
on 11 Feb 2013 at 4:52
OK, I found what's going on. Give me a little bit to fix it.
Original comment by bschlin...@gmail.com
on 11 Feb 2013 at 4:55
OK, I posted a bug fix for you. You can download nctoolbox-20130211 from
https://github.com/nctoolbox/nctoolbox/tags
Original comment by bschlin...@gmail.com
on 11 Feb 2013 at 5:07
fixed
Original comment by bschlin...@gmail.com
on 11 Feb 2013 at 5:10
Code fix can be viewed at
https://github.com/nctoolbox/nctoolbox/commit/003c68761e8bb0e085fd0b9d77ed41f2e6
9ff3d0
Original comment by bschlin...@gmail.com
on 11 Feb 2013 at 5:11
Thank you very much!
Original comment by barnett....@gmail.com
on 11 Feb 2013 at 5:12
You're welcome!
Original comment by bschlin...@gmail.com
on 11 Feb 2013 at 5:14
Original issue reported on code.google.com by
barnett....@gmail.com
on 11 Feb 2013 at 4:25