Home > atmlab > arts > arts_atmfields.m

arts_atmfields

PURPOSE ^

ARTS_ATMFIELDS Interpolates a raw atmosphere through ARTS

SYNOPSIS ^

function [t_field,z_field,vmr_field,r_geoid,z_surface] =arts_atmfields(Q,p,lat,lon)

DESCRIPTION ^

 ARTS_ATMFIELDS   Interpolates a raw atmosphere through ARTS

    The function extracts the atmospheric fields corresponding to 
    RAW_ATMOSPHERE.

    Geoid and surface altitude variables are also returned.

    Needed Qarts fields:
       ABS_SPECIES
       ATMOSPHERE_DIM
       RAW_ATMOSPHERE
       R_GEOID
       Z_SURFACE
    and
       P_GRID
       LAT_GRID
       LON_GRID
    if not corresponding optional arguments are used.

    Dummy values must be set for (due to internal structure of qarts2cfile)
       STOKES_DIM
       F_GRID

 FORMAT [t_field,z_field,vmr_field,r_geoid,z_surface] = 
                                          arts_atmfields( Q [, p, lat, lon ])
        
 OUT   t_field     As the ARTS WSV with same name.
       z_field     As the ARTS WSV with same name.
       vmr_field   As the ARTS WSV with same name.
       r_geoid     As the ARTS WSV with same name.
       z_surface   As the ARTS WSV with same name.

 IN    Q           Qarts structure
 OPT   p           If given replaces Q.P_GRID
       lat         If given replaces Q.LAT_GRID
       lon         If given replaces Q.LON_GRID

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

arts_atmfields.m

SOURCE CODE ^

0001 % ARTS_ATMFIELDS   Interpolates a raw atmosphere through ARTS
0002 %
0003 %    The function extracts the atmospheric fields corresponding to
0004 %    RAW_ATMOSPHERE.
0005 %
0006 %    Geoid and surface altitude variables are also returned.
0007 %
0008 %    Needed Qarts fields:
0009 %       ABS_SPECIES
0010 %       ATMOSPHERE_DIM
0011 %       RAW_ATMOSPHERE
0012 %       R_GEOID
0013 %       Z_SURFACE
0014 %    and
0015 %       P_GRID
0016 %       LAT_GRID
0017 %       LON_GRID
0018 %    if not corresponding optional arguments are used.
0019 %
0020 %    Dummy values must be set for (due to internal structure of qarts2cfile)
0021 %       STOKES_DIM
0022 %       F_GRID
0023 %
0024 % FORMAT [t_field,z_field,vmr_field,r_geoid,z_surface] =
0025 %                                          arts_atmfields( Q [, p, lat, lon ])
0026 %
0027 % OUT   t_field     As the ARTS WSV with same name.
0028 %       z_field     As the ARTS WSV with same name.
0029 %       vmr_field   As the ARTS WSV with same name.
0030 %       r_geoid     As the ARTS WSV with same name.
0031 %       z_surface   As the ARTS WSV with same name.
0032 %
0033 % IN    Q           Qarts structure
0034 % OPT   p           If given replaces Q.P_GRID
0035 %       lat         If given replaces Q.LAT_GRID
0036 %       lon         If given replaces Q.LON_GRID
0037 
0038 % 2004-09-11   Created by Patrick Eriksson.
0039 
0040 
0041 function [t_field,z_field,vmr_field,r_geoid,z_surface] = ...
0042                                                       arts_atmfields(Q,p,lat,lon)
0043 
0044 %= Check input                                                   %&%
0045 %                                                                %&%
0046 rqre_nargin(1,nargin);                                           %&%
0047 %                                                                %&%
0048 rqre_datatype( Q, @isstruct );                                   %&%
0049 % p,lat and lon checked inside qarts2cfile                       %&%
0050 rqre_datatype( Q.RAW_ATMOSPHERE, @ischar, 'Q.RAW_ATMOSPHERE' );  %&%
0051 
0052 
0053 if nargin >= 2
0054   Q.P_GRID = p;
0055 end
0056 if nargin >= 3
0057   Q.LAT_GRID = lat;
0058 end
0059 if nargin >= 4
0060   Q.LON_GRID = lon;
0061 end
0062 
0063 
0064 tmpfolder = create_tmpfolder;
0065 cu = onCleanup( @()delete_tmpfolder( tmpfolder ) );
0066 
0067 
0068 parts = qarts2cfile( 'GetAtmSrf' );
0069 S = qarts2cfile( Q, parts, tmpfolder );
0070 cfile = fullfile( tmpfolder, 'cfile.arts' );
0071 strs2file( cfile, S );
0072 arts( cfile );
0073 t_field   = xmlLoad( fullfile( tmpfolder, 't_field.xml') );
0074 z_field   = xmlLoad( fullfile( tmpfolder, 'z_field.xml') );
0075 vmr_field = xmlLoad( fullfile( tmpfolder, 'vmr_field.xml') );
0076 if nargout > 3
0077   r_geoid   = xmlLoad( fullfile( tmpfolder, 'r_geoid.xml') );
0078   z_surface = xmlLoad( fullfile( tmpfolder, 'z_surface.xml') );
0079 end
0080 end

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