Home > atmlab > arts > xml > xmlReadScatteringMetaData.m

xmlReadScatteringMetaData

PURPOSE ^

Reads ScatteringMetaData from an XML file.

SYNOPSIS ^

function result = xmlReadScatteringMetaData(fid, attrlist, itype, ftype, binary, fid2)

DESCRIPTION ^

 Reads ScatteringMetaData from an XML file.

    Internal function that should never be called directly.
    Use *xmlLoad* instead.

    Calls *xmlReadTag* for every member of the ScatteringMetaData
    structure.

 FORMAT   result = xmlReadScatteringMetaData(fid, attrlist, itype, ftype, binary, fid2)

 OUT   result     ScatteringMetaData
 IN    fid        File descriptor of XML file
 IN    attrlist   List of tag attributes
 IN    itype      Integer type of input file
 IN    ftype      Floating point type of input file
 IN    binary     Flag. 1 = binary file, 0 = ascii
 IN    fid2       File descriptor of binary file

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

xmlReadScatteringMetaData.m

SOURCE CODE ^

0001 % Reads ScatteringMetaData from an XML file.
0002 %
0003 %    Internal function that should never be called directly.
0004 %    Use *xmlLoad* instead.
0005 %
0006 %    Calls *xmlReadTag* for every member of the ScatteringMetaData
0007 %    structure.
0008 %
0009 % FORMAT   result = xmlReadScatteringMetaData(fid, attrlist, itype, ftype, binary, fid2)
0010 %
0011 % OUT   result     ScatteringMetaData
0012 % IN    fid        File descriptor of XML file
0013 % IN    attrlist   List of tag attributes
0014 % IN    itype      Integer type of input file
0015 % IN    ftype      Floating point type of input file
0016 % IN    binary     Flag. 1 = binary file, 0 = ascii
0017 % IN    fid2       File descriptor of binary file
0018 
0019 % 2014-04-03   Created by Oliver Lemke.
0020 
0021 function result = xmlReadScatteringMetaData(fid, attrlist, itype, ftype, binary, fid2)
0022 
0023 result.version = uint16(str2double (xmlGetAttrValue (attrlist, 'version')));
0024 if result.version > 2
0025     error('atmlab:xmlReadScatteringMetaData:UnsupportedVersion', ...
0026         'Unsupported ScatteringMetaData version')
0027 end
0028 
0029 result.description    = xmlReadTag(fid, '', itype, ftype, binary, fid2 );
0030 result.material       = xmlReadTag(fid, '', itype, ftype, binary, fid2 );
0031 result.shape          = xmlReadTag(fid, '', itype, ftype, binary, fid2 );
0032 result.density        = xmlReadTag(fid, '', itype, ftype, binary, fid2 );
0033 result.diameter_max   = xmlReadTag(fid, '', itype, ftype, binary, fid2 );
0034 result.volume         = xmlReadTag(fid, '', itype, ftype, binary, fid2 );
0035 result.area_projected = xmlReadTag(fid, '', itype, ftype, binary, fid2 );
0036 result.aspect_ratio   = xmlReadTag(fid, '', itype, ftype, binary, fid2 );
0037 
0038 if result.version == 2
0039     result.scat_f_grid        = xmlReadTag(fid, '', itype, ftype, binary, fid2 );
0040     result.scat_T_grid        = xmlReadTag(fid, '', itype, ftype, binary, fid2 );
0041     result.particle_type      = xmlReadTag(fid, '', itype, ftype, binary, fid2 );
0042     result.complex_refr_index = xmlReadTag(fid, '', itype, ftype, binary, fid2 );
0043 end
0044

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005