DaniSb170 / nctoolbox

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

Subset problem with HYCOM dataset #16

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I have a sample HYCOM dataset, where SSH is recognized as a "grid" variable 
that displays correctly in ToolsUI, but when I try to subsample using the 
geodataset/geovariable/geosubset method , I get an error:

url='http://geoport.whoi.edu/thredds/dodsC/usgs/data1/rsignell/models/glb_analys
is/test.nc';
nc=ncgeodataset(url);
svar=nc.geovariable('ssh');
s.lat=[39.5 46];
s.lon=[-71.4 -63];
ssh=svar.geosubset(s);

Error using ncgeovariable/geosubset (line 456)
Expected either a coordinate variable acknowleged as time or as z.

Error in ncgeovariable/subsref (line 656)
                            sref = builtin('subsref',obj,s);

Original issue reported on code.google.com by rsignell on 12 Oct 2011 at 7:52

GoogleCodeExporter commented 8 years ago
I'll take a look, but my computer doesn't seem to have enough memory to get to 
the error. The error its throwing is a catch all for if it can't find time or z 
in the cdm, but my logic looks wrong so I'm going to make a change and send it 
back over to you. (It is also possible that your memory is throwing an error, 
but it happens to be in a try block where I return that standard error message)

Original comment by crosb...@gmail.com on 12 Oct 2011 at 8:39

GoogleCodeExporter commented 8 years ago

Original comment by crosb...@gmail.com on 12 Oct 2011 at 8:39

GoogleCodeExporter commented 8 years ago
Your fixes apparently worked:

url='http://geoport.whoi.edu/thredds/dodsC/usgs/data1/rsignell/models/glb_analys
is/test.nc';
nc=ncgeodataset(url);
svar=nc.geovariable('ssh');
s.lat=[39.5 46];
s.lon=[-71.4 -63];
ssh=svar.geosubset(s);
>> ssh

ssh = 

    data: [1x111x105 single]
    grid: [1x1 struct]

>> ssh.grid

ans = 

     lon: [111x105 single]
     lat: [111x105 single]
    Date: 20110108
    time: 734511
       Y: [111x1 int32]
       X: [105x1 int32]

Original comment by rsignell on 12 Oct 2011 at 9:02

GoogleCodeExporter commented 8 years ago
Revision ca75ddb5c542 seems to solve the problem. There was an error in logic 
for 3 dimensional data and I'm surprised it hadn't been an issue until now.

Original comment by crosb...@gmail.com on 13 Oct 2011 at 1:09

GoogleCodeExporter commented 8 years ago

Original comment by crosb...@gmail.com on 18 Oct 2011 at 5:01