Home > matpower5.0 > psse_parse.m

psse_parse

PURPOSE ^

PSSE_PARSE Parses the data from a PSS/E RAW data file.

SYNOPSIS ^

function [data, warns] = psse_parse(records, sections, verbose, rev)

DESCRIPTION ^

PSSE_PARSE  Parses the data from a PSS/E RAW data file.
   DATA = PSSE_PARSE(RECORDS, SECTIONS)
   DATA = PSSE_PARSE(RECORDS, SECTIONS, VERBOSE)
   DATA = PSSE_PARSE(RECORDS, SECTIONS, VERBOSE, REV)
   [DATA, WARNINGS] = PSSE_PARSE(RECORDS, SECTIONS, ...)

   Parses the data from a PSS/E RAW data file (as read by PSSE_READ)
   into a struct.

   Inputs:
       RECORDS : cell array of strings, corresponding to the lines
                 in the RAW file
       SECTIONS : struct array with indexes marking the beginning
                  and end of each section, and the name of the
                  section, fields are:
           first   : index into RECORDS of first line of section
           last    : index into RECORDS of last line of section
           name    : name of the section, as extracted from the
                     END OF ... DATA comments
       VERBOSE      :  1 (default) to display progress info, 0 otherwise
       REV          :  (optional) assume the input file is of this
                       PSS/E revision number, attempts to determine
                       REV from the file by default

   Output(s):
       DATA :  a struct with the following fields, each with two
               sub-fields, 'num' and 'txt' containing the numeric and
               text data read from the file for the corresponding section
           id
           bus
           load
           gen
           shunt
           branch
           trans2
           trans3
           area
           twodc
           swshunt
       WARNINGS :  cell array of strings containing accumulated
                   warning messages

   See also PSSE2MPC, PSSE_READ, PSSE_PARSE_SECTION, PSSE_PARSE_LINE

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function [data, warns] = psse_parse(records, sections, verbose, rev)
0002 %PSSE_PARSE  Parses the data from a PSS/E RAW data file.
0003 %   DATA = PSSE_PARSE(RECORDS, SECTIONS)
0004 %   DATA = PSSE_PARSE(RECORDS, SECTIONS, VERBOSE)
0005 %   DATA = PSSE_PARSE(RECORDS, SECTIONS, VERBOSE, REV)
0006 %   [DATA, WARNINGS] = PSSE_PARSE(RECORDS, SECTIONS, ...)
0007 %
0008 %   Parses the data from a PSS/E RAW data file (as read by PSSE_READ)
0009 %   into a struct.
0010 %
0011 %   Inputs:
0012 %       RECORDS : cell array of strings, corresponding to the lines
0013 %                 in the RAW file
0014 %       SECTIONS : struct array with indexes marking the beginning
0015 %                  and end of each section, and the name of the
0016 %                  section, fields are:
0017 %           first   : index into RECORDS of first line of section
0018 %           last    : index into RECORDS of last line of section
0019 %           name    : name of the section, as extracted from the
0020 %                     END OF ... DATA comments
0021 %       VERBOSE      :  1 (default) to display progress info, 0 otherwise
0022 %       REV          :  (optional) assume the input file is of this
0023 %                       PSS/E revision number, attempts to determine
0024 %                       REV from the file by default
0025 %
0026 %   Output(s):
0027 %       DATA :  a struct with the following fields, each with two
0028 %               sub-fields, 'num' and 'txt' containing the numeric and
0029 %               text data read from the file for the corresponding section
0030 %           id
0031 %           bus
0032 %           load
0033 %           gen
0034 %           shunt
0035 %           branch
0036 %           trans2
0037 %           trans3
0038 %           area
0039 %           twodc
0040 %           swshunt
0041 %       WARNINGS :  cell array of strings containing accumulated
0042 %                   warning messages
0043 %
0044 %   See also PSSE2MPC, PSSE_READ, PSSE_PARSE_SECTION, PSSE_PARSE_LINE
0045 
0046 %   MATPOWER
0047 %   $Id: psse_parse.m 2371 2014-08-05 01:28:35Z ray $
0048 %   by Ray Zimmerman, PSERC Cornell
0049 %   Based on mpreadraw.m, written by: Yujia Zhu, Jan 2014, yzhu54@asu.edu.
0050 %   Copyright (c) 2014 by Power System Engineering Research Center (PSERC)
0051 %
0052 %   This file is part of MATPOWER.
0053 %   See http://www.pserc.cornell.edu/matpower/ for more info.
0054 %
0055 %   MATPOWER is free software: you can redistribute it and/or modify
0056 %   it under the terms of the GNU General Public License as published
0057 %   by the Free Software Foundation, either version 3 of the License,
0058 %   or (at your option) any later version.
0059 %
0060 %   MATPOWER is distributed in the hope that it will be useful,
0061 %   but WITHOUT ANY WARRANTY; without even the implied warranty of
0062 %   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0063 %   GNU General Public License for more details.
0064 %
0065 %   You should have received a copy of the GNU General Public License
0066 %   along with MATPOWER. If not, see <http://www.gnu.org/licenses/>.
0067 %
0068 %   Additional permission under GNU GPL version 3 section 7
0069 %
0070 %   If you modify MATPOWER, or any covered work, to interface with
0071 %   other modules (such as MATLAB code and MEX-files) available in a
0072 %   MATLAB(R) or comparable environment containing parts covered
0073 %   under other licensing terms, the licensors of MATPOWER grant
0074 %   you additional permission to convey the resulting work.
0075 
0076 %% default args
0077 if nargin < 4
0078     rev = 0;
0079     if nargin < 3
0080         verbose = 0;
0081     end
0082 end
0083 defaultrev = 23;
0084 
0085 %% inititialize section counter
0086 s = 1;
0087 warns = {};
0088 
0089 %%-----  case identification data  -----
0090 %% In some files, SBASE is followed by a comment with the REV number such as:
0091 %%  / PSS/E-29.0
0092 %%  / PSS(tm)E-30 RAW
0093 if verbose
0094     if rev
0095         fprintf('Forcing interpretation as PSS/E revision %d\n', rev);
0096     else
0097         fprintf('Attempting to determine PSS/E revision from content.\n');
0098     end
0099     fprintf('Parsing case identification data ...');
0100 end
0101 if rev
0102     warns{end+1} = sprintf('Conversion explicitly using PSS/E revision %d', rev);
0103 end
0104 [d, c] = psse_parse_line(records{1}, 'dfdfff');
0105 nn = length(d);
0106 data.id.IC = d{1};
0107 if isempty(d{2}) || d{2} <= 0
0108     error('ERROR: Probable corrupt file, unable to read a valid SBASE value from the first line.');
0109 else
0110     data.id.SBASE = d{2};
0111 end
0112 if ~isempty(d{3})
0113     data.id.REV = d{3};
0114 else    %% attempt to extract revision from comment
0115     tmp = regexp(c, 'PSS(/|\(tm\))E-(?<rev>\d+)', 'tokens');
0116     if ~isempty(tmp) && size(tmp{1}, 2) == 2
0117         data.id.REV = str2num(tmp{1}{2});
0118     else
0119         data.id.REV = 0;
0120     end
0121 end
0122 if ~isempty(d{4})
0123     data.id.XFRRAT = d{4};
0124 else
0125     data.id.XFRRAT = 0;
0126 end
0127 if ~isempty(d{5})
0128     data.id.NXFRAT = d{5};
0129 else
0130     data.id.NXFRAT = 0;
0131 end
0132 if ~isempty(d{6})
0133     data.id.BASFRQ = d{6};
0134 else
0135     data.id.BASFRQ = 0;
0136 end
0137 data.id.comment0 = c;
0138 data.id.comment1 = records{2};
0139 data.id.comment2 = records{3};
0140 if verbose
0141     if rev
0142         if data.id.REV
0143             fprintf('.. override detected rev %2d w/%2d ... done.\n', data.id.REV, rev);
0144         else
0145             fprintf('...... unknown rev, using rev %2d ... done.\n', rev);
0146         end
0147     else
0148         if data.id.REV
0149             fprintf('......... rev %2d format detected ... done.\n', data.id.REV);
0150         else
0151             fprintf('...... unknown rev, using rev %2d ... done.\n', defaultrev);
0152         end
0153     end
0154 end
0155 if ~rev
0156     if data.id.REV
0157         rev = data.id.REV;      %% use detected value
0158     else
0159         rev = defaultrev;       %% none detected, use default value
0160         data.id.REV = defaultrev;
0161         warns{end+1} = sprintf('Unknown REV, using REV %2d format.', defaultrev);
0162     end
0163 else
0164     data.id.REV = rev;          %% use override value
0165 end
0166 if isempty(data.id.IC) || data.id.IC ~= 0
0167     warns{end+1} = sprintf('IC = %d indicates that this may be a change case, rather than base case\n         PSSE2MPC is NOT designed to handle change cases.', data.id.IC);
0168     if verbose
0169         fprintf('WARNING : %s\n', warns{end});
0170     end
0171 end
0172 s = s + 1;
0173 
0174 %%-----  bus data  -----
0175 if rev < 24         %% includes load data
0176     [data.bus, warns] = psse_parse_section(warns, records, sections, s, verbose, ...
0177         'bus', 'ddffffdffsfd');
0178 elseif rev < 31     %% includes fixed shunt data, load separate
0179     [data.bus, warns] = psse_parse_section(warns, records, sections, s, verbose, ...
0180         'bus', 'dsfdffddffd');
0181 else                %% fixed shunt and load data separate
0182     [data.bus, warns] = psse_parse_section(warns, records, sections, s, verbose, ...
0183         'bus', 'dsfddddffff..');
0184 %       'bus', 'dsfddddffffff');
0185 end
0186 s = s + 1;
0187 
0188 %%-----  load data  -----
0189 if rev >= 24
0190     [data.load, warns] = psse_parse_section(warns, records, sections, s, verbose, ...
0191         'load', 'd.d..ffffff...');
0192 %       'load', 'dsdddffffffddd');
0193     s = s + 1;
0194 end
0195 
0196 %%-----  fixed shunt data  -----
0197 if rev > 30     %% fixed shunt data is included in bus data for rev <= 30
0198     [data.shunt, warns] = psse_parse_section(warns, records, sections, s, verbose, ...
0199         'fixed shunt', 'd.dff');
0200 %       'fixed shunt', 'dsdff');
0201     s = s + 1;
0202 end
0203 
0204 %%-----  generator data  -----
0205 [data.gen, warns] = psse_parse_section(warns, records, sections, s, verbose, ...
0206     'generator', 'd.fffff.f.....d.ff...........');
0207 %   'generator', 'dsfffffdffffffdfffdfdfdfdfsdf');
0208 s = s + 1;
0209 
0210 %%-----  branch data  -----
0211 if rev <= 27   %% includes transformer ratio, angle
0212     [data.branch, warns] = psse_parse_section(warns, records, sections, s, verbose, ...
0213         'branch', 'dd.ffffffffffffd');
0214 %       'branch', 'dddffffffffffffd');
0215 elseif rev < 31
0216     [data.branch, warns] = psse_parse_section(warns, records, sections, s, verbose, ...
0217         'branch', 'dd.ffffffffffd');
0218 %       'branch', 'ddsffffffffffdfdfdfdfdf');
0219 else
0220     [data.branch, warns] = psse_parse_section(warns, records, sections, s, verbose, ...
0221         'branch', 'dd.ffffffffffd');
0222 %       'branch', 'ddsffffffffffddfdfdfdfdf');
0223 end
0224 s = s + 1;
0225 
0226 %%-----  skip transformer adjustment data  -----
0227 if rev <= 27
0228     [s, warns] = psse_skip_section(warns, sections, s, verbose, 'transformer adjustment');
0229 end
0230 
0231 %%-----  transformer data  -----
0232 if rev > 27
0233     %% PSS/E stores two winding and three winding transformer data in the same
0234     %% section in RAW file. We read in 2 passes, first pass determines the type of
0235     %% each, second pass reads the data.
0236     label = 'transformer';
0237     if ~isempty(sections(s).name) && ~strcmpi(label, sections(s).name)
0238         if verbose > 1
0239             fprintf('-----  WARNING:  Expected section labeled: ''%s''\n', upper(label));
0240             fprintf('-----            Found section labeled:    ''%s''\n', sections(s).name);
0241         end
0242     end
0243 
0244     %% Step 1 : Count and collect transformer types
0245     if verbose
0246         fprintf('Analyzing transformer types ...');
0247     end
0248 
0249     %% estimate max number of transformers by number of lines in section
0250     nt2 = round((sections(s).last - sections(s).first + 1) / 4);
0251     nt3 = round((sections(s).last - sections(s).first + 1) / 5);
0252 
0253     %% initialize indexes for transformer types
0254     idx2 = zeros(nt2, 1);
0255     idx3 = zeros(nt3, 1);
0256 
0257     %% set up counters
0258     i = sections(s).first;      %% initialize record index
0259     i2 = 0;
0260     i3 = 0;
0261 
0262     while i <= sections(s).last
0263         %% determine transformer type
0264         pat = '[^''",\s/]+\s*(,|\s)\s*[^''",\s/]+\s*(,|\s)\s*([^''",\s/]+)';
0265         m = regexp(records{i}, pat, 'tokens', 'once');
0266         if length(m) ~= 3
0267             disp(m);
0268             error('m should be length 3');
0269         end
0270         if length(m{3}) == 1 && m{3}(1) == '0'  %% two-winding
0271             i2 = i2 + 1;
0272             idx2(i2) = i;
0273             i = i + 4;
0274         else                                    %% three-winding
0275             i3 = i3 + 1;
0276             idx3(i3) = i;
0277             i = i + 5;
0278         end
0279     end
0280     nt2 = i2;
0281     nt3 = i3;
0282 
0283     if verbose
0284         str = sprintf(' %d(%d) two(three)-winding.', nt2, nt3);
0285         spacers = repmat('.', 1, 36-length(str));
0286         fprintf('%s %s ... done.\n', spacers, str);
0287     end
0288 
0289     %% trim index vectors down to size
0290     idx2 = idx2(1:nt2);
0291     idx3 = idx3(1:nt3);
0292 
0293     %% parse record 1 (cols 1-20)
0294     [t2_1, warns] = psse_parse_section(warns, records(idx2), verbose, ...
0295         '2-winding transformers (1)', 'dd..ddd....d........');
0296 %       '2-winding transformers (1)', 'dddsdddffdsddfdfdfdf');
0297     [t3_1, warns] = psse_parse_section(warns, records(idx3), verbose, ...
0298         '3-winding transformers (1)', 'ddd.ddd....d........');
0299 %       '3-winding transformers (1)', 'dddsdddffdsddfdfdfdf');
0300 
0301     %% two-winding
0302     %% parse record 2 (cols 21-23)
0303     [t2_2, warns] = psse_parse_section(warns, records(idx2+1), verbose, ...
0304         '2-winding transformers (2)', 'fff');
0305 
0306     %% parse record 3 (cols 24-39)
0307     %% parse up to CX1, should warn if CNXA1 is present and non-zero
0308     [t2_3, warns] = psse_parse_section(warns, records(idx2+2), verbose, ...
0309         '2-winding transformers (3)', 'ffffff..........');
0310 %       '2-winding transformers (3)', 'ffffffddffffddff');
0311 
0312     %% parse record 4 (cols 40-41)
0313     [t2_4, warns] = psse_parse_section(warns, records(idx2+3), verbose, ...
0314         '2-winding transformers (4)', 'ff');
0315 
0316     %% three-winding
0317     %% parse record 2 (cols 21-31)
0318     [t3_2, warns] = psse_parse_section(warns, records(idx3+1), verbose, ...
0319         '3-winding transformers (2)', 'fffffffffff');
0320 %       '3-winding transformers (2)', 'fffffffffff');
0321 
0322     %% parse record 3 (cols 32-47)
0323     %% parse up to CX1, should warn if CNXA1 is present and non-zero
0324     [t3_3, warns] = psse_parse_section(warns, records(idx3+2), verbose, ...
0325         '3-winding transformers (3)', 'ffffff..........');
0326 %       '3-winding transformers (3)', 'ffffffddffffddff');
0327 
0328     %% parse record 4 (cols 48-63)
0329     %% parse up to CX2
0330     [t3_4, warns] = psse_parse_section(warns, records(idx3+3), verbose, ...
0331         '3-winding transformers (4)', 'ffffff..........');
0332 %       '3-winding transformers (4)', 'ffffffddffffddff');
0333 
0334     %% parse record 5 (cols 64-79)
0335     %% parse up to CX3
0336     [t3_5, warns] = psse_parse_section(warns, records(idx3+4), verbose, ...
0337         '3-winding transformers (5)', 'ffffff..........');
0338 %       '3-winding transformers (5)', 'ffffffddffffddff');
0339 
0340     %% assemble two-winding transformer records
0341     data.trans2.num = [t2_1.num(:, 1:20) t2_2.num(:, 1:3) t2_3.num(:, 1:16) t2_4.num(:, 1:2)];
0342     data.trans2.txt = [t2_1.txt(:, 1:20) t2_2.txt(:, 1:3) t2_3.txt(:, 1:16) t2_4.txt(:, 1:2)];
0343 
0344     %% assemble three-winding transformer records
0345     data.trans3.num = [t3_1.num(:, 1:20) t3_2.num(:, 1:11) t3_3.num(:, 1:16) t3_4.num(:, 1:16) t3_5.num(:, 1:16)];
0346     data.trans3.txt = [t3_1.txt(:, 1:20) t3_2.txt(:, 1:11) t3_3.txt(:, 1:16) t3_4.txt(:, 1:16) t3_5.txt(:, 1:16)];
0347 
0348     % if verbose
0349     %     fprintf('%s\n', upper(label));
0350     %     fprintf('%s\n', sections(s).name);
0351     % end
0352     s = s + 1;
0353 end
0354 
0355 %%-----  area interchange data  -----
0356 [data.area, warns] = psse_parse_section(warns, records, sections, s, verbose, 'area', 'ddffs');
0357 s = s + 1;
0358 
0359 %%-----  two-terminal DC transmission line data  -----
0360 label = 'two-terminal DC';
0361 if ~isempty(sections(s).name) && ~strcmpi(label, sections(s).name)
0362     if verbose > 1
0363         fprintf('-----  WARNING:  Expected section labeled: ''%s''\n', upper(label));
0364         fprintf('-----            Found section labeled:    ''%s''\n', sections(s).name);
0365     end
0366 end
0367 idx = sections(s).first:3:sections(s).last;
0368 if rev < 31
0369     [dc1, warns] = psse_parse_section(warns, records(idx), verbose, ...
0370         'two-terminal DC (1)', '.d.ff.......');
0371 %       'two-terminal DC (1)', 'ddffffffsfdf');
0372     [dc2, warns] = psse_parse_section(warns, records(idx+1), verbose, ...
0373         'two-terminal DC (2)', 'd.ff.............');
0374 %       'two-terminal DC (2)', 'ddffffffffffdddsf');
0375     [dc3, warns] = psse_parse_section(warns, records(idx+2), verbose, ...
0376         'two-terminal DC (3)', 'd.ff.............');
0377 %       'two-terminal DC (3)', 'ddffffffffffdddsf');
0378 else
0379     [dc1, warns] = psse_parse_section(warns, records(idx), verbose, ...
0380         'two-terminal DC (1)', '.d.ff.......');
0381 %       'two-terminal DC (1)', 'sdffffffsfdf');
0382     [dc2, warns] = psse_parse_section(warns, records(idx+1), verbose, ...
0383         'two-terminal DC (2)', 'd.ff.............');
0384 %       'two-terminal DC (2)', 'ddffffffffffdddDf');
0385     [dc3, warns] = psse_parse_section(warns, records(idx+2), verbose, ...
0386         'two-terminal DC (3)', 'd.ff.............');
0387 %       'two-terminal DC (3)', 'ddffffffffffdddDf');
0388 end
0389 
0390 %% assemble two-terminal DC transmission line
0391 data.twodc.num = [dc1.num dc2.num dc3.num];
0392 data.twodc.txt = [dc1.txt dc2.txt dc3.txt];
0393 % if verbose
0394 %     fprintf('%s\n', upper(label));
0395 %     fprintf('%s\n', sections(s).name);
0396 % end
0397 s = s + 1;
0398 
0399 %%-----  skip voltage source converter data  -----
0400 if rev > 28
0401     [s, warns] = psse_skip_section(warns, sections, s, verbose, 'voltage source converter');
0402 end
0403 
0404 %%-----  switched shunt data  -----
0405 if rev < 31
0406     %% parse up to B1
0407     if rev <= 27
0408         [data.swshunt, warns] = psse_parse_section(warns, records, sections, s, verbose, ...
0409             'switched shunt', 'd....f');
0410 %           'switched shunt', 'ddffdfdfdfdfdfdfdfdfdf');
0411     elseif rev <= 29
0412         [data.swshunt, warns] = psse_parse_section(warns, records, sections, s, verbose, ...
0413             'switched shunt', 'd.....f');
0414 %           'switched shunt', 'ddffdsfdfdfdfdfdfdfdfdf');
0415     else    %%  rev == 30
0416         [data.swshunt, warns] = psse_parse_section(warns, records, sections, s, verbose, ...
0417             'switched shunt', 'd......f');
0418 %           'switched shunt', 'ddffdfsfdfdfdfdfdfdfdfdf');
0419     end
0420     s = s + 1;
0421 end
0422 
0423 %%-----  skip impedance correction data  -----
0424 [s, warns] = psse_skip_section(warns, sections, s, verbose, 'impedance correction');
0425 
0426 %%-----  skip multi-terminal DC data  -----
0427 [s, warns] = psse_skip_section(warns, sections, s, verbose, 'multi-terminal DC');
0428 
0429 %%-----  skip multi-section line data  -----
0430 [s, warns] = psse_skip_section(warns, sections, s, verbose, 'multi-section line');
0431 
0432 %%-----  skip zone data  -----
0433 [s, warns] = psse_skip_section(warns, sections, s, verbose, 'zone');
0434 
0435 %%-----  skip inter-area transfer data  -----
0436 [s, warns] = psse_skip_section(warns, sections, s, verbose, 'inter-area transfer');
0437 
0438 %%-----  skip owner data  -----
0439 if rev > 24
0440     [s, warns] = psse_skip_section(warns, sections, s, verbose, 'owner');
0441 end
0442 
0443 %%-----  skip FACTS control device data  -----
0444 if rev > 25
0445     [s, warns] = psse_skip_section(warns, sections, s, verbose, 'FACTS control device');
0446 end
0447 
0448 %%-----  switched shunt data  -----
0449 if rev > 30
0450     %% parse up to B1
0451     if rev < 32
0452         [data.swshunt, warns] = psse_parse_section(warns, records, sections, s, verbose, ...
0453             'switched shunt', 'd......f');
0454 %           'switched shunt', 'ddffdfsfdfdfdfdfdfdfdfdf');
0455     else
0456         [data.swshunt, warns] = psse_parse_section(warns, records, sections, s, verbose, ...
0457             'switched shunt', 'd........f');
0458 %           'switched shunt', 'ddddffdfsfdfdfdfdfdfdfdfdf');
0459     end
0460     s = s + 1;
0461 end
0462 
0463 %%-----  skip GNE device data  -----
0464 if rev > 31
0465     [s, warns] = psse_skip_section(warns, sections, s, verbose, 'GNE device');
0466 end
0467 
0468 %%-----  skip induction machine data  -----
0469 if rev > 32
0470     [s, warns] = psse_skip_section(warns, sections, s, verbose, 'induction machine');
0471 end
0472 
0473 %%-----  check for extra sections  -----
0474 if s <= length(sections)
0475     warns{end+1} = sprintf('Found %d additional section(s)', length(sections)-s+1);
0476     if verbose > 1
0477         fprintf('-----  WARNING:   Found %d additional section(s):\n', length(sections)-s+1);
0478     end
0479 end
0480 while s <= length(sections)
0481     n = sections(s).last - sections(s).first + 1;
0482     if n
0483         str = sprintf('with %d line(s)', n);
0484     else
0485         str = sprintf('(empty)');
0486     end
0487     if isempty(sections(s).name)
0488         warns{end+1} = sprintf('  unlabeled section %s', str);
0489         if verbose > 1
0490             fprintf('-----            unlabeled section %s\n', str);
0491         end
0492     else
0493         warns{end+1} = sprintf('  ''%s DATA'' %s', sections(s).name, str);
0494         if verbose > 1
0495             fprintf('-----            ''%s DATA'' %s\n', sections(s).name, str);
0496         end
0497     end
0498     s = s + 1;
0499 end
0500 
0501 
0502 
0503 %%---------------------------------------------------------------------
0504 function [s, warns] = psse_skip_section(warns, sections, s, verbose, label)
0505 %PSSE_SKIP_SECTION  Skips over a section without extracting any data.
0506 %   [SIDX, WARNINGS] = PSSE_SKIP_SECTION(WARNINGS, SECTIONS, SIDX, VERBOSE, LABEL)
0507 
0508 if s > length(sections)
0509     if verbose
0510         spacers = repmat('.', 1, 58-length(label));
0511         fprintf('No %s data read %s done.\n', label, spacers);
0512     end
0513 else
0514     nr = sections(s).last - sections(s).first + 1;
0515     if nr > 1
0516         ss = 'lines';
0517     else
0518         ss = 'line';
0519     end
0520     if nr
0521         warns{end+1} = sprintf('Skipped %d %s of %s data.', nr, ss, label);
0522     end
0523     if ~isempty(sections(s).name) && ~strcmp(upper(label), sections(s).name)
0524         warns{end+1} = sprintf('Section label mismatch, found ''%s'', expected ''%s''', ...
0525             sections(s).name, upper(label));
0526         if verbose
0527             fprintf('-----  WARNING:  Found section labeled:    ''%s''\n', sections(s).name);
0528             fprintf('-----            Expected section labeled: ''%s''\n', upper(label));
0529         end
0530     end
0531     if verbose && nr
0532         spacers = repmat('.', 1, 47-length(ss)-length(label));
0533         fprintf('Skipping%6d %s of %s data %s done.\n', nr, ss, label, spacers);
0534     end
0535     s = s + 1;
0536 end

Generated on Mon 26-Jan-2015 15:21:31 by m2html © 2005