4Misc_Start k7ROGI'XX -K AP+winspoolHP LaserJet 4Si/4Si MX PSNe01:HP LaserJet 4Si/4Si MX PSW 4dXA4terPRIV'''' k7ROGI'XXp .<4!*AP+winspoolHP LaserJet 4Si/4Si MX PSNe01:HP LaserJet 4Si/4Si MX PSW odXLetterPRIV'''' k7ROGI'XXp .<4!*AP+winspoolHP LaserJet 4Si/4Si MX PSNe01:HP LaserJet 4Si/4Si MX PSW odXLetterPRIV'''' k7ROGI'XXp .<4!*AP+winspoolHP LaserJet 4Si/4Si MX PSNe01:HP LaserJet 4Si/4Si MX PSW odXLetterPRIV'''' k7ROGI'XXp .<4!*AP+winspoolHP LaserJet 4Si/4Si MX PSNe01:HP LaserJet 4Si/4Si MX PSW odXLetterPRIV'''' k7 ROGI'XXp .<4!*AP+winspoolHP LaserJet 4Si/4Si MX PSNe01:HP LaserJet 4Si/4Si MX PSW odXLetterPRIV''''^Graph*@@??ldWDashSettings#  !CommandzJ-Normal@ Arial<HHHH$$HistoryzJ-Normal@ Arial<HHHH$$4History4History4History4History4History4HistoryProcedure )zNormal@ Arial<HHHH$$4Procedure 4Procedure 4Procedure 4Procedure 4Procedure 4Procedure ihome5-dvD:meis:macros:D:meis:macrosD:\meismacrosD:N8: Qw;\NKw;|LwH\Ewmw TwB_pSm<4dvD:ims:Course:meis:Sm:D:ims:Course:meis:SmD:\ims\Course\meisSmN8: Qw;\NKw;|LwH\Ewmw TwB_ 4Misc_End TXOPState_Start  Data BrowservD:4XOPState_End  0(?\ @;÷(CCpB>(?smoothflagnlayers@natoms?V_numNaNsV_numINFsV_npntsf@V_nterms@V_nheldV_chisqom=V_q?V_Rab.ѠV_Pr?V_siga8:띜>V_sigblT?>n_layer?V_avgI@V_sdevLC@V_rms<[42J@V_minlocV_min 1C@V_maxlocf@V_maxOP@delta_angle?v_fitoptions@Ne1@Ne2G@Ns1J@Ns2G@Rv(K@NE@N_overE@V_Flag?M0@offset G?expandпoffset_0ٿoffset_1offset_2expand_1?expand_2offset_range433333?expand_range?m_offsetm_expandV_PeakLocG/z@V_adevc@V_skew݁贾V_kurtrكexpbulk8Bw:w bulki.txtsimbulk8Bw:w si100_111.outstr1lk8Bw:w expansion = 1str2lk8Bw:woffset = -6.13MTextbox/K/N=text0 calculate_mods() y= W_coef[0]+W_coef[1]*x W_coef={0.39182,1.1011} V_chisq= 5.23598e-10; V_npnts= 163; V_numNaNs= 0; V_numINFs= 0; V_q= 1; V_Rab= -36960.7; V_Pr= 1; W_sigma={7.36e-07,2.04e-08} print w_coef[0] 0.391819 y= W_coef[0]+W_coef[1]*x W_coef={0.39182,1.1011} V_chisq= 5.23598e-10; V_npnts= 163; V_numNaNs= 0; V_numINFs= 0; V_q= 1; V_Rab= -36960.7; V_Pr= 1; W_sigma={7.36e-07,2.04e-08} Textbox/K/N=text0 calculate_mods() y= W_coef[0]+W_coef[1]*x W_coef={0.39182,1.1011} V_chisq= 5.23598e-10; V_npnts= 163; V_numNaNs= 0; V_numINFs= 0; V_q= 1; V_Rab= -36960.7; V_Pr= 1; W_sigma={7.36e-07,2.04e-08} y= W_coef[0]+W_coef[1]*x W_coef={0.29182,1.1011} V_chisq= 5.90385e-10; V_npnts= 163; V_numNaNs= 0; V_numINFs= 0; V_q= 1; V_Rab= -34807.3; V_Pr= 1; W_sigma={7.81e-07,2.16e-08} ModifyGraph ZisZ(bottom)=1 DoWindow/R Offset_RValue_graph ModifyGraph ZisZ(bottom)=1 DoWindow/R Expand_RValue_graph print w_coef[0] -1.35066 print w_coef[1] 1.10934 Textbox/K/N=text0 calculate_mods() Textbox/K/N=text0 string/g str1, str2 Textbox/K/N=text0 calculate_mods() Textbox/K/N=text0 CurveFit line expbulk0_mod /X=expbulk0_orig /D fit_expbulk0_mod= W_coef[0]+W_coef[1]*x W_coef={1.4095,0.99484} V_chisq= 3.27905e-10; V_npnts= 163; V_numNaNs= 0; V_numINFs= 0; V_q= 1; V_Rab= -46705.1; V_Pr= 1; W_sigma={5.82e-07,1.61e-08} calculate_mods() print str1 expansion = 1.10934 Textbox/K/N=text0 calculate_mods() print str1 expansion = 1.10934 print w_coef[0] -1.35066 print w_coef[1] 1.10934 Textbox/K/N=text0 calculate_mods() Textbox/K/N=text0 calculate_mods() Textbox/K/N=text0 calculate_mods() Textbox/K/N=text0 calculate_mods() ShowTools/A KillControl button1 SetVariable setvar1 proc=manual_offset,title="offset",limits={0,INF,0.1};DelayUpdate SetVariable setvar1 value= offset SetVariable setvar2 size={102,17},proc=manual_expand,title="expand %";DelayUpdate SetVariable setvar2 limits={-INF,INF,0.5},value= expand,format="" HideTools/A ShowTools/A SetVariable setvar1 limits={-INF,INF,0.1} HideTools/A ShowTools/A HideTools/A ShowTools/A HideTools/A variable/G Rv, offset, m_offset, expand, m_expand ShowTools/A SetVariable setvar1 value= m_offset SetVariable setvar2 value= m_expand HideTools/A DoWindow/R bulk_fit_window FindPeak expt1_1 V_Flag= 0; V_PeakLoc= 7.93797; load_and_process() KillWaves/A/Z/F ShowTools/A HideTools/A ShowTools/A HideTools/A DoWindow/R load_and_process_1 print offset 1.4 ShowTools/A HideTools/A load_and_process() Legend/N=text0/A=MC Legend/N=text1/A=MC ModifyGraph marker=19,lsize=2,mode(sim1)=4,rgb(sim1)=(65535,0,0),mode(expt1_1)=0;DelayUpdate ModifyGraph rgb(expt1_1)=(0,0,0) ModifyGraph lsize(sim1)=1 Legend/C/N=text0/J "\\s(expbulk1) expt.\r\\s(simbulk1) simul." Legend/C/N=text1/J "\\s(expt1_1) expt.\r\\s(sim1) simul." CurveFit poly 5, expt1_1 /D fit_expt1_1= poly(W_coef,x) W_coef={1.9342,-0.050677,0.0010411,3.4185e-05,-8.0577e-07} V_chisq= 2.26398; V_npnts= 49; V_numNaNs= 0; V_numINFs= 0; W_sigma={0.144,0.0425,0.00365,0.000115,1.19e-06} CurveFit poly 5, expt1_1 /X=sim0 /D fit_expt1_1= poly(W_coef,x) W_coef={-0.86516,0.82526,-0.057835,0.0014854,-1.2892e-05} V_chisq= 2.26398; V_npnts= 49; V_numNaNs= 0; V_numINFs= 0; W_sigma={27.6,3.26,0.142,0.0027,1.9e-05} expt1_1/=fit_expt1_1 expt1_1*=1.4 expt1_1*=1.1 expt1_1*=1.1 CurveFit poly 5, expt1_1 /X=sim0 /D fit_expt1_1= poly(W_coef,x) W_coef={-7.3353,1.5167,-0.086637,0.0020285,-1.6711e-05} V_chisq= 2.39729; V_npnts= 49; V_numNaNs= 0; V_numINFs= 0; W_sigma={28.4,3.35,0.146,0.00278,1.96e-05} expt1_1/=fit_expt1_1 expt1_1*=1.4 CurveFit poly 5, expt1_1 /X=sim0 /D fit_expt1_1= poly(W_coef,x) W_coef={-10.478,1.7951,-0.096526,0.0021867,-1.7646e-05} V_chisq= 2.07588; V_npnts= 49; V_numNaNs= 0; V_numINFs= 0; W_sigma={26.4,3.12,0.136,0.00259,1.82e-05} expt1_1/=fit_expt1_1 expt1_1*=1.4 CurveFit poly 5, expt1_1 /X=sim0 /D fit_expt1_1= poly(W_coef,x) W_coef={-13.942,2.2255,-0.11658,0.0026015,-2.079e-05} V_chisq= 2.46112; V_npnts= 49; V_numNaNs= 0; V_numINFs= 0; W_sigma={28.8,3.4,0.148,0.00282,1.98e-05} expt1_1/=fit_expt1_1 expt1_1*=1.4 CurveFit poly 5, expt1_1 /X=sim0 /D fit_expt1_1= poly(W_coef,x) W_coef={-16.59,2.5588,-0.1323,0.0029303,-2.3309e-05} V_chisq= 2.77925; V_npnts= 49; V_numNaNs= 0; V_numINFs= 0; W_sigma={30.6,3.61,0.157,0.00299,2.11e-05} expt1_1*=fit_expt1_1 ShowTools/A SetVariable setvar0 proc=manual_offset SetVariable setvar0 proc=coarse_offset KillControl button2 Button bulkfit_button title="7. Fit to bulk" HideTools/A ShowTools/A HideTools/A CurveFit poly 3, expbulk1 /X=expbulk0 /D fit_expbulk1= poly(W_coef,x) W_coef={1,-5.5193e-10,-5.5563e-12} V_chisq= 3.50481; V_npnts= 163; V_numNaNs= 0; V_numINFs= 0; W_sigma={0.331,0.0192,0.00027} CurveFit poly 3, simbulk1 /X=simbulk0 /D fit_simbulk1= poly(W_coef,x) W_coef={1,-5.1706e-14,7.835e-16} V_chisq= 7.18495; V_npnts= 49; V_numNaNs= 0; V_numINFs= 0; W_sigma={1.56,0.09,0.00126} print W_coef[1]+W_coef[2] -3.6045e-14 CurveFit poly 3, expt1_1(xcsr(A),xcsr(B)) /X=sim0 /D fit_expt1_1= poly(W_coef,x) W_coef={0.37416,0.064976,-0.00085498} V_chisq= 2.54377; V_npnts= 45; V_numNaNs= 0; V_numINFs= 0; W_sigma={1.27,0.0713,0.000973} CurveFit poly 3, expt1_1(xcsr(A),xcsr(B)) /X=sim0 /D fit_expt1_1= poly(W_coef,x) W_coef={1.7791,-0.013923,0.00022802} V_chisq= 2.58083; V_npnts= 45; V_numNaNs= 0; V_numINFs= 0; W_sigma={1.28,0.0718,0.000981} RemoveFromGraph fit_expt1_1 RemoveFromGraph fit_simbulk1 RemoveFromGraph fit_expbulk1 RemoveFromGraph fit_expbulk1 ModifyGraph mode=4 ModifyGraph mode(expbulk1)=0 ShowTools/A HideTools/A Smooth 1, expbulk1 Smooth 1, expbulk1 Smooth/S=4 15, expbulk1 Smooth 15, expbulk1 Smooth 15, expbulk1 Smooth 15, expbulk1 expt1_1 saved Smooth 15, expbulk1 Smooth 15, expbulk1 Display Edit RemoveFromGraph fit_expbulk1 run_fit() jZDexpbulk0?-1BFB[BpMBB{BBĩB@BBoB B- BB4!BW!Blb"B"B#B'$B$BU%B%B&B'B)'B>I(BS(Bhw)B}*B*B<+B+Bj,B-B-B0.B%.B:^/BO/Bd0By#1B1BQ2B2B3B4B4B E5B 5B5s6BJ 7B_7Bt88B8Bf9B9BȔ:B+;B;BZB[>BpM?B?B{@BABĩAB@BBBBoCBDB-DBB4EBWEBlbFBFBGB'HBHBUIBIBJBKB)KB>ILBSLBhwMB}NBNBp>O>>>'>*>>>>z>BZ>>Y?8?01?D?u?c?m ??Wg?8?w8????k ? ?A8?) ?? ?2>[>?*(>j>D>?>iV>,+>]>k>>>9>'>>9>'>@>z>d>v>>>d>>/>IK>>.>Q>S'>>>J>> >>i>"۬>U>R>q>9simbulk0?-B@B@33333B@B@gffffB@C@C@333333C@LC@gfffffC@C@C@33333C@C@gffffC@D@D@333333D@LD@gfffffD@D@D@33333D@D@gffffD@E@E@333333E@LE@gfffffE@E@E@33333E@E@gffffE@F@F@333333F@LF@gfffffF@F@F@33333F@F@gffffF@G@G@333333G@LG@gfffffG@G@G@33333G@G@gffffG@H@H@333333H@LH@gfffffH@H@H@33333H@H@gffffH@I@I@333333I@LI@gfffffI@I@I@33333I@I@gffffI@J@J@333333J@LJ@gfffffJ@J@J@33333J@J@gffffJ@K@K@333333K@LK@gfffffK@K@K@33333K@K@gffffK@L@L@333333L@LL@gfffffL@L@L@33333L@L@gffffL@M@M@333333M@LM@gfffffM@M@M@33333M@M@gffffM@N@N@333333N@LN@gfffffN@N@N@33333N@N@gffffN@O@O@333333O@LO@gfffffO@O@simbulk1?-i3n~?թ{PM?$"\?Di?7}?݉E*?G?nHt ?yF4r?i?:L?Qw?Ѧ?:L?3Js?~>O?D`}j?D_?%I3R?0;?4Ѵ?fy6?l?^V?BsR?-ՠ?V?HiVH?o ?BRjv?J=pz?3?,KgX?alr?^<_c?ڨ?}}HoY?E+Oװ?2g?wZ?F3?j?B L?6.iV?"X?}z&?m-/?{z?,?kA;?jPbk?ǂ?bb?i%?p}n?xdX?{ƅ?x?zɜ9?o݆?>4v?/E?mHt ?k?tSn?lnA2??!?GjJ?r% %7D?5#?JE?Y{&TP?S1+?+8R?gj?\u=?W1?~?\5?Li3?)(i?YS?b4?ר'k?g9?'9?H?Hy?2f?hO?}?,?( ?5?cO0^?53,?cO0^?`exᙥ?aIR?S9%K?%.O?hk ?h?qW_coef?#w$ ?sim0?B@B@33333B@B@gffffB@C@C@333333C@LC@gfffffC@C@C@33333C@C@gffffC@D@D@333333D@LD@gfffffD@D@D@33333D@D@gffffD@E@E@333333E@LE@gfffffE@E@E@33333E@E@gffffE@F@F@333333F@LF@gfffffF@F@F@33333F@F@gffffF@G@G@333333G@LG@gfffffG@G@G@33333G@G@gffffG@H@H@333333H@LH@gfffffH@H@H@33333H@H@gffffH@I@I@333333I@LI@gfffffI@I@I@33333I@I@gffffI@J@J@333333J@LJ@gfffffJ@J@J@33333J@J@gffffJ@K@K@333333K@LK@gfffffK@K@K@33333K@K@gffffK@L@L@333333L@LL@gfffffL@L@L@33333L@L@gffffL@M@M@333333M@LM@gfffffM@M@M@33333M@M@gffffM@N@N@333333N@LN@gfffffN@N@N@33333N@N@gffffN@O@O@333333O@LO@gfffffO@O@sim1? c?,ȏ?es?܄?dD?GkW?u;j?{xp? ???e܅A?i~>?Zࣽɪ?,8P5?mx@?U'W/?2D>?BUZ? ?<ɶ??[Az?p{?FSe?k0?$5?6?ZF7 ?!\㺪?Ʊ7?WD?/;{C? /??֦FC%?;?{?2A؝?jH]0?eZ?#Gd1 ?*-ӿ?^?5|٣?H¦?~9EC?2?Zh?m; P7?fC8?x+??ՙ(?]?l?`3E7?2#G?dG6?Q?ng!?ƀwD3???!?\QX?x1Bd?Љ1?P?rwr?}6?dЇ ?oW?P@?I? |??F?F Б?1 Ie?*M?j6?v`h? ?J?{m?Uj?j}?_?y2?j?HpW?} T?Gk?% N?nG?KQ4>?݂l_?K? J?\w2?);?qOͳY?*N?w4s.? g- ?ڽR?jX?7J?l?Dj?)#?̍<0?V%?|6?൭\?2 :%?wgH?el?:7 b?B?s?H!?T:x?*-u@/m0?o?6?H+W?o@F?ۧOffset_Rvalue?Y0ZBZBY ZBYBYBYBgYBYBYBYBއYB%xYBhYBXYBIYB%:YB*YBYB YBXBOffset_RvalueX?q= = ׽QuQ8uu<>jZeexpbulk0_orig?P 2Be2Bz;3B3Bi4B5BΗ5B.6B6B ]7B"7B78BL"9Ba9BvP:B:B~;BB ?B3?BH7@B]@BreABABBB*CBCBXDBDBEBFB/FBDLGBYGBnzHBIBIB?JBJBmKBLBLB3MB*MB?a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O?/$?tV?ףp= ?#~j?{Gz?uV?7A`?'1Z?{Gz?$C?333333?q= ףp?}?5^I?ʡE?#~j?-?ףp= ?5^I ??Q?Cl?kt?K7A?l?S㥫?ˡE?/$?Mb? ףp= ?i|?5?ʡE?T㥛 ?oʡ?Q?$C?Mb?(\?K7A`?v??^I +?-?Gz?bX9?q= ףp?+?ʡE?sh|??w/?m?tV?q= ףp?Cl?/$?Q?jt?rh|?I +?Mb?Zd;?Zd;? +? ףp= ?Zd;?\(\?V-?Zd;?rh|?K?Ensimbulk0_orig?B@B@33333B@B@gffffB@C@C@333333C@LC@gfffffC@C@C@33333C@C@gffffC@D@D@333333D@LD@gfffffD@D@D@33333D@D@gffffD@E@E@333333E@LE@gfffffE@E@E@33333E@E@gffffE@F@F@333333F@LF@gfffffF@F@F@33333F@F@gffffF@G@G@333333G@LG@gfffffG@G@G@33333G@G@gffffG@H@H@333333H@LH@gfffffH@H@H@33333H@H@gffffH@I@I@333333I@LI@gfffffI@I@I@33333I@I@gffffI@J@J@333333J@LJ@gfffffJ@J@J@33333J@J@gffffJ@K@K@333333K@LK@gfffffK@K@K@33333K@K@gffffK@L@L@333333L@LL@gfffffL@L@L@33333L@L@gffffL@M@M@333333M@LM@gfffffM@M@M@33333M@M@gffffM@N@N@333333N@LN@gfffffN@N@N@33333N@N@gffffN@O@O@333333O@LO@gfffffO@O@jZhexpfit?++??Y$?B ??)V??^? ?)V?)V?}?Y$?B ?f?,?,??Og???ȹ???????^?6?B ?sڹ?sڹ?Ӄ???`??tx?f???[?>?f?[?5??%?ȹ?)V??5?+?B ?B ?4e?7O?tx?z?>?[?o??7O?h?5???ʐ??,?tx?^?>??>?ȹ?tx??ȹ?z?`?Y$K?,?>e>>>>,>,> r>+>vO>>>??MS??+?z??>?7O??[?v?%???6?6??F???%?tx??D?4e???? r?X?'m?]v?Ӄ??`?]v?X?F?fB?s9?,>?X??]v?(??Y$K??F?fB??D?fB?vO??(?4e?,?>?51??+? r?(?F?s9?vO? >,?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ё?-ϑ??O??c‘?z?*?$D?T?{ގ?y?2Ҋ?K?7]? ?ML?ټ?^?)?+?R? j???]?߈?É??d?؉?)?r?e?H?~W?O?e?C?OZ?l?Y??م? B?vD?Qk?l?ǂ?i/?|?)? ?]7?+?A??4փ??q?ނ?ʂ??@X?с?`ր???Q?ʀ??fit_expt1_1/M?9@.|F(? -ܙ?'?"dg>&?= C%?M$?]#?t"?~l!?q1 ?A?X9?;$N:?ks?_?k^!?uB?yM?a?7sF?,%=?>?š~?sN?`*Pk?Е/?h]o?(?1?ئ"?W@?a?= ? ?º}l?t%?ۖ?4?'tv?G:G? ~?! ?R?Kb?cR?<ۖ?(5?춧?Fat?64?N/?S?k?6?(F?C)zu?4i??Հ? $?9)j???#9u?TWN`?bŽ?,!?;?w;?f%n?{?'Ji?rh!? @q{?ǭ ?ܥ?KTC?{F6?PBa?՞???X ?U9bp?zG7?9V ?;c?ג앮 ?t!?D%p"?~=Z#?NI$?8*?@?˻A?%EC?jUD?~/F?n8G?+ ,[I?tJ?slL?RJN?3-uO?3Q?L!lS?:.U?V?ؿPX?їZ?I+q\?+\P^?vf5`?'IH b?Dd?$hf?ǵh?)+Aj? [l?Nn?~0p?ÌIr?7it??v?,@Ѷx?Rz?m!}?:yJ^?;֠?{ ;?1}w7?E?`8۪?PQP??s?Ak{?5]?RxE?D?P(*?`D?T)zo?7_V?C[n6?vU??T c\?=?{?K?C?8sf?DF?C,?^?x ?ϖ?7j0?L? a ?н?0?9K?XSl?<Β?Y ?4;{K?WN)?\)g?dܪ?=g?o_C?0??eU ?Ȏʻ?M:g(?Iۚ?ŎG(?i M?5.fit_expbulk1Q7E?`#S@//????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????fit_simbulk18߾?7@??????????????????????????????~?|?z?y?x?w?v?u?u?u?t?t?u?u?u?v?w?x?y?z?|?~????????????????????????????????? ??????"?&?+?/?4?8?=?A?F?K?P?U?Z?`?e?k?p?v?{?????????????????????????%?-?5?=?E?M?U?^?f?o?w???????????????? ??!?,?6?@?K?U?`?k?v????????????? ??#?/?;?G?T?`?m?z?????????W| Platform=WindowsNT, IGORVersion=3.100 NewPath/Z Sm ":::ims:Course:meis:Sm:" MoveWindow/C 73.5,122,708.75,300.5 MoveWindow/P 5.25,41,633.75,478.25 load_and_process() Offset_RValue_graph() Expand_RValue_graph() bulk_fit_window() Window bulk_fit_window() : Graph PauseUpdate; Silent 1 // building window... Display /W=(31.5,146.75,663,403.25) sim1 vs sim0 as "bulk_fit_window" AppendToGraph expt1_1 vs sim0 ModifyGraph mode(sim1)=4 ModifyGraph marker=19 ModifyGraph lSize(expt1_1)=2 ModifyGraph rgb(expt1_1)=(0,0,0) Legend/J/N=text1/A=MC/X=14.86/Y=38.46 "\\s(expt1_1) expt.\r\\s(sim1) simul." Textbox/N=text0/S=3/A=MC/X=-25.70/Y=37.56 "\\JC\\Z09Total correction applied:\roffset = -6.13\rexpansion = 1" Cursor A expt1_1 0;Cursor B expt1_1 135 ControlBar 50 Button button0,pos={468,25},size={129,20},proc=Revert_button,title="revert to original" Button button3,pos={467,2},size={130,20},proc=ButtonProc,title="load new data" SetVariable setvar0,pos={27,4},size={178,18},title="set offset range []" SetVariable setvar0,limits={0,5,0.1},value= offset_range SetVariable setvar0_1,pos={26,26},size={179,18},title="set expand range [%]" SetVariable setvar0_1,limits={0,5,0.5},value= expand_range Button button1_1,pos={210,4},size={117,19},proc=run_offset_fit_Button,title="run offset fit" Button button1_2,pos={213,26},size={114,18},proc=run_expand_fit_Button,title="run expand fit" SetVariable setvar1,pos={350,4},size={105,18},proc=manual_offset,title="offset" SetVariable setvar1,limits={-Inf,Inf,0.1},value= m_offset SetVariable setvar2,pos={335,26},size={120,18},proc=manual_expand,title="expand %" SetVariable setvar2,limits={-Inf,Inf,0.5},value= m_expand EndMacro Window Expand_RValue_graph() : Graph PauseUpdate; Silent 1 // building window... Display /W=(329.25,320,636.75,481.25) Expand_Rvalue vs Expand_RvalueX as "Expand:Rvalue" ModifyGraph ZisZ(bottom)=1 Label left "Expand R-value" Label bottom "% angle expansion []" EndMacro Window Offset_RValue_graph() : Graph PauseUpdate; Silent 1 // building window... Display /W=(3,320,326.25,479.75) Offset_Rvalue vs Offset_RvalueX as "Offset:Rvalue" ModifyGraph lowTrip(bottom)=0.01 ModifyGraph notation(bottom)=1 ModifyGraph ZisZ(bottom)=1 Label left "Offset R-value" Label bottom "angle offset []" EndMacro Window load_and_process() : Graph PauseUpdate; Silent 1 // building window... Display /W=(0,37.25,639.75,476.75) expbulk1 vs expbulk0 as "load and process data" AppendToGraph simbulk1 vs simbulk0 ModifyGraph mode(simbulk1)=4 ModifyGraph marker=19 ModifyGraph lSize(expbulk1)=2 ModifyGraph lStyle(simbulk1)=1 ModifyGraph rgb(expbulk1)=(0,0,0) ModifyGraph nticks(bottom)=10 Label left "scattering yield corrected for sin\\S4\\M\\F'Symbol'(q/2)" Label bottom "scattering angle [degrees]" Legend/J/N=text0/A=MC/X=41.11/Y=37.50 "\\s(expbulk1) expt.\r\\s(simbulk1) simul." Textbox/N=text1/F=0/S=2/A=MC/X=-1.51/Y=45.80 "\\JCexperimenta data from file - bulki.txt" AppendText "\tsimulation data from file - si100_111.out" ControlBar 130 Button find_sim_bulk,pos={25,40},size={50,18},proc=find_sim_bulk,title="2. find" SetVariable setvar1,pos={80,40},size={269,18},title="sim data; ",frame=0 SetVariable setvar1,limits={-Inf,Inf,1},value= simbulk Button find_exp_bulk,pos={25,10},size={50,18},proc=find_exp_bulk,title="1. find" SetVariable setvar2,pos={80,10},size={269,18},title="exp data; ",frame=0 SetVariable setvar2,limits={-Inf,Inf,1},value= expbulk Button bulkfit_button,pos={289,74},size={129,44},proc=refresh_button,title="7. Fit to bulk" Button spline_button,pos={25,70},size={68,17},proc=spline_button,title="5. spline" Button Revert,pos={456,98},size={143,20},proc=Revert_button,title="revert to original" SetVariable setvar3,pos={366,11},size={235,18},title="3. Number of atoms per layer; " SetVariable setvar3,limits={1,10,1},value= n_layer SetVariable setvar4,pos={360,39},size={243,18},title="4. Number of atoms to remove; " SetVariable setvar4,limits={1,10,1},value= natoms SetVariable setvar0,pos={27,101},size={194,18},proc=coarse_offset,title="6. set coarse offset" SetVariable setvar0,limits={-Inf,Inf,0.1},value= offset EndMacro ?//version ?? 13/2/97 | START OF BULK FITTING BIT |______________________________________________________ function igorstartornewhook (igorapplicationnamestr) string igorapplicationnamestr make/O expbulk0, expbulk1, simbulk0, simbulk1 string /G expbulk="no_filename" string /G simbulk="no_filename" variable/G smoothflag=0 variable/G n_layer=4 variable/G natoms=8 variable/G delta_angle=0.5 variable/G Ne1, Ne2, Ns1, Ns2 variable/G Rv, offset, m_offset, expand, m_expand variable/G , offset_range, expand_range string/G str1, str2 end macro find_sim_bulk(ctrlName) : ButtonControl String ctrlName pauseupdate Loadwave/Q/G/D/O/W/N=simbulk/L={0,0,200,0,10} simbulk=S_filename if (natoms>0) simbulk1=simbulk1-(simbulk2)/n_layer |removes adorsbate contribution endif if (natoms>1) simbulk1=simbulk1-(simbulk3)/n_layer |removes adorsbate contribution endif if (natoms>2) simbulk1=simbulk1-(simbulk4)/n_layer |removes adorsbate contribution endif if (natoms>3) simbulk1=simbulk1-(simbulk5)/n_layer |removes adorsbate contribution endif if (natoms>4) simbulk1=simbulk1-(simbulk6)/n_layer |removes adorsbate contribution endif if (natoms>5) simbulk1=simbulk1-(simbulk7)/n_layer |removes adorsbate contribution endif if (natoms>6) simbulk1=simbulk1-(simbulk8)/n_layer |removes adorsbate contribution endif if (natoms>7) simbulk1=simbulk1-(simbulk9)/n_layer |removes adorsbate contribution endif if (smoothflag>0) smooth 3, simbulk1 endif simbulk=S_filename wavestats/Q simbulk1 simbulk1/=v_avg Duplicate/O simbulk0 simbulk0_orig Duplicate/O simbulk1 simbulk1_orig textbox/K/N=text1 Textbox/N=text1/F=0/S=2/A=MC/X=-1.51/Y=45.80 "\\JCexperimenta data from file - "+expbulk AppendText "\tsimulation data from file - "+simbulk End macro find_exp_bulk(ctrlName) : ButtonControl String ctrlName PauseUpDate loadwave /G/O/A/Q/N=expbulk expbulk=S_filename wavestats/Q expbulk1 expbulk1/=v_avg Duplicate/O expbulk0 expbulk0_orig Duplicate/O expbulk0 expbulk0_mod Duplicate/O expbulk1 expbulk1_orig textbox/K/N=text1 Textbox/N=text1/F=0/S=2/A=MC/X=-1.51/Y=45.80 "\\JCexperimenta data from file - "+expbulk AppendText "\tsimulation data from file - "+simbulk End function test() variable range, inc, number, M, N range=0.4 inc=0.02 number=range/inc+1 pauseupdate make/O/N=(number) Offset_Rvalue=5 make/O/N=(number) Offset_RvalueX Offset_RvalueX=x*inc-range/2 Duplicate/O expbulk0 expt10 //temporary values of matched exp data Duplicate/O expbulk1 expt11 //temporary values of matched exp data Duplicate/O simbulk0 sim0 Duplicate/O simbulk1 sim1 //temporary values of matched sim data smooth 3, expt11 smooth 3, sim1 wavestats/Q sim1 sim1-=v_min //expands sim Y scale to maximise blocking dip intensity sim1/=(v_max-v_min) //expands sim Y scale to maximise blocking dip intensity sim1+=v_avg //expands sim Y scale to maximise blocking dip intensity wavestats/Q expt11 expt11-=v_min //expands exp Y scale to maximise blocking dip intensity expt11/=(v_max-v_min) //expands exp Y scale to maximise blocking dip intensity expt11+=v_avg //expands exp Y scale to maximise blocking dip intensity delta_angle=(sim0[numpnts(sim0)]-sim0[0])/(numpnts(sim0)-1) K5=(expbulk0[numpnts(expbulk0)]-expbulk0[0])/delta_angle make/O/N=(K5) expt1, expt0 expt1=faverageXY(expt10, expt11, (expt10[0]+delta_angle*(x-0.5)), (expt10[0]+delta_angle*(x+0.5))) expt0=expbulk0[0]+x*delta_angle duplicate/O sim1 expt1_1 expt1_1=interp(sim0, expt0, expt1) //adjusts expt1_1 values to be in line with sim1 end function offset_fit() variable inc, number, M, N pauseupdate if (offset_range>0) inc=offset_range/20 number=21 K9=-offset_range/2 //start value make/O/N=(number) Offset_Rvalue=NaN make/O/N=(number) Offset_RvalueX Offset_RvalueX=x*inc-offset_range/2 Duplicate/O expbulk0 expt10 //temporary values of matched exp data Duplicate/O expbulk1 expt11 //temporary values of matched exp data Duplicate/O simbulk0 sim0 //temporary values of matched sim data Duplicate/O simbulk1 sim1 //temporary values of matched sim data smooth 3, expt11 smooth 3, sim1 wavestats/Q sim1 sim1-=v_min //expands sim Y scale to maximise blocking dip intensity sim1/=(v_max-v_min) //expands sim Y scale to maximise blocking dip intensity sim1+=v_avg //expands sim Y scale to maximise blocking dip intensity wavestats/Q expt11 expt11-=v_min //expands exp Y scale to maximise blocking dip intensity expt11/=(v_max-v_min) //expands exp Y scale to maximise blocking dip intensity expt11+=v_avg //expands exp Y scale to maximise blocking dip intensity delta_angle=(sim0[numpnts(sim0)]-sim0[0])/(numpnts(sim0)-1) K5=(expbulk0[numpnts(expbulk0)]-expbulk0[0])/delta_angle make/O/N=(K5) expt1, expt0 M=0 do expt10=expbulk0+K9 //adds offset K9 expt1=faverageXY(expt10, expt11, (expt10[0]+delta_angle*(x-0.5)), (expt10[0]+delta_angle*(x+0.5))) expt0=expt10[0]+x*delta_angle duplicate/O sim1 expt1_1 expt1_1=interp(sim0, expt0, expt1) //adjusts expt1_1 values to be in line with sim1 Rv=0 N=0 //start of r-value calculation do Rv=Rv+((sim1[N]-expt1_1[N])/expt1_1[N])^2 N=N+1 while (N<(pcsr(B)-pcsr(A))) Rv=100*(Rv/Numpnts(sim1))^0.5 Offset_Rvalue[M]=Rv doupdate M+=1 K9+=inc //angular increment while (K9<(offset_range/2)) //end value endif end Function expand_fit() variable inc, number, M, N pauseupdate if (expand_range>0) inc=expand_range/20/100 number=21 K9=1-expand_range/2/100 //start value make/O/N=(number) Expand_Rvalue=NaN make/O/N=(number) Expand_RvalueX Expand_RvalueX=(x*inc-expand_range/100/2)*100 Duplicate/O expbulk0 expt10 //temporary values of matched exp data Duplicate/O expbulk1 expt11 //temporary values of matched exp data Duplicate/O simbulk0 sim0 //temporary values of matched exp data Duplicate/O simbulk1 sim1 //temporary values of matched sim data smooth 3, expt11 smooth 3, sim1 wavestats/Q sim1 sim1-=v_min //expands sim Y scale to maximise blocking dip intensity sim1/=(v_max-v_min) //expands sim Y scale to maximise blocking dip intensity sim1+=v_avg //expands sim Y scale to maximise blocking dip intensity wavestats/Q expt11 expt11-=v_min //expands exp Y scale to maximise blocking dip intensity expt11/=(v_max-v_min) //expands exp Y scale to maximise blocking dip intensity expt11+=v_avg //expands exp Y scale to maximise blocking dip intensity delta_angle=(sim0[numpnts(sim0)]-sim0[0])/(numpnts(sim0)-1) K5=(expbulk0[numpnts(expbulk0)]-expbulk0[0])/delta_angle make/O/N=(K5) expt1, expt0 wavestats/Q expbulk0 M=0 do expt10= expbulk0 //sets to original angle scale expt10-=(V_min+V_max)/2 expt10*=K9 expt10+=(V_min+V_max)/2 //calculates new angle range expt1=faverageXY(expt10, expt11, (expt10[0]+delta_angle*(x-0.5)), (expt10[0]+delta_angle*(x+0.5))) expt0=expt10[0]+x*delta_angle duplicate/O sim1 expt1_1 expt1_1=interp(sim0, expt0, expt1) //adjusts expt1_1 values to be in line with sim1 Rv=0 N=0 //start of r-value calculation do Rv=Rv+((sim1[N]-expt1_1[N])/expt1_1[N])^2 N=N+1 while (N<(pcsr(B)-pcsr(A))) Rv=100*(Rv/Numpnts(sim1))^0.5 Expand_Rvalue[M]=Rv doupdate M+=1 K9+=inc //expansion increment while (K9<=(1+expand_range/100/2)) //end value endif end Function spline_button(ctrlName) : ButtonControl String ctrlName PauseUpDate K9=1e-11 Duplicate/O expbulk1 expfit CurveFit/Q poly 3, expbulk1 /X=expbulk0 /D expbulk1/=fit_expbulk1 do CurveFit/Q poly 3, expbulk1 /X=expbulk0 /D expbulk1/=fit_expbulk1 while (W_coef[1]+W_coef[2]>K9) Duplicate/O simbulk1 simfit CurveFit/Q poly 3, simbulk1 /X=simbulk0 /D simbulk1/=fit_simbulk1 do CurveFit/Q poly 3, simbulk1 /X=simbulk0 /D simbulk1/=fit_simbulk1 while (W_coef[1]+W_coef[2]>K9) //expbulk1_orig=expbulk1 //simbulk1_orig=simbulk1 End Window Offset_RValue_graph() : Graph PauseUpdate; Silent 1 | building window... Display /W=(4,316,327,476) Offset_Rvalue vs Offset_RvalueX as "Offset:Rvalue" ModifyGraph lowTrip(bottom)=0.01 ModifyGraph notation(bottom)=1 ModifyGraph ZisZ(bottom)=1 Label left "Offset R-value" Label bottom "angle offset []" EndMacro Window Expand_RValue_graph() : Graph PauseUpdate; Silent 1 | building window... Display /W=(330,316,638,477) Expand_Rvalue vs Expand_RvalueX as "Expand:Rvalue" ModifyGraph ZisZ(bottom)=1 Label left "Expand R-value" Label bottom "% angle expansion []" EndMacro Function Revert_button(ctrlName) : ButtonControl String ctrlName expbulk0=expbulk0_orig expbulk1=expbulk1_orig dowindow/F load_and_process End Function ButtonProc(ctrlName) : ButtonControl String ctrlName dowindow/F load_and_process End Function refresh_button(ctrlName) : ButtonControl String ctrlName execute"refresh()" end function refresh() Duplicate/O expbulk0 expt10 //temporary values of matched exp data Duplicate/O expbulk1 expt11 //temporary values of matched exp data Duplicate/O simbulk0 sim0 //temporary values of matched sim data Duplicate/O simbulk1 sim1 //temporary values of matched sim data smooth 3, expt11 smooth 3, sim1 wavestats/Q sim1 sim1-=v_min //expands sim Y scale to maximise blocking dip intensity sim1/=(v_max-v_min) //expands sim Y scale to maximise blocking dip intensity sim1+=v_avg //expands sim Y scale to maximise blocking dip intensity wavestats/Q expt11 expt11-=v_min //expands exp Y scale to maximise blocking dip intensity expt11/=(v_max-v_min) //expands exp Y scale to maximise blocking dip intensity expt11+=v_avg //expands exp Y scale to maximise blocking dip intensity delta_angle=(sim0[numpnts(sim0)]-sim0[0])/(numpnts(sim0)-1) K5=(expbulk0[numpnts(expbulk0)]-expbulk0[0])/delta_angle make/O/N=(K5) expt1, expt0 expt1=faverageXY(expt10, expt11, (expt10[0]+delta_angle*(x-0.5)), (expt10[0]+delta_angle*(x+0.5))) expt0=expbulk0[0]+x*delta_angle duplicate/O sim1 expt1_1 expt1_1=interp(sim0, expt0, expt1) //adjusts expt1_1 values to be in line with sim1 dowindow/F offset_rvalue_graph dowindow/F expand_rvalue_graph dowindow/F bulk_fit_window execute "calculate_mods()" End macro run_fit() silent 1 offset_fit() //first offset wavestats/Q Offset_Rvalue offset=offset_rvalueX[V_minloc] expbulk0+=offset expand_fit() //first expand wavestats/Q Expand_Rvalue expand=Expand_RvalueX[V_minloc] wavestats/Q expbulk0 expbulk0-=(V_min+V_max)/2 expbulk0*=(1+expand/100) expbulk0+=(V_min+V_max)/2 refresh() end Function run_bulk_fit_Button(ctrlName) : ButtonControl String ctrlName execute "run_fit()" End Window bulk_fit_window() : Graph PauseUpdate; Silent 1 | building window... Display /W=(5,42,637,298) sim1 vs sim0 as "bulk_fit_window" Append expt1_1 vs sim0 ModifyGraph mode(expt1_1)=4 ModifyGraph marker(expt1_1)=19 ModifyGraph lSize(sim1)=2 ModifyGraph rgb(sim1)=(0,0,0) Textbox/N=text0/S=3/A=MC/X=-35.00/Y=40.00 "\\JC\\Z09Total correction applied:\roffset = 1.28656\rexpansion = 0.982107" Cursor A expt1_1 6;Cursor B expt1_1 48 ControlBar 50 Button button0,pos={468,25},size={129,20},proc=Revert_button,title="revert to original" Button button3,pos={467,2},size={130,20},proc=ButtonProc,title="load new data" SetVariable setvar0,pos={27,4},size={178,17},title="set offset range []" SetVariable setvar0,limits={0,5,0.1},value= offset_range SetVariable setvar0_1,pos={26,26},size={179,17},title="set expand range [%]" SetVariable setvar0_1,limits={0,5,0.5},value= expand_range Button button1_1,pos={210,4},size={117,19},proc=run_offset_fit_Button,title="run offset fit" Button button1_2,pos={213,26},size={114,18},proc=run_expand_fit_Button,title="run expand fit" SetVariable setvar1,pos={350,4},size={105,17},proc=manual_offset,title="offset" SetVariable setvar1,limits={-INF,INF,0.1},value= m_offset SetVariable setvar2,pos={335,26},size={120,17},proc=manual_expand,title="expand %" SetVariable setvar2,limits={-INF,INF,0.5},value= m_expand EndMacro Function run_offset_fit_Button(ctrlName) : ButtonControl String ctrlName execute "run_offset_fit()" End macro run_offset_fit() pauseupdate textbox/K/N=text0 offset_fit() //first offset wavestats/Q Offset_Rvalue offset=offset_rvalueX[V_minloc] expbulk0+=offset refresh() end Function run_expand_fit_Button(ctrlName) : ButtonControl String ctrlName execute "run_expand_fit()" End macro run_expand_fit() pauseupdate textbox/K/N=text0 expand_fit() //first expand wavestats/Q Expand_Rvalue expand=Expand_RvalueX[V_minloc] wavestats/Q expbulk0 expbulk0-=(V_min+V_max)/2 expbulk0*=(1+expand/100) expbulk0+=(V_min+V_max)/2 refresh() end function calculate_mods() pauseupdate; silent 1 textbox/K/N=text0 CurveFit/Q line expbulk0 /X=expbulk0_orig wavestats/Q expbulk0 K0=W_coef[0]+(V_max+V_min)/2*(W_coef[1]-1) Textbox/N=text0/S=3/A=MC/X=-35/Y=40 "\\JC\Z09Total correction applied:" sprintf str2 "offset = %g", K0 AppendText/N=text0 str2 sprintf str1 "expansion = %g", W_coef[1] AppendText/N=text0 str1 end Function coarse_offset(ctrlName,varNum,varStr,varName) : SetVariableControl String ctrlName Variable varNum String varStr String varName expbulk0=expbulk0_orig+offset End Function manual_offset(ctrlName,varNum,varStr,varName) : SetVariableControl String ctrlName Variable varNum String varStr String varName expbulk0+=m_offset m_offset=0 execute "refresh()" End Function manual_expand(ctrlName,varNum,varStr,varName) : SetVariableControl String ctrlName Variable varNum String varStr String varName wavestats/Q expbulk0 expbulk0-=(V_min+V_max)/2 expbulk0*=(1+m_expand/100) expbulk0+=(V_min+V_max)/2 m_expand=0 execute "refresh()" End Window load_and_process() : Graph PauseUpdate; Silent 1 | building window... Display /W=(0,40,640,480) expbulk1 vs expbulk0 as "load and process data" Append simbulk1 vs simbulk0 ModifyGraph mode(simbulk1)=4 ModifyGraph marker=19 ModifyGraph lSize(expbulk1)=2 ModifyGraph lStyle(simbulk1)=1 ModifyGraph rgb(expbulk1)=(0,0,0) ModifyGraph nticks(bottom)=10 Label left "scattering yield corrected for sin\\S4\\M\\F'Symbol'(q/2)" Label bottom "scattering angle [degrees]" Textbox/N=text1/F=0/S=2/A=MC/X=-1.51/Y=45.80 "\\JCexperimenta data from file - "+expbulk AppendText "\tsimulation data from file - "+simbulk ControlBar 130 Button find_sim_bulk,pos={25,40},size={50,18},proc=find_sim_bulk,title="2. find" SetVariable setvar1,pos={80,40},size={269,17},title="sim data; ",frame=0 SetVariable setvar1,limits={-INF,INF,1},value= simbulk Button find_exp_bulk,pos={25,10},size={50,18},proc=find_exp_bulk,title="1. find" SetVariable setvar2,pos={80,10},size={269,17},title="exp data; ",frame=0 SetVariable setvar2,limits={-INF,INF,1},value= expbulk Button bulkfit_button,pos={289,74},size={129,44},proc=refresh_button,title="8. Fit to bulk" Button spline_button,pos={25,70},size={68,17},proc=spline_button,title="5. spline" Button Revert,pos={456,98},size={143,20},proc=Revert_button,title="revert to original" SetVariable setvar3,pos={366,11},size={235,17},title="3. Number of atoms per layer; " SetVariable setvar3,limits={1,10,1},value= n_layer SetVariable setvar4,pos={360,39},size={243,17},title="4. Number of atoms to remove; " SetVariable setvar4,limits={1,10,1},value= natoms Button button2,pos={214,98},size={60,20},proc=apply_button,title="7. apply" SetVariable setvar0,pos={26,100},size={181,17},title="6. set coarse offset" SetVariable setvar0,limits={-INF,INF,0.1},value= offset EndMacro