iousprafa / nctoolbox

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

error: No method 'findVariable' with matching signature found for class 'ucar.nc2.dataset.NetcdfDataset'. #61

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
good morning ...

I tried to follow this tip:

url = 'http://geoport.whoi.edu/thredds/dodsC/bathy/srtm30plus_v1.nc';
nc = ncgeodataset (url)
topovar nc.geovariable = ('top')
s.lon = [-71.2 -69.9]
s.lat = [41 42];
s.h_stride% = [2 2];% get every other value
g = topovar.geosubset (s)
imagesC (g.grid.lon, g.grid.lat, g.data); axis xy; colorbar;
title ('SRTM (m)')

and run the file aprece the following error:

>> g=topovar.geosubset(s)
??? No method 'findVariable' with matching signature found for class
'ucar.nc2.dataset.NetcdfDataset'.

Error in ==> ncdataset>ncdataset.findvariable at 445
            v = obj.netcdf.findVariable(variable);

Error in ==> ncdataset>ncdataset.attributes at 256
                v = obj.findvariable(variable);

Error in ==> ncgeodataset>ncgeodataset.geovariable at 147
                att = obj.attributes(variableName);

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

Error in ==> ncgeovariable>ncgeovariable.getlonvar at 373
            lv = src.dataset.geovariable(tn);

Error in ==> ncgeovariable>ncgeovariable.getlondata at 464
            [v, type] = src.getlonvar;

Error in ==> ncgeovariable>ncgeovariable.geoij at 820
                    [g.lon, typex] = obj.getlondata([1, 1], obj.size, [1,
                    1]);

Error in ==> ncgeovariable>ncgeovariable.geosubset at 631
            [indstart_r indend_r indstart_c indend_c] = obj.geoij(struct);

Error in ==> ncgeovariable>ncgeovariable.subsref at 1052
                            sref = builtin('subsref',obj,s);

help???

Original issue reported on code.google.com by lfelip...@gmail.com on 4 Nov 2013 at 4:43

GoogleCodeExporter commented 8 years ago
I ran the following:

url = 'http://geoport.whoi.edu/thredds/dodsC/bathy/srtm30plus_v1.nc';
nc = ncgeodataset (url);
topovar = nc.geovariable('topo');
s.lon = [-71.2 -69.9];
s.lat = [41 42];
s.h_stride = [2 2];  % get every other value
g = topovar.geosubset(s);
imagesc(g.grid.lat, g.grid.lon, g.data); axis xy; colorbar;
title('SRTM (m)');

The above code ran fine. I'm unable to duplicate your error. It looks like your 
syntax is not quite correct. Can you try my code snipped above and see if it 
works for you.

Original comment by bschlin...@gmail.com on 4 Nov 2013 at 5:27

GoogleCodeExporter commented 8 years ago

Working through the syntax issues seems to clear it up.  Brian's code works 
fine.

First errors were on: 

     topovar nc.geovariable = ('top')

Which has the equals sign in the wrong place, then misspells 'topo'.

I'd say close this issue.

Original comment by drf...@gmail.com on 14 Apr 2014 at 5:47