function prframeconfig(frparms,fileId)
% PRFRAMECONFIG - print out frame configuration info
%   prframeconfig(frparms,fileId)
%       frparms - GravEn Frame configuration parameters
%       fileId = [OPTIONAL] Id of file to write to
%
% $Id: prframeconfig.m,v 1.2 2005/04/14 18:31:16 thorne Exp $

if(nargin < 2)
    fileId = 1;
end
fprintf(fileId,'# GRAVEN FRAME CONFIGURATION PARAMS\n');
if(isfield(frparms,'instrument'))
    if(~isempty(frparms.instrument))
        fprintf(fileId,'# frame file instrument: %s\n',char(frparms.instrument));
    else
        fprintf(fileId,'# ** No frame file instrument defined **\n');
    end
else
    fprintf(fileId,'# ** No frame file instrument defined **\n');
end
if(isfield(frparms,'type'))
    if(~isempty(frparms.type))
        fprintf(fileId,'# frame file type: %s\n',char(frparms.type));
    else
        fprintf(fileId,'# ** No frame file type defined **\n');
    end
else
    fprintf(fileId,'# ** No frame file type defined **\n');
end
if(isfield(frparms,'duration'))
    fprintf(fileId,'# frame file duration: %d sec\n',frparms.duration);
else
    fprintf(fileId,'# ** No frame file duration defined **\n');   
end
if(isfield(frparms,'bkgd'))
    fprintf(fileId,'# background data for simulations: %s\n',char(frparms.bkgd));
else
    fprintf(fileId,'# ** No background data defined **\n');   
end
if(isfield(frparms,'chanDesc') && isfield(frparms,'chanName'))
    chanDesc = frparms.chanDesc;
    chanName = frparms.chanName;
    numChan = numel(chanDesc);
    fprintf(fileId,'# There are %d channels in each frame file\n',numChan);
    for iChan = 1:numChan
        fprintf(fileId,'#   Channel %d: %s - frame channel %s\n',...
            iChan,char(chanDesc{iChan}),char(chanName{iChan}));
    end
else
    fprintf(filedId,'# ** frame channels, names not defined **\n');
end
if(isfield(frparms,'frameDirFlag'))
    if(frparms.frameDirFlag)
        fprintf(fileId,'# *** Use local frame file directory!\n');
        if(isfield(frparms,'frameDir'))
            fprintf(fileId,'# --> frame file directory is %s\n',frparms.frameDir);
        else
            fprintf(fileId,'# ** No frame file directory defined **\n');
        end
    end
end
return

