#pragma rtGlobals=1 // Use modern global access method. #pragma version=5.0 #pragma IgorVersion=6.1 //************************ // Vers 1.2 091001 // //************************ //for writing out data (q-i-s) from the "type" folder, and including reduction information //if fullpath is a complete HD path:filename, no dialog will be presented //if fullpath is just a filename, the save dialog will be presented //if dialog = 1, a dialog will always be presented // // root:myGlobals:Protocols:gProtoStr is the name of the currently active protocol // Function WriteWaves_W_Protocol(type,fullpath,dialog) String type,fullpath Variable dialog //=1 will present dialog for name String destStr="" destStr = "root:Packages:NIST:"+type Variable refNum String formatStr = "%15.4g %15.4g %15.4g %15.4g %15.4g %15.4g\r\n" String fname,ave="C",hdrStr1="",hdrStr2="" Variable step=1 //*****these waves MUST EXIST, or IGOR Pro will crash, with a type 2 error**** WAVE intw=$(destStr + ":integersRead") WAVE rw=$(destStr + ":realsRead") WAVE/T textw=$(destStr + ":textRead") WAVE qvals =$(destStr + ":qval") WAVE inten=$(destStr + ":aveint") WAVE sig=$(destStr + ":sigave") WAVE qbar = $(destStr + ":QBar") WAVE sigmaq = $(destStr + ":SigmaQ") WAVE fsubs = $(destStr + ":fSubS") SVAR gProtoStr = root:myGlobals:Protocols:gProtoStr Wave/T proto=$("root:myGlobals:Protocols:"+gProtoStr) //check each wave If(!(WaveExists(intw))) Abort "intw DNExist BinaryWrite_W_Protocol()" Endif If(!(WaveExists(rw))) Abort "rw DNExist BinaryWrite_W_Protocol()" Endif If(!(WaveExists(textw))) Abort "textw DNExist BinaryWrite_W_Protocol()" Endif If(!(WaveExists(qvals))) Abort "qvals DNExist BinaryWrite_W_Protocol()" Endif If(!(WaveExists(inten))) Abort "inten DNExist BinaryWrite_W_Protocol()" Endif If(!(WaveExists(sig))) Abort "sig DNExist BinaryWrite_W_Protocol()" Endif If(!(WaveExists(qbar))) Abort "qbar DNExist BinaryWrite_W_Protocol()" Endif If(!(WaveExists(sigmaq))) Abort "sigmaq DNExist BinaryWrite_W_Protocol()" Endif If(!(WaveExists(fsubs))) Abort "fsubs DNExist BinaryWrite_W_Protocol()" Endif If(!(WaveExists(proto))) Abort "current protocol wave DNExist BinaryWrite_W_Protocol()" Endif //strings can be too long to print-- must trim to 255 chars Variable ii,num=8 Make/O/T/N=(num) tempShortProto for(ii=0;ii