Home > atmlab > arts > arts_batch.m

arts_batch

PURPOSE ^

ARTS_BATCH Performs ARTS batch calculations

SYNOPSIS ^

function Y = arts_batch( Q, workfolder )

DESCRIPTION ^

 ARTS_BATCH   Performs ARTS batch calculations

    Largely as *arts_y* but calculates several spectra in a single run,
    batch calculations. The data to be changed between each spectrum is
    stored in Q.BATCH, with details described in qartsBatch.

 FORMAT   Y = arts_batch( Q [, workfolder] )
        
 OUT   Y            Calculated spectra.
 IN    Q            Qarts structure.
 OPT   workfolder   If not defined or empty, a temporary folder is created.
                    Otherwise this is interpreted as the path to a folder 
                    where calculation output can be stored.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

arts_batch.m

SOURCE CODE ^

0001 % ARTS_BATCH   Performs ARTS batch calculations
0002 %
0003 %    Largely as *arts_y* but calculates several spectra in a single run,
0004 %    batch calculations. The data to be changed between each spectrum is
0005 %    stored in Q.BATCH, with details described in qartsBatch.
0006 %
0007 % FORMAT   Y = arts_batch( Q [, workfolder] )
0008 %
0009 % OUT   Y            Calculated spectra.
0010 % IN    Q            Qarts structure.
0011 % OPT   workfolder   If not defined or empty, a temporary folder is created.
0012 %                    Otherwise this is interpreted as the path to a folder
0013 %                    where calculation output can be stored.
0014 
0015 % 2007-10-22   Created by Patrick Eriksson.
0016 
0017 function Y = arts_batch( Q, workfolder )
0018 %
0019 if nargin < 2
0020   workfolder = [];
0021 end
0022                                                                  %&%
0023                                                                  %&%
0024 %= Check input                                                   %&%
0025 %                                                                %&%
0026 rqre_nargin(2,nargin);                                           %&%
0027 %                                                                %&%
0028 rqre_datatype( Q, @isstruct );                                   %&%
0029 rqre_datatype( workfolder, {@isempty,@ischar} );                 %&%
0030 
0031 
0032 if isempty( workfolder )
0033   workfolder = create_tmpfolder;
0034   cu = onCleanup( @()delete_tmpfolder( workfolder ) );
0035 end
0036 
0037 
0038 parts = qarts2cfile( 'Batch' );
0039 S     = qarts2cfile( Q, parts, workfolder );
0040 cfile = fullfile( workfolder, 'cfile.arts' );
0041 strs2file( cfile, S );
0042 arts( cfile );
0043 
0044 
0045 Y = xmlLoad( fullfile( workfolder, 'ybatch.xml' ) );
0046

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