Home > atmlab > arts > arts_abstable.m

arts_abstable

PURPOSE ^

ARTS_ABSTABLE Creates an ARTS absorption lookup table

SYNOPSIS ^

function A = arts_abstable( Q, varargin )

DESCRIPTION ^

 ARTS_ABSTABLE   Creates an ARTS absorption lookup table

    The function assumes that all needed fields of Q are set, and
    calculates an absorption look-up table.

    The following Qarts fields must be specified:
       ABS_LINES
       ABS_LINES_FORMAT
       ABS_LINESHAPE 
       ABS_LINESHAPE_CUTOFF
       ABS_LINESHAPE_FACTOR
       ABS_MODELS 
       ABS_NLS
       ABS_NLS_PERT
       ABS_P
       ABS_SPECIES
       ABS_T
       ABS_T_PERT 
       ABS_VMRS 

    The function *qarts_abstable* could be useful to set some of the fields
    listed above.

 FORMAT   A = arts_abstable( Q [, workfolder, do_load ] )

 OUT   A            Absorption table structure. Can be data or file name.
 IN    Q            Qarts settings.
 OPT   workfolder   If not defined or empty, a temporary folder is created.
                    Obtained data are then loaded into A.
                    Otherwise this is interpreted as the path to a folder 
                    where calculation output can be stored. These files
                    will be left in the folder. The function output is then
                    the name of the file holding the absorption table.
                    Default is [].
       do_load      Flag to force reading of data even if a work folder has 
                    been specified.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

arts_abstable.m

SOURCE CODE ^

0001 % ARTS_ABSTABLE   Creates an ARTS absorption lookup table
0002 %
0003 %    The function assumes that all needed fields of Q are set, and
0004 %    calculates an absorption look-up table.
0005 %
0006 %    The following Qarts fields must be specified:
0007 %       ABS_LINES
0008 %       ABS_LINES_FORMAT
0009 %       ABS_LINESHAPE
0010 %       ABS_LINESHAPE_CUTOFF
0011 %       ABS_LINESHAPE_FACTOR
0012 %       ABS_MODELS
0013 %       ABS_NLS
0014 %       ABS_NLS_PERT
0015 %       ABS_P
0016 %       ABS_SPECIES
0017 %       ABS_T
0018 %       ABS_T_PERT
0019 %       ABS_VMRS
0020 %
0021 %    The function *qarts_abstable* could be useful to set some of the fields
0022 %    listed above.
0023 %
0024 % FORMAT   A = arts_abstable( Q [, workfolder, do_load ] )
0025 %
0026 % OUT   A            Absorption table structure. Can be data or file name.
0027 % IN    Q            Qarts settings.
0028 % OPT   workfolder   If not defined or empty, a temporary folder is created.
0029 %                    Obtained data are then loaded into A.
0030 %                    Otherwise this is interpreted as the path to a folder
0031 %                    where calculation output can be stored. These files
0032 %                    will be left in the folder. The function output is then
0033 %                    the name of the file holding the absorption table.
0034 %                    Default is [].
0035 %       do_load      Flag to force reading of data even if a work folder has
0036 %                    been specified.
0037 
0038 % 2007-09-13   Created by Patrick Eriksson.
0039 
0040 
0041 function A = arts_abstable( Q, varargin )
0042 %
0043 [workfolder,do_load] = optargs( varargin, { [], false } );
0044                                                                  %&%
0045 %= Check input                                                   %&%
0046 %                                                                %&%
0047 rqre_nargin(1,nargin);                                           %&%
0048 %                                                                %&%
0049 rqre_datatype( Q, @isstruct );                                   %&%
0050 rqre_datatype( workfolder, {@isempty,@ischar} );                 %&%
0051 rqre_datatype( do_load, @isboolean );                            %&%
0052 
0053 
0054 if isempty( workfolder )
0055   workfolder = create_tmpfolder;
0056   cu = onCleanup( @()delete_tmpfolder( workfolder ) );
0057   folder_created = 1;
0058 else
0059   folder_created = 0;  
0060 end
0061 
0062 
0063 parts = qarts2cfile( 'GetAbsTable' );
0064 S     = qarts2cfile( Q, parts, workfolder );
0065 cfile = fullfile( workfolder, 'cfile.arts' );
0066 strs2file( cfile, S );
0067 arts( cfile );
0068 
0069 
0070 fname = fullfile( workfolder, 'abs_lookup.xml' );
0071 
0072 if ~exist( fname )                                                       %&%
0073   error( 'No absorption table generated. Forgot to set Q.ABSORPTION?' ); %&%
0074 end                                                                      %&%
0075 
0076 if folder_created  |  do_load
0077   A = xmlLoad( fname );
0078 else
0079   A = fname;
0080 end
0081 
0082 
0083 
0084 
0085 
0086

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