Home > atmlab > gformat > gf_artsxml.m

gf_artsxml

PURPOSE ^

GF_ARTSXML Import of arts XML GriddedField data to gformat

SYNOPSIS ^

function G = gf_artsxml( file, name, type )

DESCRIPTION ^

 GF_ARTSXML   Import of arts XML GriddedField data to gformat

    Imports data having the arts xml GriddedField format. If *type* is given,
    all fields of G will be filled. Otherwise some will be left empty.

    If file holds ArrayOfGriddedFieldX, one G element is created
    for each array element.

 FORMAT   G = gf_artsxml( file [, name, type ] )

 OUT   G       G with imported data appended.
 IN    file    Name of file to read.
 OPT   name    Name of data. Will replace with is read from file if not
               empty. Default is [].
       type    Type of data. Default is []. Recognised options are
                  'vmr_field' : volume mixing ratio field
                  't_field'   : temperature (atmospheric) field
                  'z_field'   : altitude (atmospheric) field
                  'mag_field' : magnetic field component
                  'wind_field': wind field component

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

gf_artsxml.m

SOURCE CODE ^

0001 % GF_ARTSXML   Import of arts XML GriddedField data to gformat
0002 %
0003 %    Imports data having the arts xml GriddedField format. If *type* is given,
0004 %    all fields of G will be filled. Otherwise some will be left empty.
0005 %
0006 %    If file holds ArrayOfGriddedFieldX, one G element is created
0007 %    for each array element.
0008 %
0009 % FORMAT   G = gf_artsxml( file [, name, type ] )
0010 %
0011 % OUT   G       G with imported data appended.
0012 % IN    file    Name of file to read.
0013 % OPT   name    Name of data. Will replace with is read from file if not
0014 %               empty. Default is [].
0015 %       type    Type of data. Default is []. Recognised options are
0016 %                  'vmr_field' : volume mixing ratio field
0017 %                  't_field'   : temperature (atmospheric) field
0018 %                  'z_field'   : altitude (atmospheric) field
0019 %                  'mag_field' : magnetic field component
0020 %                  'wind_field': wind field component
0021 
0022 % 2008-09-25   Created by Patrick Eriksson.
0023 
0024 function G = gf_artsxml( file, name, type )
0025 
0026 if nargin<2
0027     name=[];
0028 end
0029 if nargin<3
0030     type=[];
0031 end
0032 
0033 strictAssert=atmlab('STRICT_ASSERT');
0034 
0035 if strictAssert 
0036   rqre_nargin( 1, nargin );
0037   rqre_datatype( file, @ischar );
0038   rqre_datatype( name, {@isempty,@ischar} );
0039   rqre_datatype( type, {@isempty,@ischar} );
0040 end
0041 
0042 
0043 %- Load and check data
0044 %
0045 X = xmlLoad( file );
0046 %
0047 G = griddedfield2gf( X, name, type );
0048 %
0049 G.SOURCE = file;
0050  
0051 return
0052 %-----------------------------------------------------------------------
0053

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