DaniSb170 / nctoolbox

Automatically exported from code.google.com/p/nctoolbox
0 stars 0 forks source link

Demos using cfdataset fail #10

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I was going to release your new indexing in NCTOOLBOX but some of the demos are 
failing. I'll look into it but if anyone has any ideas on what's going on give 
me a heads up.

What steps will reproduce the problem?

1. close all;clear all;demo7

??? Attempt to reference field of non-structure array.

Error in ==> demo7 at 29
plot(ds.time('TIME', t.TIME), t.TEMP)

-----------------------------------------------
2. close all;clear all;demo8

??? Java exception occurred:
ucar.ma2.InvalidRangeException: last (0) must be >= first (12408)
    at ucar.ma2.Range.<init>(Range.java:146)
    at ucar.ma2.Range.<init>(Range.java:130)

Error in ==> ncdataset>ncdataset.data at 190
                    ranges.add(ucar.ma2.Range(first(i) - 1, last(i) - 1, stride(i)));

Error in ==> cfdataset>cfdataset.subsref at 351
                            B = builtin('subsref',obj,g);

Error in ==> ncvariable>ncvariable.somedata at 490
                data = obj.dataset.data(name, first, last, stride);

Error in ==> ncvariable>ncvariable.data at 156
                d = somedata(obj, 1, first, last, stride);

Error in ==> ncvariable>ncvariable.subsref at 407
                                sref = obj.data(first, last, stride);

Error in ==> demo8 at 16
t = v.data([sz(1) sz(2) 1 1], [sz(1) sz(2) sz(3) sz(4)]);

------------------------------------------
3. close all;clear all;demo9

??? Java exception occurred:
ucar.ma2.InvalidRangeException: last (0) must be >= first (12408)
    at ucar.ma2.Range.<init>(Range.java:146)
    at ucar.ma2.Range.<init>(Range.java:130)

Error in ==> ncdataset>ncdataset.data at 190
                    ranges.add(ucar.ma2.Range(first(i) - 1, last(i) - 1, stride(i)));

Error in ==> cfdataset>cfdataset.subsref at 351
                            B = builtin('subsref',obj,g);

Error in ==> ncvariable>ncvariable.somedata at 490
                data = obj.dataset.data(name, first, last, stride);

Error in ==> ncvariable>ncvariable.data at 156
                d = somedata(obj, 1, first, last, stride);

Error in ==> ncvariable>ncvariable.subsref at 407
                                sref = obj.data(first, last, stride);

Error in ==> cfdataset>cfdataset.struct at 235
                s = v.data(first, last, stride);

Error in ==> cfdataset>cfdataset.subsref at 351
                            B = builtin('subsref',obj,g);

Error in ==> demo9 at 15
t = ds.struct('temp', [sz(1) sz(2) 1 1], [sz(1) sz(2) sz(3) sz(4)]);

-----------------------------------------------
4. close all;clear all;demo9a

??? Java exception occurred:
ucar.ma2.InvalidRangeException: last (0) must be >= first (12408)
    at ucar.ma2.Range.<init>(Range.java:146)
    at ucar.ma2.Range.<init>(Range.java:130)

Error in ==> ncdataset>ncdataset.data at 190
                    ranges.add(ucar.ma2.Range(first(i) - 1, last(i) - 1, stride(i)));

Error in ==> cfdataset>cfdataset.subsref at 351
                            B = builtin('subsref',obj,g);

Error in ==> ncvariable>ncvariable.somedata at 551
                    data.(name) = obj.dataset.data(name, vFirst, vLast, vStride);

Error in ==> ncvariable>ncvariable.grid at 208
                g = somedata(obj, 0, first, last, stride);

Error in ==> ncvariable>ncvariable.subsref at 426
                                sref = obj.grid(first, last, stride);

Error in ==> cfdataset>cfdataset.grid at 303
                s = v.grid(first, last, stride);

Error in ==> cfdataset>cfdataset.subsref at 351
                            B = builtin('subsref',obj,g);

Error in ==> demo9a at 22
t = ds.grid('temp', [sz(1) sz(2) 1 1], [sz(1) sz(2) sz(3) sz(4)]);

Original issue reported on code.google.com by bschlin...@gmail.com on 30 Mar 2011 at 10:50

GoogleCodeExporter commented 8 years ago
Alex, Can you look at this issue? It looks like its caused by the subsref 
implementation in cfdataset. My ideal solution would be to modify cfdataset so 
that demos 7, 8, 9 and 9a run without having to make any changes to them.

Original comment by bschlin...@gmail.com on 13 Apr 2011 at 4:35

GoogleCodeExporter commented 8 years ago
I think all of these problems come from the way I am handling indexing in 
ncvariable, since ncvariable now implements matlab indexing. There were some 
assorted things in the scripts I also changed a bit. 

I think these changes uncover some design changes that You, Rich and I should 
talk about. 

Original comment by crosb...@gmail.com on 13 Apr 2011 at 5:37

GoogleCodeExporter commented 8 years ago
OK, Can we have a meeting of the minds tomorrow? If so, what time works for 
y'all?

Original comment by bschlin...@gmail.com on 13 Apr 2011 at 5:40

GoogleCodeExporter commented 8 years ago
I'll have to get in touch with Rich, I know he has been traveling. I think I 
have fixed the issues. Things should be tested thoroughly though. 

Original comment by crosb...@gmail.com on 13 Apr 2011 at 5:54

GoogleCodeExporter commented 8 years ago
OK, when you get a chance push the changes over to the main repo and I'll take 
them for a spin tomorrow.

Original comment by bschlin...@gmail.com on 13 Apr 2011 at 5:55

GoogleCodeExporter commented 8 years ago
Should be up now

Original comment by crosb...@gmail.com on 13 Apr 2011 at 5:58