source: sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/WriteModelData.ipf @ 145

Last change on this file since 145 was 127, checked in by srkline, 15 years ago

LOTS of changes to the analysis ipf files:

-- see sphere.ipf for the simplest example of the changes --

  • #pragma Igor 6
  • #if directive to look for XOP
  • AAO unsmeared functions
  • STRUCT functions for smearing (also AAO)
  • new wrappers for dependencies to struct functions

(2006 models have NOT been completed yet, only the old models)

  • loading data files into data folders (PlotUtils?) + some streamlining of the loaders
  • Smear_Model_N is now AAO + some streamlining of the quadrature code

-- SHS and SW structure factor XOPs are crashing (need DP wave, I may have old XOP)
-- this breaks fitting of the smeared models until wrappers can be devised
-- all packages will be broken due to the new data folder structure
-- multiple instances of functions will now cause problems (MSA)
-- RPA model is a problem with its odd functional form (extra wave)

-- lots of other carnage to follow as the bugs and typos are shaken out

24 JUL 2007 SRK

File size: 1.3 KB
Line 
1#pragma rtGlobals=1             // Use modern global access method.
2#pragma IgorVersion = 6.0
3
4Proc WriteModelData(xwave,ywave,delim,term)
5        String xwave,ywave,delim,term
6        Prompt xwave,"X data",popup,WaveList("*",";","")
7        Prompt ywave,"y data",popup,WaveList("*",";","")
8        Prompt delim,"delimeter",popup,"tab;space;"
9        Prompt term,"line termination",popup,"CR;LF;CRLF;"
10       
11        //Print xwave, ywave, delim, term
12       
13        fWriteModelData($xwave,$ywave,delim,term)
14       
15End
16
17Function fWriteModelData(xwave,ywave,delim,term)
18        Wave xwave,ywave
19        String delim,term
20       
21        String formatStr="",fullpath=""
22        Variable refnum
23        //setup delimeter and terminator choices
24        If(cmpstr(delim,"tab")==0)
25                //tab-delimeted
26                formatStr="%15.4g\t%15.4g"
27        else
28                //use 3 spaces
29                formatStr="%15.4g   %15.4g"
30        Endif
31        If(cmpstr(term,"CR")==0)
32                formatStr += "\r"
33        Endif
34        If(cmpstr(term,"LF")==0)
35                formatStr += "\n"
36        Endif
37        If(cmpstr(term,"CRLF")==0)
38                formatStr += "\r\n"
39        Endif
40       
41        Open/D refnum as NameofWave(ywave)+".txt"       //doesn't open file
42        If(cmpstr(S_filename,"")==0)
43                //user cancel, don't write out a file
44                Close/A
45                Abort "no data file was written"
46        Endif
47        fullpath=S_filename
48        Open refnum as fullpath
49       
50        fprintf refnum,"Model data created %s\r\n",(date()+" "+time())
51        wfprintf refnum,formatStr,xwave,ywave
52        Close refnum
53        return(0)
54End
Note: See TracBrowser for help on using the repository browser.