DaniSb170 / nctoolbox

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

Let's allow a single value for geosubset time #30

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If we want just a single time step when using geosubset, we shouldn't have to 
repeat that value twice, like:
s.time=[{[2011 11 30 6 0 0],[2011 11 30 6 0 0]}];

we should be able to just specify:
s.time=[2011 11 30 6 0 0]

Currently geosubset fails on this with:

>> us=uvar.geosubset(s);
Undefined function or variable "tmin_i".

Error in ncgeovariable/geosubset (line 459)
                        first = [tmin_i indstart_r indstart_c];

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

I'm attaching an example that works, but with two time arguments.  I want to 
have it work with one.

Thanks,
Rich

Original issue reported on code.google.com by rsignell on 30 Nov 2011 at 2:23

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by rsignell on 30 Nov 2011 at 3:19

GoogleCodeExporter commented 8 years ago

Original comment by rsignell on 30 Nov 2011 at 3:19

GoogleCodeExporter commented 8 years ago
I think technically it supposed to work if you do s.time = {[2011 11 30 6 0 
0]}, i guess i could make some changes

Original comment by crosb...@gmail.com on 30 Nov 2011 at 3:31

GoogleCodeExporter commented 8 years ago
I can't get the uploaded example to work. It seems the variables are returned 
as ncvariables and not ncgeovariables, so there is no geosubset method to use. 
Does this work for you?

Original comment by crosb...@gmail.com on 30 Nov 2011 at 6:24

GoogleCodeExporter commented 8 years ago
Strange.  It works fine for me:
# hg summary
parent: 199:0944ec41b984 tip
 Change to remove grid_interop conversion of lon values to -180/180 convention,
branch: default
commit: 3 modified, 6 unknown
update: (current)

Original comment by rsignell on 30 Nov 2011 at 6:31

GoogleCodeExporter commented 8 years ago
Have you changed the underlying libraries?

Original comment by crosb...@gmail.com on 30 Nov 2011 at 6:49

GoogleCodeExporter commented 8 years ago
Ah.... that's the difference.   I use (and have been using) the latest 
toolsUI-4.2.jar instead of all those separate jars.

        DYNAMIC JAVA PATH

    c:/rps/java/jar/toolsUI-4.2.jar

Original comment by rsignell on 30 Nov 2011 at 7:00

GoogleCodeExporter commented 8 years ago
I should have said "that's *likely* the difference".  I did not test.  I'm 
using toolsUI-4.2.jar downloaded October 27, 2011.

Original comment by rsignell on 30 Nov 2011 at 7:01

GoogleCodeExporter commented 8 years ago
We will have to see if Brian has had an problems in updating the toolbox to the 
newest netcdf-java.

Original comment by crosb...@gmail.com on 30 Nov 2011 at 7:06

GoogleCodeExporter commented 8 years ago
I'm in a class all this week. I haven't had a chance to update to the latest 
netcdf-java yet. If I get free minute I'll try later today.

Original comment by bschlin...@gmail.com on 30 Nov 2011 at 7:12

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
The data appears to be NaNs in this case, is that true? I've updated my toolbox 
to the equivalent jars in the current netcdf 4.2 all zipfile. Can you upload 
the plot you get at the end?

Original comment by crosb...@gmail.com on 5 Dec 2011 at 6:36

GoogleCodeExporter commented 8 years ago
It works for me.  Here is my latest version of the m-file and the plot it 
produces (I just ran it)

Original comment by rsignell on 5 Dec 2011 at 6:59

Attachments:

GoogleCodeExporter commented 8 years ago
New version works, old version does not. Must be a rolling archive of data

Original comment by crosb...@gmail.com on 5 Dec 2011 at 8:17

GoogleCodeExporter commented 8 years ago

Original comment by crosb...@gmail.com on 5 Dec 2011 at 8:23

GoogleCodeExporter commented 8 years ago
Excellent.  I verified that the attached script, which contains a single time 
value on the geosubset query structure works.  It works with datenum, datevec, 
or datestr.

Original comment by rsignell on 5 Dec 2011 at 8:33

Attachments: