Changeset 55 for trunk/src/struct2nc.m


Ignore:
Timestamp:
Mar 17, 2010, 10:26:41 AM (15 years ago)
Author:
sommeria
Message:

-use of a single parameter file PARAM.xml (instead of PARAM_WIN and PARAM_LINUX).
-correction of a bug for opening an existing projection object
-manual editing of vectors made available with the builtin netcdf tool.
-bug fix for reading netcdf files with the builtin netcdf tool.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/struct2nc.m

    r45 r55  
    1010%  Data: structure containing all the information of the netcdf file (or netcdf object)
    1111%           with fields:
    12 %    .ListGlobalAttribute: cell listing the names of the global attributes (note that a global atribute with the same name as a variable is excluded)
    13 %        .Att_1,Att_2... : values of the global attributes
    14 %            .ListDimName: cell listing the names of the array dimensions
    15 %               .DimValue: array dimension values (Matlab vector with the same length as .ListDimName
    16 %            .ListVarName: cell listing the names of the variables
    17 %            .VarDimIndex: cell containing the set of dimension indices (in list .ListDimName) for each variable of .ListVarName
    18 %           .VarAttribute: cell of structures s containing names and values of variable attributes (s.name=value) for each variable of .ListVarName
    19 %        .Var1, .Var2....: variables (Matlab arrays) with names listed in .ListVarName
     12%         (optional) .ListGlobalAttribute: cell listing the names of the global attributes
     13%                    .Att_1,Att_2... : values of the global attributes
     14%         (requested)  .ListVarName: list of variable names to select (cell array of  char strings {'VarName1', 'VarName2',...} )
     15%         (requested)  .VarDimName: list of dimension names for each element of .ListVarName (cell array of string cells)                         
     16%         (requested) .Var1, .Var2....: variables (Matlab arrays) with names listed in .ListVarName
    2017%
    2118%AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
     
    126123                break
    127124            end
    128             if testline || testrange%NEW
     125            if testline || testrange
    129126                if testrange
    130                     VarVal=linspace(VarVal(1),VarVal(2),Data.DimValue(VarDimIndex));%NEW
     127                    VarVal=linspace(VarVal(1),VarVal(2),Data.DimValue(VarDimIndex));
    131128                end
    132129               %nc{ListVarName{ivar}}=ncfloat(Data.ListDimName(VarDimIndex));%vector of x coordinates
    133                netcdf.putVar(nc,varid(ivar), VarVal');
     130               netcdf.putVar(nc,varid(ivar), double(VarVal'));
    134131            else
    135                 netcdf.putVar(nc,varid(ivar), VarVal);
     132                netcdf.putVar(nc,varid(ivar), double(VarVal));
    136133                %nc{ListVarName{ivar}}(:) = VarVal;
    137134            end
Note: See TracChangeset for help on using the changeset viewer.