4Misc_Start4Platform@ xHH@Rg(HHdh xHH@Rg(HHdh x HH(Ge(HHdh ^Graph*WDashSettings#  ! Fo[}6Normal@ Monaco<HHHH$$4 4 4 4 4 4 homeHdJJW MBP:Users:jjw:Desktop:inbox:IP Tests:ZJJW MBPΗsH+*IP TestsT`d inboxΗ`*Zd,JJW MBP:Users:jjw:Desktop:inbox:IP TestsIP TestsJJW MBP Users/jjw/Desktop/inbox/IP Tests/ RecentWindowsAuto Correlation AnalysisCorrelation Fit ResultsCorrelation PeakCurve Fitting.ihfErrors.ihfIgor Reference.ihfInformationProgramming.ihf 4Misc_EndTXOPState_Start PeakFunctions2-64JW MBP:Users:j4XOPState_Enda?j=(>@V_FlagV_exists?!n  data!na?j=(>@V_Flag'h_]չieauto_corr1ex&1????fffffVT7 ߝļ7 >uuɜ%?(hV0caoj 0㖥:ø6#뚺&#iՆi1corr_std1???@Y@ȣ o:?)A|?ݴ?g\֧t?X s?N<6?jE?%?\L?x?t?~> ?,h??v4k?}x??k{[J}?ܧ?65s\?銿?1R? FLꆯ@i@t}@`^x@:iP4@YTiՆi1corr_width1???@Y@@ɀ=@ =@Ȑ=@=@B=@=@b=@=@q=@`m=@`0>@`>@2>@`L>@`h>@@">@>@ >@">@ K>@`>@?@`xG?@k?@@?@P?@?@`|?@U?@E>@l<@9@`a6@3@ =0@@C-@`)@ZT'@@%@("@ @ 8@@@E@@@@"A@A@_@|hi ieauto_corr2ex&1????fffffVTcq-;9>=ޔ1]>dh6L>+L8Kq>ϱwp>۫>+Kۉ>r>-a>Zc;:>(>\7{>6,~>otD>T8JK> d>dS?a+(?6F?N[smV?)Ꟙc?Aa_%m?;QMx?ܡNU?s)?KT )?)X?<_?⸄?j=?4䰚Sm?Ym? *\?=TpL?V;?[?,Q` ?I=>?bU?L `?G`??P?j??%k??P?c`?< `?bU?F=>?7Q` ?[?V;?=TpL?"*\?`m?F䰚Sm?j=?+g>?7'??g?ځEr?(W?u?0⸄8JK>4D>,~>3\7{>(>0ab;:>@-a>r>EKۉ>˻>pwp>\(L8Kq>m4L>1]>>=(9XiՆiW_sigma????PG%s]Hr>~1p>]9;>lLViՆiw_coef????a?j=>@  Packages!n  EasyNewNotebook!na?j=(>@left@right>@top@bottomT@fsize(@killtitle٭ Informationfont٭ Helvetica  PackageTools!na?j=(>@showatstart?showatcompilelogfile٭Fri, Jun 16, 2017, 15:20:54 -- Setup Package: PackageTools 2.00 Fri, Jun 16, 2017, 15:20:54 -- Setup Package: EasyNewNotebook 2.30 Fri, Jun 16, 2017, 15:20:54 -- Setup Package: ScreenSizer 2.51  Keys!na?j=(>@PackageTools٭package:PackageTools;folder:PackageTools;file:PackageTools.ipf;info:Tools to manage packages;author:Jeffrey J Weimer;version:2;hasHelp:0;removable:0;EasyNewNotebook٭package:EasyNewNotebook;folder:root_Packages_EasyNewNotebook;file:EasyNewNotebook.ipf;info:An easy way to initialize the setup of a notebook;author:Jeffrey J Weimer;version:2.3;hasHelp:1;ScreenSizerook٭package:ScreenSizer;folder:ScreenSizer;file:ScreenSizer.ipf;info:Functions to place windows using percentage of screen size;author:Jeffrey J Weimer;version:2.51;hasHelp:1;removable:1;  ScreenSizer!<8a?j=(>@scrwpxl0@scrhpxl%@scrwpnt0@scrhpnt%@scrleftscrtopscrrightY@scrbottomY@ *Id0TMW0RGIInformation0Information0InformationHH@Rg(HHdh @]UjV@]UjV$Normal 6< BHHHH$$8 XZX. $ - jjw  JThis package calculates the Gaussian half-width from a correlation trace. QThe left graph should always be the active window with the trace(s) of interest. IIn this example, the top (blue) trace is the square of the bottom trace.  XUse the panel to select the trace to analyze. Click the Get Correlation Results button. @The values are returned in the graph of Correlation Fit Results.Z0< @6/16/17HelveticaSpecial0// Platform=Macintosh, IGORVersion=7.040, architecture=Intel, systemTextEncoding="MacRoman", historyTextEncoding="MacRoman", procwinTextEncoding="MacRoman", recreationTextEncoding="MacRoman", build=29312 #pragma TextEncoding = "MacRoman" Silent 101 // use | as bitwise or -- not comment. DefaultFont "Helvetica" Graph0() MoveWindow/P 111,70,637,859 MoveWindow/C 31,455,532,573 Graph1() String/G root:gWMSetNextTextFilesTextEncoding = "MacRoman" // Text encoding for Information0. Used by Igor Pro 7. OpenNotebook/N=Information0/W=(533,527,1021,691)/J=10853 "Information0" as "Information" ACAnalysis() KillStrings/Z root:gWMSetNextTextFilesTextEncoding Window ACAnalysis() : Panel PauseUpdate; Silent 1 // building window... NewPanel /W=(536,59,795,145) as "Auto Correlation Analysis" Button buttonDoIt,pos={24.00,45.00},size={180.00,20.00},proc=ButtonProc,title="Get Correlation Results" Button buttonDoIt,fSize=14 PopupMenu popupLoW,pos={19.00,14.00},size={187.00,23.00},title="Trace to Analyze" PopupMenu popupLoW,fSize=12,mode=1,popvalue="auto_corr1",value= #"LoWinFWin()" EndMacro Window Graph1() : Graph PauseUpdate; Silent 1 // building window... String fldrSav0= GetDataFolder(1) SetDataFolder root:data: Display /W=(541,174,983,503) corr_width as "Correlation Fit Results" SetDataFolder fldrSav0 ModifyGraph mode=3 ModifyGraph marker=8 ModifyGraph rgb=(0,0,0) ModifyGraph mirror=2 ModifyGraph fSize=14 Label left "\\Z16Gauss Half-Width" Label bottom "\\Z16Points in Fit" SetAxis/N=1 left 0,* SetAxis bottom 0,* ErrorBars corr_width Y,wave=(:data:corr_std,:data:corr_std) EndMacro Window Graph0() : Graph PauseUpdate; Silent 1 // building window... String fldrSav0= GetDataFolder(1) SetDataFolder root:data: Display /W=(35,59,533,427) auto_corr1,auto_corr2 as "Correlation Peak" SetDataFolder fldrSav0 ModifyGraph mode=3 ModifyGraph marker=19 ModifyGraph rgb(auto_corr1)=(0,0,0),rgb(auto_corr2)=(1,4,52428) ModifyGraph offset(auto_corr2)={0,0.385421106719376} EndMacro #pragma rtGlobals=3 Function ButtonProc(ba) : ButtonControl STRUCT WMButtonAction &ba switch( ba.eventCode ) case 2: // mouse up // click code here GetCorrelations() break case -1: // control being killed break endswitch return 0 End Function/S LoWinFWin() return(TraceNameList("",";",1)) end Function GetCorrelations() string theTrace ControlInfo/W=ACAnalysis popupLoW theTrace = s_value wave ww = TraceNametoWaveRef("",theTrace) CalculateCorrelationWaves(ww) return 0 end // get the correlation values // overwrites/creates waves corr_wavename, corrstd_wavename // assumes ww has odd number of points centered at 0 Function CalculateCorrelationWaves(ww) wave ww DFREF cdf = GetDataFolderDFR() DFREF wdf = GetWavesDataFolderDFR(ww) SetDataFolder wdf // local variables variable npts = numpnts(ww) variable lnpts = 3 // fit is never valid below 5 points in the wave // always removing 2 points from wave during fit variable maxsteps = ((npts - lnpts)/2) variable ic string cwname = "corr_width" string cswname = "corr_std" // create/overwrite the correlation waves make/D/O/N=(maxsteps) $cwname, $cswname wave cw = $cwname wave csw = $cswname cw = NaN csw = NaN SetScale/P x, npts, -2, $cwname, $cswname // create the curve fit waves make/O/N=3 w_coef = {0,1,1} make/O/N=3 w_sigma = 0 for (ic=0;ic