
%**************************************************************************
%ppm_und_sim_file_init
%This function opens all output files and performs all other
%initialization required by the program.
%
%Input:
%param, parameter structure
%
%Output:
%dat_file, output data file name
%plt_file, output plot file name
%
%Zachary Wolf
%4/2/08

function [dat_file, plt_file] = ppm_und_sim_file_init(param)

%Make file names
dat_file = strcat(lower(param.output_file_dir), 'ppm_und_sim.dat');   %Output data file
plt_file = strcat(lower(param.output_file_dir), 'ppm_und_sim.ps');    %Output plot file

%Initialize the data file
util_dat_init(dat_file);

%Write a message to the data file
msg{1} = ' ';
msg{2} = 'PPM Undulator Simulation';
msg{3} = '========================';
util_dat_msg(dat_file, msg);

%Write the parameter values to the data file
ppm_und_sim_dat_param(dat_file, param);

%Initialize the plot file
util_plt_init(plt_file, msg, param);

%Done
