changeset 11997:e42d3999df8f octave-forge

add units and standard_name
author abarth93
date Thu, 01 Aug 2013 09:08:07 +0000
parents 5de6b07d0495
children b86d8743bf43
files extra/ncArray/inst/@ncArray/subsref.m extra/ncArray/inst/nccoord.m
diffstat 2 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/extra/ncArray/inst/@ncArray/subsref.m	Tue Jul 30 16:33:52 2013 +0000
+++ b/extra/ncArray/inst/@ncArray/subsref.m	Thu Aug 01 09:08:07 2013 +0000
@@ -23,7 +23,7 @@
 % catch expressions like:
 % data(:,:,:).coord
 
-if length(idx) == 2 && strcmp(idx(2).type,'.') && strcmp(idx(2).subs,'coord')    
+if length(idx) == 2 && strcmp(idx(2).type,'.') && strcmp(idx(2).subs,'coord')
     for i=1:length(self.coord)
         % get indeces of the dimensions of the i-th coordinate which are also
         % coordinate of the variable
--- a/extra/ncArray/inst/nccoord.m	Tue Jul 30 16:33:52 2013 +0000
+++ b/extra/ncArray/inst/nccoord.m	Thu Aug 01 09:08:07 2013 +0000
@@ -40,7 +40,8 @@
   if ~isempty(index)
     tmp = strsplit(vinfo.Attributes(index).Value,' ');
     
-    for i=1:length(tmp)
+    % order should not be siginficant
+    for i=length(tmp):-1:1
         coord = addcoord(coord,tmp{i},finfo);
     end
   end
@@ -70,7 +71,9 @@
         c.name = name;
         d = vinfo.Dimensions;
         c.dims = {d(:).Name};
-
+        c.standard_name = [];
+        c.units = [];
+        
         % get standard_name attribute if present
         i = find(strcmp('standard_name',{vinfo.Attributes(:).Name}));
         if ~isempty(i)