Open GoogleCodeExporter opened 8 years ago
*Summary of problem*
line 147 is:
javaaxisvar = src.dataset.netcdf.findVariable(tempname);
findVariable is returning some subtype of uvar.nc2.Variable. However, line 148
is calling the 'getAxisType()' method, which is only available on one specific
subtype of Variable called CoordinateAxis. We have no guarantees that the
getAxisType method is actually present.
*Solution*
replace line 148 in nctoolbox/cdm/ncgeovariable.m:
type = char(javaaxisvar.getAxisType());
with:
try
type = char(javaaxisvar.getAxisType());
catch me
type = '';
end
I've changed this in code an will check in the fix. It will be available in the
next release of nctoolbox. In the meantime, if you need this fix just make the
change described above.
Original comment by bschlin...@gmail.com
on 19 Jun 2012 at 7:53
This issue was closed by revision b0ceec5f5146.
Original comment by bschlin...@gmail.com
on 19 Jun 2012 at 8:01
No guarantees that the grids that are returned are inter-operable though, is
that right?
For some reason netcdf-java cdm isn't considering XLONG or XLAT as
CoordinateAxis, thats a little odd and worth investigation.
Original comment by crosb...@gmail.com
on 19 Jun 2012 at 8:17
How come the NetCDF-Java ToolsUI 4.3 works fine on this dataset?
Is there a way to see what methods it's using (kind of like a firebug for java,
or something?)
-Rich
Original comment by rsignell
on 19 Jun 2012 at 9:18
We're still using netcdf-4.2 with nctoolbox. I'm happy to bump up to 4.3 but
one of y'all will have to go through and test your stuff with it.
Original comment by bschlin...@gmail.com
on 19 Jun 2012 at 9:56
p.s. @rsignell, yes, you can run the ToolsUI using a Java debugger to see the
execution path. See:
http://www.jetbrains.com/idea/
http://www.eclipse.org/
http://netbeans.org/
Original comment by bschlin...@gmail.com
on 19 Jun 2012 at 10:00
I didn't mean to imply that we needed to go to netcdf-java 4.3 -- this data set
opens fine in netcdf-java ToolsUI 4.2 as well. I just meant that we should be
doing it however ToolsUI is doing it!
Original comment by rsignell
on 19 Jun 2012 at 10:43
Brian,
I reopened this ticket because the grid_interop method is supposed to only
return coordinate variable names from this list [time z lat lon] no matter what
the original coordinate names are.
The example below returns XLONG and XLAT instead of "lon" and "lat".
I hope this is relatively easy to fix...
>>
url='http://geoport.whoi.edu/thredds/dodsC/usgs/data1/rsignell/test/wrfout_d01_2
0120617_0000.nc';
nc=ncgeodataset(url);
tvar=nc.geovariable('T2');
t=tvar.data(:);
g=tvar.grid_interop(:);
>> g
g =
XLONG: [1x350x348 single]
XLAT: [1x350x348 single]
time: 7.3504e+05
>>
Original comment by rsignell
on 20 Jun 2012 at 2:21
Ill take over.
Grid_interop is doing as expected because XLONG and XLAT arn't recognized by
the way we interact with the cdm as being CoordinateAxis. Grid_interop returns
all coordinate variables and only renames the ones that the cdm identifies as
being coordinate axes of certain types (depths/elevation/lat/lon/time/etc). We
need to take a look at how toolsUI is doing it, its a tricky dataset.
Original comment by crosb...@gmail.com
on 20 Jun 2012 at 3:17
I can't quite seem to figure out how to do this. Is there a good resource I
could use to figure it out, my standard google techniques are failing me.
>p.s. @rsignell, yes, you can run the ToolsUI using a Java debugger to see the
>execution path. See:
>
>http://www.jetbrains.com/idea/
>http://www.eclipse.org/
>http://netbeans.org/
Original comment by crosb...@gmail.com
on 21 Jun 2012 at 6:26
Do you mean you couldn't figure out how to use one of the tools Brian listed to
diagnose what routines ToolsUI is using?
Original comment by rsignell
on 21 Jun 2012 at 6:58
Yes, i have eclipse and netbeans, but I have no idea how to attach a jar to it.
If i had the source i could create a project and run the main method, but i
feel like thats not what Brian meant.
Original comment by crosb...@gmail.com
on 21 Jun 2012 at 7:01
Are we stuck here? Brian, can you help Alex figure out how to attach a jar to
either eclipse or netbeans so he can figure out what ToolsUI is doing to handle
this dataset?
Original comment by rsignell
on 3 Jul 2012 at 1:40
Yes stuck
Original comment by crosb...@gmail.com
on 3 Jul 2012 at 1:42
Hey Guys, I can help out on next Monday. I'm on vacation this week.
But yes, Alex, it's probably easiest to just check out the Thredds/NetCDF
source and run the ToolsUI in a debugger. With the source code you can set some
break-points and step through code to figure out what's going on.
Original comment by bschlin...@gmail.com
on 3 Jul 2012 at 2:51
Going to try and find time to sort this out this month.
Original comment by crosb...@gmail.com
on 7 Jan 2013 at 3:03
Original issue reported on code.google.com by
rsignell
on 17 Jun 2012 at 8:33