4Misc_Start PICT_0o7M|lHM EMF|\ X`0CorelEMF         % '=% V,5AA6@5'=% (  % (  % '=% V,-A6A5.-@6'=% (  % (  % '=% V,-9.98-'=% (  % (  % '=% V,U$$ UV"'=% (  % (  % '=% V,.V V.-V'=% (  % (  % '%"% V@(D@S @R?Q)D(F>S@R@R@Q?Q'%"% ( % '%"% V@7Q@^ 8]:]@R>Q7\8]8]9^:]% ( % '%"% V@!N9] !O"Q8]9[#N!O!O!P"Q% ( % '%"% V@!C*P )D'D!O$P*F)D)D(C'D% (  % (  % '=% V@24 3 4 432 3 2 2 3 '=% ( % '=% V,3; :3 3 ;% (  % ( ;% '% 6E6E66<>D% ( ;,4% '% 6E46E76,76,4<>,4D6% ( ;T% '% 6T6X6X6T<>TW% ( ;u% '% 62u62x6x6u<>u1w% ( ;!&%"% '% 6H%6H(6$6!<?!G'% ( % (       &=% '=% [*         % ( % (       &=% '=% VL%. %%&&--..--&&     % ( % (       &%"% '%"% VLBN NNDEFFEDDCBB     % ( % (       &%"% '%"% V??FK$FJFK?K?J@IAHBHCFDEECEBEADAD@C@B@AA@A@B?B@A@@B?C?D?E@FAFBFCFDEEDFCHBHAIAJ     % ( % (  % '%"% V@(C,E ,D+C(D)E+E,D,D,C+C'%"% ( % '%"% V@*D,G ,G,F,D*D+G,G+G+G,G% ( % '%"% V@+D/G /E.E+E,G.G/E/E/D.E% ( % '%"% V@-E0I /I0H/E-F.H/I.H.I/I% ( % '%"% V@/F2I 2G1G/G/I2H2G2G2F1G% ( % '%"% V@0G3K 2K3J2G0H1J2K1J1K2K% ( % '%"% V@2H6K 6I4H2I2K5J6I6I5H4H% ( % '%"% V@4I6M 6M6L6I4J4L6M4L5M6M% ( % '%"% V@5J9M 9K8J5K6M8L9K9K9J8J% ( % '%"% V@7K:O 9O:N9K7L8N9O8N8O9O% ( % '%"% V@8L<O <M;L8M9O;N<M<M<L;L% ( % '%"% V@:M=Q <Q=P<M:M;P<Q;P;Q<Q% ( % '%"% V@<N?Q ?O>N<O<Q?P?O?O?N>N% ( % '%"% V,>O@R@Q?O>O>R% (  % (  NPICT_1o7MlHM EMFL X`0CorelEMF        ;@6&=% 6<@6?% ( ;.&=% 6@6<@.?5% ( ;9&=% 6.<@.8% ( ;V&=% 6#<@V"% ( ;.&=% 6V<@-U% (  % '%"% V@(D@S @R?Q)D(F>S@R@R@Q?Q'%"% ( % '%"% V@7Q@^ 8]:]@R>Q7\8]8]9^:]% ( % '%"% V@!N9] !O"Q8]9[#N!O!O!P"Q% ( % '%"% V@!C*P )D'D!O$P*F)D)D(C'D% (  % ( ;4&=% % 63 6:<@39 % ( ;% '% 6E6E66<>D% ( ;,4% '% 6E46E76,76,4<>,4D6% ( ;T% '% 6T6X6X6T<>TW% ( ;u% '% 62u62x6x6u<>u1w% ( ;!&%"% '% 6H%6H(6$6!<?!G'% ( % (       &=% '=% [*         % ( % (       &=% '=% VL%. %%&&--..--&&     % ( % (       &%"% '%"% VLBN NNDEFFEDDCBB     % ( % (       &%"% '%"% V??FK$FJFK?K?J@IAHBHCFDEECEBEADAD@C@B@AA@A@B?B@A@@B?C?D?E@FAFBFCFDEEDFCHBHAIAJ     % ( % (  % '%"% V@5\9^ 5]6^9]9\6\5]5]6^6^'%"% ( % '%"% V@5Y7] 5Z5[5]7]6Z5Z6Z6Y5Z% ( % '%"% V@2Z6] 2\3\6\5Z3Z2\2\2]3\% ( % '%"% V@1X4\ 2X1Y2\4[3Y2X3Y3X2X% ( % '%"% V@/X2[ /Z0Z2Z2X/Y/Z/Z/[0Z% ( % '%"% V@.V1Z /V.W/Z1Y0W/V0W0V/V% ( % '%"% V@+V/Y +X-X/X/V,W+X+X,Y-X% ( % '%"% V@+T-X +T+U+X-W-U+T-U,T+T% ( % '%"% V@(T,W (V)W,V+T)U(V(V(W)W% ( % '%"% V@(R*V (R(S(V*U)S(R)S)R(R% ( % '%"% V@%R)U %T&U)T(R&S%T%T%U&U% ( % '%"% V@$P'T %P$Q%T'T&Q%P&Q&P%P% ( % '%"% V@"P%S "R#S%R%P"Q"R"R"S#S% ( % '%"% V,!O$R!P"R$R#O% (  % (  PICT_2o7M|lHM EMF|\ X`0CorelEMF         % '=% V,5AA6@5'=% (  % (  % '=% V,-A6A5.-@6'=% (  % (  % '=% V,-9.98-'=% (  % (  % '=% V,U$$ UV"'=% (  % (  % '=% V,.V V.-V'=% (  % (  % '%"% V@ 1&@ %?$>1 3#@%?%?&>$>'%"% ( % '%"% V@>%K JJ%?#>IJJKJ% ( % '%"% V@;J <>JH;<<=>% ( % '%"% V@0= 1 1< =311 0 1% (  % (  % '=% V@24 3 4 432 3 2 2 3 '=% ( % '=% V,3; :3 3 ;% (  % ( ;% '% 6E6E66<>D% ( ;,4% '% 6E46E76,76,4<>,4D6% ( ;T% '% 6T6X6X6T<>TW% ( ;u% '% 62u62x6x6u<>u1w% ( ;!&%"% '% 6H%6H(6$6!<?!G'% ( % (       &=% '=% [*         % ( % (       &=% '=% VL%. %%&&--..--&&     % ( % (       &%"% '%"% VLBN NNDEFFEDDCBB     % ( % (       &%"% '%"% V??FK$FJFK?K?J@IAHBHCFDEECEBEADAD@C@B@AA@A@B?B@A@@B?C?D?E@FAFBFCFDEEDFCHBHAIAJ     % ( % (  % '%"% V@ 02 10 1221100'%"% ( % '%"% V@15 431144454% ( % '%"% V@24 323443322% ( % '%"% V@36 653366666% ( % '%"% V@36 444664434% ( % '%"% V@48 874578788% ( % '%"% V@58 666876656% ( % '%"% V@6: :9679:9::% ( % '%"% V@7: 878:98877% ( % '%"% V@8< <;89;<;<<% ( % '%"% V@9!< !: 9:< ;!:!:!9 9% ( % '%"% V@:"> !>"=!:; =!> = >!>% ( % '%"% V@!;$> $<#;!<!>$=$<$<$;#;% ( % '%"% V,#<%?%?$<#<#?% (  % (  NPICT_3o7MlHM EMFL X`0CorelEMF        ;@6&=% 6<@6?% ( ;.&=% 6@6<@.?5% ( ;9&=% 6.<@.8% ( ;V&=% 6#<@V"% ( ;.&=% 6V<@-U% (  % '%"% V@ 1&@ %?$>1 3#@%?%?&>$>'%"% ( % '%"% V@>%K JJ%?#>IJJKJ% ( % '%"% V@;J <>JH;<<=>% ( % '%"% V@0= 1 1< =311 0 1% (  % ( ;4&=% % 63 6:<@39 % ( ;% '% 6E6E66<>D% ( ;,4% '% 6E46E76,76,4<>,4D6% ( ;T% '% 6T6X6X6T<>TW% ( ;u% '% 62u62x6x6u<>u1w% ( ;!&%"% '% 6H%6H(6$6!<?!G'% ( % (       &=% '=% [*         % ( % (       &=% '=% VL%. %%&&--..--&&     % ( % (       &%"% '%"% VLBN NNDEFFEDDCBB     % ( % (       &%"% '%"% V??FK$FJFK?K?J@IAHBHCFDEECEBEADAD@C@B@AA@A@B?B@A@@B?C?D?E@FAFBFCFDEEDFCHBHAIAJ     % ( % (  % '%"% V@IL KKKIIKKLK'%"% ( % '%"% V@GK GHKJHGHGG% ( % '%"% V@GJ IIIGHIIJI% ( % '%"% V@EI EFIHFEFEE% ( % '%"% V@EH GGGEFGGHG% ( % '%"% V@CG CDGFDCDCC% ( % '%"% V@CF EFECDEEFF% ( % '%"% V@AE ABEDBABAA% ( % '%"% V@ AD CDCAB C CDD% ( % '%"% V@ ?C ? @ CC@ ?@? ?% ( % '%"% V@ ?B A BA ? @ A A B B% ( % '%"% V@ = A = ? A A > = > = =% ( % '%"% V@= @ ?@ ? =>??@@% ( % '%"% V,< ?=? ?<% (  % (  N PICT_4 =BXݍ`- tYBXݍ`- EMF c X@Adobe Systems     vI '% _4,,"% : Z,2 : Z,kF2 : Z,X n F: Z,i: Z,: Z,kF_4,,"% ( : [8-  _4,,"% ( : Z0Y d  )  '% ( _4,,% ( [8jo@A @A KK@ [8A A  [8y y y [8yd d oyoyd '% ( _4,,"% ( : [8xiJ tJ ~riRL"Arialt!j! 6h 6\44 6n| n| o ``%    $$??@\E@'TPLO# ??   $$??@ ETPL H# ??   $$?? E@&TPyLl1# ??   $$??@E!TPL+ G 2# ?? '% ( _4,,% ( [8   $$??pE^"TPL{Cd# ??( ( (  PICT_5 i=Ya t Ya EMF a X@Adobe Systems     v2 f'% _4,,"% : Z,/ ": Z,/ ": Z,  : Z, : Z,"": Z, _4,,"% ( : [8, > _4,,"% ( : Z0     '% ( _4,,% ( [8> >  [8> > (( [8> >  '% ( _4,,"% ( : [8TH `H i]TRL"Arialq4, 6lh, 66@ 6h 6\44 69o 9o o ``%    $$?? ExTPLO# ??   $$???E@fTPL 8 H# ??   $$??J ETPL G1# ??   $$??EETP LD ` G2# ??   $$??ETPLCd# ?? '% ( _4,,% ( [8 ( ( (  PICT_6 i=Ya t Ya EMF a X@Adobe Systems     v2 f'% _4,,"% : Z,/ ": Z,/ ": Z,  : Z, : Z,"": Z, _4,,"% ( : [8, > _4,,"% ( : Z0     '% ( _4,,% ( [8> >  [8> > (( [8> >  '% ( _4,,"% ( : [8TH `H i]TRL"Arialq4, 6lh, 66@ 6h 6\44 69o 9o o ``%    $$?? ExTPLO# ??   $$???E@fTPL 8 H# ??   $$??J ETPL G1# ??   $$??EETP LD ` G2# ??   $$??ETPLCd# ?? '% ( _4,,% ( [8 ( ( (  PICT_7 i=Ya t Ya EMF a X@Adobe Systems     v2 f'% _4,,"% : Z,/ ": Z,/ ": Z,  : Z, : Z,"": Z, _4,,"% ( : [8, > _4,,"% ( : Z0     '% ( _4,,% ( [8> >  [8> > (( [8> >  '% ( _4,,"% ( : [8TH `H i]TRL"Arialq4, 6lh, 66@ 6h 6\44 69o 9o o ``%    $$?? ExTPLO# ??   $$???E@fTPL 8 H# ??   $$??J ETPL G1# ??   $$??EETP LD ` G2# ??   $$??ETPLCd# ?? '% ( _4,,% ( [8 ( ( (  N PICT_8 =BXݍ`- tYBXݍ`- EMF c X@Adobe Systems     vI '% _4,,"% : Z,2 : Z,kF2 : Z,X n F: Z,i: Z,: Z,kF_4,,"% ( : [8-  _4,,"% ( : Z0Y d  )  '% ( _4,,% ( [8jo@A @A KK@ [8A A  [8y y y [8yd d oyoyd '% ( _4,,"% ( : [8xiJ tJ ~riRL"Arialt!jlRD6< 6< 4 69o 9o o ``%    $$??@\E@'TPLO# ??   $$??@ ETPL H# ??   $$?? E@&TPyLl1# ??   $$??@E!TPL+ G 2# ?? '% ( _4,,% ( [8   $$??pE^"TPL{Cd# ??( ( (  N PICT_9 =BXݍ`- tYBXݍ`- EMF c X@Adobe Systems     vI '% _4,,"% : Z,2 : Z,kF2 : Z,X n F: Z,i: Z,: Z,kF_4,,"% ( : [8-  _4,,"% ( : Z0Y d  )  '% ( _4,,% ( [8jo@A @A KK@ [8A A  [8y y y [8yd d oyoyd '% ( _4,,"% ( : [8xiJ tJ ~riRL"Arialt!jlRD6< 6< 4 69o 9o o ``%    $$??@\E@'TPLO# ??   $$??@ ETPL H# ??   $$?? E@&TPyLl1# ??   $$??@E!TPL+ G 2# ?? '% ( _4,,% ( [8   $$??pE^"TPL{Cd# ??( ( (  PICT_10 i=Ya t Ya EMF a X@Adobe Systems     v2 f'% _4,,"% : Z,/ ": Z,/ ": Z,  : Z, : Z,"": Z, _4,,"% ( : [8, > _4,,"% ( : Z0     '% ( _4,,% ( [8> >  [8> > (( [8> >  '% ( _4,,"% ( : [8TH `H i]TRL"Arialt!jR使6< l6< 4 69o 9o o ``%    $$?? ExTPLO# ??   $$???E@fTPL 8 H# ??   $$??J ETPL G1# ??   $$??EETP LD ` G2# ??   $$??ETPLCd# ?? '% ( _4,,% ( [8 ( ( (  ~JROGI'XX&& RtD`*winspool\\Serprintpc1\lj1_07chlj1_07ch\\Serprintpc1\lj1_07chS 4dXXA4PRIV0''''P4(]J  vBROGI'XX QtPL,WINSPOOLHP LaserJet 4050 Series PS\\PCMASTER\lj1_1902HP LaserJet 4050 Series PSw 3dXXA4GOy0$dPage personnalise 1XCCPage personnalise 2XCCPage personnalise 3XCC LROGI'XX RtF`+winspool\\SERPRINTPC1\lj2_19012lj2_19012\\SERPRINTPC1\lj1_19012S 4dXXA4PRIV0''''P4({ vBROGI'XX QtPL,WINSPOOLHP LaserJet 4050 Series PS\\PCMASTER\lj1_1902HP LaserJet 4050 Series PSw 3dXXA4GOy0$dPage personnalise 1XCCPage personnalise 2XCCPage personnalise 3XCC Layout0ROGI'XX RtF$winspool\\ati143\QMS9100\\Ati143\qms9100\\ati143\QMS91004C 4dXXA4DINU"4!!  Layout1ROGI'XX RtF$winspool\\ati143\QMS9100\\Ati143\qms9100\\ati143\QMS91004C 4dXXA4DINU"4!!  Layout2ROGI'XX RtF$winspool\\ati143\QMS9100\\Ati143\qms9100\\ati143\QMS91004C 4dXXA4DINU"4!!  Layout3ROGI'XX RtF$winspool\\ati143\QMS9100\\Ati143\qms9100\\ati143\QMS91004C 4dXXA4DINU"4!!  Layout4ROGI'XX RtF$winspool\\ati143\QMS9100\\Ati143\qms9100\\ati143\QMS91004C 4dXXA4DINU"4!!  Layout5ROGI'XXRtF$winspool\\ati143\QMS9100\\Ati143\qms9100\\ati143\QMS91004C 4dXXA4DINU"4!!  Layout6YROGI'XXRtS`%winspoolAcrobat Distillerd:\acrobat4\PDF Output\*.pdfAcrobat DistillerS 4dXXA4PRIV0''''P4( Layout7YROGI'XXRtS`%winspoolAcrobat Distillerd:\acrobat4\PDF Output\*.pdfAcrobat DistillerS 4dXXA4PRIV0''''P4( Layout8YROGI'XXRtS`%winspoolAcrobat Distillerd:\acrobat4\PDF Output\*.pdfAcrobat DistillerS 4dXXA4PRIV0''''P4( Layout9YROGI'XXRtS`%winspoolAcrobat Distillerd:\acrobat4\PDF Output\*.pdfAcrobat DistillerS 4dXXA4PRIV0''''P4( Layout10YROGI'XXRtS`%winspoolAcrobat Distillerd:\acrobat4\PDF Output\*.pdfAcrobat DistillerS 4dXXA4PRIV0''''P4( Layout11YROGI'XXRtS`%winspoolAcrobat Distillerd:\acrobat4\PDF Output\*.pdfAcrobat DistillerS 4dXXA4PRIV0''''P4( Layout12YROGI'XXRtS`%winspoolAcrobat Distillerd:\acrobat4\PDF Output\*.pdfAcrobat DistillerS 4dXXA4PRIV0''''P4( Layout13YROGI'XXRtS`%winspoolAcrobat Distillerd:\acrobat4\PDF Output\*.pdfAcrobat DistillerS 4dXXA4PRIV0''''P4( Layout14YROGI'XXRtS`%winspoolAcrobat Distillerd:\acrobat4\PDF Output\*.pdfAcrobat DistillerS 4dXXA4PRIV0''''P4( Layout15YROGI'XXRtS`%winspoolAcrobat Distillerd:\acrobat4\PDF Output\*.pdfAcrobat DistillerS 4dXXA4PRIV0''''P4( Layout16YROGI'XXRtS`%winspoolAcrobat Distillerd:\acrobat4\PDF Output\*.pdfAcrobat DistillerS 4dXXA4PRIV0''''P4( ROGI'XXp>><4!*8 WINSPOOLHP LaserJet 4MLPT1:HP LaserJet 4M@g XXLetter 8 1/2 x 11 in@MSUDNHP LaserJet 4M;d xD ROGI'XX Rth !>` winspool\\Ati143\HP5\\Ati143\HP5\\Ati143\HP5S 4dXXA4PRIV0''''P4(#{ ^Graph*@@wwwwww?wwwwww?WDashSettings#  !t Normal@ Arial<HHHH$$t Normal@ Arial<HHHH$$444444 4.Normal@ Arial<HHHH$$4 4 4 4 4 4 hhome4,d$E:lemmel:ifm:E:lemmel:ifmE:\lemmelifmR E:\lemmel\ifm\ifm_0610.pxpT0\ifm_0610.pxpT0wH wUU4xxUwKwXLwULwTehtdatapath@8d$E:lemmel:S18_135_2003jul:E:lemmel:S18_135_2003julE:\lemmelS18_135_2003jul E:\lemmel\ifm\ifm_0610.pxpT0\ifm_0610.pxpT0wH wUU4xxUwKwXLwULwTeh 4Misc_EndXOPState_StartData Browserވ+@ 4.iANOVASupport5_2003jul:Surface Plotter`0%0%XLLoadWave(%Data Browser4XOPState_End '-Ej0BIn=s@Jdmax @dmaxsplit@dmaxfit@imax@imaxsplit@kmax@kmaxfit@V_FlagV_numNaNsV_numINFsV_npntsV_ntermsV_nheldV_chisqV_qV_RabV_PrV_sigaV_sigbV_avgV_sdevV_rmsV_minlocV_minV_maxlocV_maxV_adevV_skewV_kurtV_minChunkLocV_maxChunkLocV_minLayerLocV_maxLayerLocV_maxRowLocV_minRowLocV_maxColLocV_minColLocFileAppMode@AppMode@ExpListH'rootS_pathH'E:lemmel:S18_Mai2004:S_fileNameH'ioSer_3mm_9_in.datS_waveNamesH' headertext0;S_worksheetName Data Sheet 1_PopupMenu popupNormTo value="none;/(O+H) old;/Mon;1/(O+H);/(O+H)" Control() &a'˛t˛tParamNames&????B#'ParamXvalueYvalueZvalueTemperatur !Y'˛t˛tParamColumns&????C#H'data3data4data5data6data8 _ '˛t˛tDetectorNames&????D#'OH3rd4thdSignaldCoeffmeanDetMonpY x'˛t˛tDetectorColumns&????E;h'data1data2data3data7data6 DetectorColorR?˛t˛tRGGGGr^DetectorColorG?˛t˛tLGGFFaDetectorColorB?˛t˛tGGGFRoa'˛t˛tInoutNames&????I''Out_In1_In2_In1Out_In2Out_In1In2_ !O~ex'˛t˛tCoeffNames&????J#'CoeffACoeffBCoeffCCoeffDContrFWHMChi2 !%(v'˛t˛tCoeffAxis0&????K#'offsetamplitudeperiod []phase []contrastparallelchi"*26_tH'˛tGCoeffAxis1&????L%X'offsetamplitudepeak centerpeak widthcontrastFWHMchi$,04 ('˛tFCoeffAxis0inout&????M-'offset differenceamplitude differenceperiod difference []phase shift []contrast differenceFWHM differencechi difference%:I\kz4CoeffMarkerOut?˛t˛tQCoeffMarkerIn1?˛t˛t&CoeffMarkerIn2?˛t˛t+ (CoeffInoutDiff0?8Ѽ%@Ѽ?QCoeffInoutDiff1?8Ѽ8Ѽ? ctrl@7`O 2-Ej0BIn=s@JDetectorOwnListCoeffOwnListInoutOwnListListErrListFilename?DetectorOwnPlotCoeffOwnPlotInoutOwnPlotPlotMeanPlotInfo?vsTimeParaSerInoutTypeUnique?ParallelSৎm?PhD?FitTypeShowFittingNormTo?AppendRightMeanOutForInMeanInoutMeanDetectorKeepFitPlotdSignal1?dSignal2dCoeff1?dCoeff2ParallelDeg43333=@InFirstLoadNr?DispNr?DelNr?InvertPhDPlotVsPlotAvrgmeanDet1?meanDet2ErrBars?BraggDeg>@Thick@ListParamPlotVs2@PlotContourPlotContourLabelPlotImagePlotImageLabelMeanNr1MeanNr2dSignalOp?ExpNow Sh'Exp0Info_NameSh'pathNameSh'E:lemmel:S18_135_2003jul:tDetectorDoDisp?˛t˛tDetectorDoFit?˛t˛tList'InoutDoDisp?˛tt7CoeffDoDisp?˛t˛tCParamDoList?˛t˛t 5// Platform=WindowsNT, IGORVersion=4.040 NewPath/Z datapath "::S18_135_2003jul:" DefaultFont "Arial" MoveWindow/P 8.25,52.25,513,557.75 MoveWindow/C 273,461.75,779.25,628.25 Control() Window Control() : Panel PauseUpdate; Silent 1 // building window... NewPanel /W=(678,65,1104,530) as "Control" ShowTools SetDrawLayer UserBack DrawText 329,278,"Detectors" DrawText 255,278,"Coefficients" DrawText 189,278,"Files" SetDrawEnv fname= "MS Sans Serif" DrawText 216,143,"use special period for sine fit" SetDrawEnv fname= "MS Sans Serif",fsize= 8 DrawText 215,91,"phase shifter:" SetDrawEnv fname= "MS Sans Serif",fsize= 8,textxjust= 2 DrawText 52,283,"dCoef=" SetDrawEnv fname= "MS Sans Serif",fsize= 8,textxjust= 2 DrawText 53,304,"meanDet=" SetDrawEnv fname= "MS Sans Serif",fsize= 8 DrawText 115,284,"--" SetDrawEnv fname= "MS Sans Serif",fsize= 8 DrawText 105,303,"avrg" Button button12,pos={86,35},size={40,20},proc=ButtonProc_Folder,title="Path:" Button button7,pos={10,55},size={76,20},proc=ButtonProc_ListFiles,title="List Files" Button button0,pos={10,35},size={76,20},proc=ButtonProcLoadNewInfo,title="Load Info" Button button_LoadFitAll,pos={10,210},size={94,20},proc=ButtonProc_LoadData,title="Load && Fit All Files" Button button6,pos={10,442},size={103,17},proc=ButtonProc_DisplayVsVsVs2,title="Plot \"vs\" vs \"vs2\"" Button button8,pos={168,190},size={68,20},proc=ButtonProc_Displayone,title="Plot File No:" Button button9,pos={10,316},size={54,20},proc=ButtonProc_ListCoeff,title="List" Button button_ClearAllFiles,pos={295,210},size={93,20},proc=ButtonProc_ClearFile,title="Clear All Files" SetVariable setvarPath,pos={127,36},size={225,16},proc=SetVarPath,title=" " SetVariable setvarPath,fSize=9,value= root:ctrl:Path Button Reset,pos={295,230},size={93,20},proc=ButtonProc_Reset,title="Clear Experiment" CheckBox checkPhD,pos={226,91},size={54,14},proc=CheckProc,title="convert" CheckBox checkPhD,value= 1 CheckBox checkFit3rd,pos={9,128},size={62,14},proc=CheckProc_Fit3,title="fit 3rd det" CheckBox checkFit3rd,value= 0 CheckBox checkFitO,pos={9,102},size={55,14},proc=CheckProc_FitO,title="fit O-det" CheckBox checkFitO,value= 0 CheckBox checkFitH,pos={9,115},size={55,14},proc=CheckProc_FitH,title="fit H-det" CheckBox checkFitH,value= 0 CheckBox checkFit4th,pos={9,141},size={62,14},proc=CheckProc_Fit4,title="fit 4th det" CheckBox checkFit4th,value= 0 Button button11,pos={10,337},size={40,20},proc=ButtonProc_PlotCoeff,title="Plot" CheckBox checkA,pos={257,280},size={25,14},proc=CheckProc_CoeffA,title="A" CheckBox checkA,value= 0 CheckBox checkB,pos={287,280},size={25,14},proc=CheckProc_CoeffB,title="B" CheckBox checkB,value= 0 CheckBox checkC,pos={257,293},size={25,14},proc=CheckProc_CoeffC,title="C" CheckBox checkC,value= 0 CheckBox checkD,pos={287,293},size={26,14},proc=CheckProc_CoeffD,title="D" CheckBox checkD,value= 1 SetVariable setvarLoadNr,pos={110,192},size={44,16},title=" " SetVariable setvarLoadNr,value= root:ctrl:LoadNr SetVariable setvarDelNr,pos={348,191},size={40,16},title=" " SetVariable setvarDelNr,value= root:ctrl:DelNr SetVariable setvarDispNr,pos={236,192},size={44,16},title=" " SetVariable setvarDispNr,value= root:ctrl:DispNr CheckBox checkUnique,pos={167,231},size={117,14},proc=Checkunique,title="use existing windows" CheckBox checkUnique,value= 1 CheckBox checkListErr,pos={96,391},size={30,14},proc=CheckProc_ListErr,title="err" CheckBox checkListErr,value= 0 CheckBox checkContr,pos={257,306},size={57,14},proc=CheckProc_Contrast,title="Contrast" CheckBox checkContr,value= 0 CheckBox checkFWHM,pos={257,319},size={52,14},proc=CheckProc_FWHM,title="FWHM" CheckBox checkFWHM,value= 0 PopupMenu popupFitType,pos={1,79},size={147,21},proc=PopMenuProc_FitType,title="fit type" PopupMenu popupFitType,mode=1,popvalue="A+Bsin(Cx+D)",value= #"\"A+Bsin(Cx+D);A+Bexp(-(x-C)/D);A+Bsin(Cx(phi,parall)+D)\"" CheckBox checkO,pos={328,280},size={26,14},proc=CheckProc_Disp_O,title="O" CheckBox checkO,value= 1 CheckBox checkH,pos={328,293},size={26,14},proc=CheckProc_Disp_H,title="H" CheckBox checkH,value= 1 CheckBox check3rd,pos={328,306},size={33,14},proc=CheckProc_Disp_3,title="3rd" CheckBox check3rd,value= 0 CheckBox check4th,pos={328,319},size={33,14},proc=CheckProc_Disp_4,title="4th" CheckBox check4th,value= 0 PopupMenu popupSequence,pos={180,52},size={176,21},proc=PopMenuProc_Sequence,title="file sequence" PopupMenu popupSequence,mode=1,popvalue="parallel out,in",value= #"\"parallel out,in;parallel out,in1,in2;serial out,in;serial out,in1,in2;serial in,out;.;serial out,in...out\"" CheckBox checkAll,pos={189,280},size={28,14},proc=CheckProc_InoutAll,title="all" CheckBox checkAll,value= 1 CheckBox checkOut,pos={189,293},size={33,14},proc=CheckProc_InoutOut,title="out" CheckBox checkOut,value= 0 CheckBox checkIn1,pos={189,306},size={26,14},proc=CheckProc_InoutIn1,title="in" CheckBox checkIn1,value= 0 CheckBox checkIn2,pos={189,319},size={32,14},proc=CheckProc_InoutIn2,title="in2" CheckBox checkIn2,value= 0 CheckBox checkInoutOwnList,pos={189,378},size={53,14},proc=CheckProc_InoutOwnList,title="own list" CheckBox checkInoutOwnList,value= 0 CheckBox checkCoeffOwnList,pos={257,378},size={53,14},proc=CheckProc_CoeffOwnList,title="own list" CheckBox checkCoeffOwnList,value= 0 CheckBox checkDetOwnList,pos={328,378},size={53,14},proc=CheckProc_DetOwnList,title="own list" CheckBox checkDetOwnList,value= 0 CheckBox checkInoutOwnPlot,pos={189,391},size={58,14},proc=CheckProc_InoutOwnPlot,title="own plot" CheckBox checkInoutOwnPlot,value= 0 CheckBox checkDetOwnPlot,pos={328,391},size={58,14},proc=CheckProc_DetOwnPlot,title="own plot" CheckBox checkDetOwnPlot,value= 0 CheckBox checkPlotMean,pos={9,404},size={69,14},proc=CheckProc_PlotMean,title="incl. mean:" CheckBox checkPlotMean,value= 0 CheckBox checkAvrg,pos={9,391},size={81,14},proc=CheckProc_PlotAvrg,title="average \"vs\"" CheckBox checkAvrg,value= 0 CheckBox checkIn1out,pos={189,332},size={44,14},proc=CheckProc_In1Out,title="in-out" CheckBox checkIn1out,value= 0 CheckBox checkIn2out,pos={189,345},size={50,14},proc=CheckProc_In2out,title="in2-out" CheckBox checkIn2out,value= 0 PopupMenu popupCoeff1,pos={59,267},size={45,21},proc=PopMenuProc_dCoeff1 PopupMenu popupCoeff1,mode=2,popvalue="H",value= #"\"O;H;3rd;4th;dSig\"" PopupMenu popupCoeff2,pos={128,267},size={45,21},proc=PopMenuProc_dCoeff2 PopupMenu popupCoeff2,mode=1,popvalue="O",value= #"\"O;H;3rd;4th;dSig\"" CheckBox checkdSignal,pos={328,332},size={53,14},proc=CheckProc_dSignal,title="dSignal" CheckBox checkdSignal,value= 0 CheckBox checkCoeffOwnPlot,pos={257,391},size={58,14},proc=CheckProc_CoeffOwnPlot,title="own plot" CheckBox checkCoeffOwnPlot,value= 0 CheckBox checkListFilename,pos={96,378},size={82,14},proc=CheckProc_ListFilename,title="incl. file name" CheckBox checkListFilename,value= 1 CheckBox checkPlotInfo,pos={9,378},size={57,14},proc=CheckProc_PlotInfo,title="incl. info" CheckBox checkPlotInfo,value= 1 CheckBox checkShowFitting,pos={9,231},size={71,14},proc=CheckProc_ShowFitting,title="show fitting" CheckBox checkShowFitting,value= 0 PopupMenu popupNormTo,pos={67,105},size={141,21},proc=PopMenuProc,title="norm" PopupMenu popupNormTo,mode=2,popvalue="/(O+H)",value= #"\"none;/(O+H) old;/Mon;1/(O+H);/(O+H)\"" CheckBox checkChi2,pos={257,332},size={35,14},proc=CheckProc_Chi2,title="chi" CheckBox checkChi2,value= 0 Button buttonAppendRight,pos={10,358},size={40,20},proc=ButtonProc_AppendRight,title="Add" SetVariable setvarParallelDeg,pos={294,78},size={90,16},title="parallel=" SetVariable setvarParallelDeg,format="%g" SetVariable setvarParallelDeg,limits={-Inf,Inf,0.1},value= root:ctrl:ParallelDeg CheckBox checkMeanOutForIn,pos={226,143},size={82,14},proc=CheckProc_MeanOutForIn,title="use Out for In" CheckBox checkMeanOutForIn,value= 0 CheckBox checkMeanInout,pos={226,156},size={124,14},proc=CheckProc_MeanInout,title="use in/out mean value" CheckBox checkMeanInout,value= 0 CheckBox checkMeanDetector,pos={226,169},size={135,14},proc=CheckProc_MeanDetector,title="use detector mean value" CheckBox checkMeanDetector,value= 0 Button buttonReFit,pos={104,210},size={51,20},proc=ButtonReFit,title="Re-Fit All" CheckBox checkKeepFitPlot,pos={9,244},size={86,14},proc=CheckProc_KeepFitPlot,title="keep windows" CheckBox checkKeepFitPlot,value= 0 CheckBox checkFitdDet,pos={9,154},size={76,14},proc=CheckProc_FitdDet,title="fit dSignal = " CheckBox checkFitdDet,value= 0 PopupMenu popupSignal1,pos={87,147},size={45,21},proc=PopMenuProc_dSignal1 PopupMenu popupSignal1,mode=2,popvalue="H",value= #"\"O;H;3rd;4th\"" PopupMenu popupSignal2,pos={87,167},size={45,21},proc=PopMenuProc_dSignal2 PopupMenu popupSignal2,mode=1,popvalue="O",value= #"\"O;H;3rd;4th\"" CheckBox checkdCoeff,pos={328,345},size={49,14},proc=CheckProc_dCoeff,title="dCoeff" CheckBox checkdCoeff,value= 0 PopupMenu popupExperiment,pos={2,6},size={124,21},proc=PopMenuProc_Experiment,title="Experiment:" PopupMenu popupExperiment,mode=1,popvalue="root",value= #"root:ExpList" Button buttonDuplExp,pos={309,6},size={40,20},proc=ButtonProc_DuplExp Button buttonKillExp,pos={349,6},size={40,20},proc=ButtonProc_KillExp,title="Kill" Button buttonReloadInfo,pos={86,55},size={76,20},proc=ButtonProcReloadInfo,title="Re-Load Info" CheckBox checkInvertPhd,pos={226,104},size={44,14},proc=CheckProc_InvertPhd,title="invert" CheckBox checkInvertPhd,value= 0 PopupMenu popupPlotVs,pos={46,336},size={88,21},proc=PopMenuProc_Vs,title="vs" PopupMenu popupPlotVs,mode=1,popvalue="Order",value= #"\"Order;Time;Param;Xvalue;Yvalue;Zvalue\"" Button buttonPlotFileApp,pos={168,210},size={40,20},proc=ButtonProcAppFile,title="Add" Button button_SaveCoeff,pos={64,316},size={54,20},proc=ButtonProc_SaveCoeff,title="Save" Button button_LoadCoeff,pos={118,316},size={54,20},proc=ButtonProc_LoadCoeff,title="Load" CheckBox checkMeanDet,pos={328,358},size={62,14},proc=CheckProc_meanDet,title="MeanDet" CheckBox checkMeanDet,value= 0 PopupMenu popupMeanDet1,pos={59,288},size={45,21},proc=PopMenuProc_meanDet1 PopupMenu popupMeanDet1,mode=2,popvalue="H",value= #"\"O;H;3rd;4th;dSig;dCo\"" PopupMenu popupMeanDet2,pos={128,288},size={45,21},proc=PopMenuProc_meanDet2 PopupMenu popupMeanDet2,mode=1,popvalue="O",value= #"\"O;H;3rd;4th;dSig;dCo\"" Button button_LoadFitOne,pos={34,190},size={76,20},proc=ButtonProc_LoadData,title="Load && Fit File:" Button button_ClearOneFile,pos={295,190},size={52,20},proc=ButtonProc_ClearFile,title="Clear File:" CheckBox checkErrBars,pos={167,244},size={90,14},proc=CheckProc_ErrBars,title="show error bars" CheckBox checkErrBars,value= 1 SetVariable setvarBragg,pos={294,94},size={90,16},title="Bragg=",format="%g" SetVariable setvarBragg,value= root:ctrl:BraggDeg SetVariable setvarThick,pos={294,110},size={90,16},title="thick=",format="%gmm" SetVariable setvarThick,value= root:ctrl:Thick Button buttonReloadFile,pos={10,190},size={24,20},proc=ButtonProcReloadFile,title="Re-" CheckBox checkListParam,pos={131,391},size={48,14},proc=CheckProc_ListParam,title="Param" CheckBox checkListParam,value= 0 CheckBox checkListX,pos={96,404},size={25,14},proc=CheckProc_ListX,title="X" CheckBox checkListX,value= 0 CheckBox checkListY,pos={125,404},size={25,14},proc=CheckProc_ListY,title="Y" CheckBox checkListY,value= 0 CheckBox checkListZ,pos={154,404},size={25,14},proc=CheckProc_ListZ,title="Z" CheckBox checkListZ,value= 0 PopupMenu popupPlotVs2,pos={129,436},size={101,21},proc=PopMenuProc_Vs2,title="vs2" PopupMenu popupPlotVs2,mode=5,popvalue="Yvalue",value= #"\"Order;Time;Param;Xvalue;Yvalue;Zvalue;Signal Axis;Fit Axis\"" Button buttonSurfacePlot,pos={247,434},size={44,25},proc=ButtonProc_ContourPlot,title="2D-Plot" CheckBox checkPlotCont,pos={291,433},size={55,14},proc=CheckProc_PlotCont,title="Contour" CheckBox checkPlotCont,value= 0 CheckBox checkPlotImg,pos={291,446},size={47,14},proc=CheckProc_PlotImg,title="Image" CheckBox checkPlotImg,value= 0 CheckBox checkPlotContLabel,pos={349,433},size={44,14},proc=CheckProc_PlotContLabel,title="Label" CheckBox checkPlotContLabel,value= 0 CheckBox checkPlotImgLabel,pos={349,446},size={44,14},proc=CheckProc_PlotImgLabel,title="Label" CheckBox checkPlotImgLabel,value= 0 Button buttonPathForAll,pos={352,36},size={37,15},proc=ButtonProcPathForAll,title="for all" SetVariable setvarMeanNr1,pos={10,418},size={42,16},proc=SetVarProcMeanNr,title=" " SetVariable setvarMeanNr1,value= root:ctrl:MeanNr1 SetVariable setvarMeanNr2,pos={52,418},size={42,16},proc=SetVarProcMeanNr,title=" " SetVariable setvarMeanNr2,value= root:ctrl:MeanNr2 PopupMenu popupSignalOp,pos={44,167},size={43,21},proc=PopMenuProc_dSignalOp PopupMenu popupSignalOp,mode=2,popvalue="+",value= #"\";+\"" CheckBox checkIn1In2,pos={189,358},size={43,14},proc=CheckProc_In1In2,title="in-in2" CheckBox checkIn1In2,value= 0 PopupMenu popupAppMode,pos={50,357},size={84,21},proc=PopMenuProc_AppMode PopupMenu popupAppMode,mode=3,popvalue="2nd y axis",value= #"\"same axes;y on right;2nd y axis;2nd y, new x;3rd y axis;3rd y, new x\"" PopupMenu popupAppFileMode,pos={208,209},size={81,21},proc=PopMenuProc_FileAppMode PopupMenu popupAppFileMode,mode=5,popvalue="3rd y axis",value= #"\"same axes;y on right;2nd y axis;2nd y, new x;3rd y axis;3rd y, new x\"" Button button_temp,pos={168,174},size={30,16},proc=ButtonProc,title="temp" Button button_temp2,pos={142,356},size={30,16},proc=ButtonProc_1,title="temp" EndMacro O#pragma rtGlobals=1 // Use modern global access method. //********************************************************************************************************** //********************************************************************************************************** //****************************** MULTI SCAN EVALUATION ****************************** //********************************************************************************************************** //********************************************************************************************************** //pathinfo home print s_path Macro Make_Control_Waves() String oldfolder=GetDataFolder(1) SetDataFolder "root:" // Variable/G N, bc, Dicke, Lambda, Bragg, d // Fr opt. Weg Berechnung // //*******************************// // Parallel=-3.8/180*Pi // N=4.99396778*10^22 // Si [1/cm] // N=6.02646*10^22 // Al [1/cm] // bc=4.150*10^(-13) // [cm] // Dicke=0.5 // [cm] // d=5.4301*10^(-8) // [cm] // Lambda=1.909*10^-8 // [cm] // Lambda=2.65*10^-8 // [cm] // Bragg=asin(Lambda*sqrt(8)/2/d) //*********************************// // allgemeine Konstanten: in den root-Datafolder Variable /G dmax=8 Variable /G dmaxsplit=6 // Bereich fr InoutSplit Variable /G dmaxfit=5 // Detektoren, die normiert und gefittet werden Make /O/T/N=5 ParamNames={"Param","Xvalue","Yvalue","Zvalue","Temperatur"} Make /O/T/N=5 ParamColumns={"data3","data4","data5","data6","data8"} Make /O/T/N=8 DetectorNames={"O","H","3rd","4th","dSignal","dCoeff","meanDet","Mon"} Make /O/T/N=8 DetectorColumns={"data1","data2","data3","data7","","","","data6"} Make /O/N=8 DetectorColorR={0,0,0,53760,65280,65280,65280,0} Make /O/N=8 DetectorColorG={0,52224,65280,8192,32512,0,0,0} Make /O/N=8 DetectorColorB={65280,0,65280,65280,16384,0,0,0} Variable /G imax=7 Variable /G imaxsplit=4 // Bereich fr InoutSplit Make /O/T/N=7 InoutNames={"","Out_","In1_","In2_","In1Out_","In2Out_","In1In2_"} Variable /G kmax=7 Variable /G kmaxfit=4 // Coeff-Bereich, von dem Delta berechnet wird Make /O/T/N=7 CoeffNames={"CoeffA","CoeffB","CoeffC","CoeffD","Contr","FWHM","Chi2"} // Axenbeschriftung fr FitType 0 : Make /O/T/N=7 CoeffAxis0 ={"offset","amplitude","period []","phase []","contrast","parallel","chi"} // Axenbeschriftung fr FitType 1 Make /O/T/N=7 CoeffAxis1={"offset","amplitude","peak center","peak width","contrast","FWHM","chi"} // Axenbeschriftung fr Differenz in/out fr FitType 0 Make /O/T/N=7 CoeffAxis0inout={"offset difference","amplitude difference","period difference []","phase shift []","contrast difference","FWHM difference","chi difference"} Make /O/B/N=8 CoeffMarkerOut={25, 3, 4, 8, 5, 5,28, 7} Make /O/B/N=8 CoeffMarkerIn1 ={26,14,15,19,16,16,29,18} Make /O/B/N=8 CoeffMarkerIn2 ={26,14,15,43,12,12,29,40} String /G ExpList // Kontrollvariablen zur Datenauswertung: in den Datafolder ctrl NewDataFolder /O/S ctrl Make /O/B/N=8 DetectorDoDisp, DetectorDoFit Make /O/B/N=7 InoutDoDisp Make /O/B/N=7 CoeffDoDisp Make /O/B/N=5 ParamDoList Variable /G DetectorOwnList, CoeffOwnList, InoutOwnList, ListErr, ListFilename Variable /G DetectorOwnPlot, CoeffOwnPlot, InoutOwnPlot, PlotMean, PlotInfo, PlotVs, PlotVs2, PlotAvrg //, vsTime,vsParam Variable /G ParaSer, InFirst, InoutType, Unique, PhD, InvertPhD, FitType Variable /G ShowFitting, NormTo, AppendRight, MeanOutForIn, MeanInout, MeanDetector, KeepFitPlot, ErrBars Variable /G dSignalOp, dSignal1,dSignal2, dCoeff1, dCoeff2, meanDet1, meanDet2 Variable /G PlotContour,PlotContourLabel,PlotImage,PlotImageLabel Variable /G Thick=5 Variable /G BraggDeg=30 Variable /G ParallelDeg=29.7 Variable /G Parallel=ParallelDeg/180*Pi Variable /G LoadNr=1, DispNr=1, DelNr=1 String /G ExpNo, Info_Name, path SetDataFolder "root:" SetDataFolder oldfolder SetControlValues() End Function SetControlValues() DoWindow /C Control NVAR InvertPhD=:ctrl:InvertPhD; CheckBox checkInvertPhD value=InvertPhD NVAR PhD=:ctrl:PhD; CheckBox checkPhD value=PhD NVAR Unique=:ctrl:Unique; CheckBox checkUnique value=Unique WAVE DetectorDoFit=:ctrl:DetectorDoFit; CheckBox checkFitO value=DetectorDoFit[0] CheckBox checkFitH value=DetectorDoFit[1] CheckBox checkFit3rd value=DetectorDoFit[2] CheckBox checkFit4th value=DetectorDoFit[3] CheckBox checkFitdDet value=DetectorDoFit[4] WAVE InoutDoDisp=:ctrl:InoutDoDisp; CheckBox checkAll value=InoutDoDisp[0] CheckBox checkOut value=InoutDoDisp[1] CheckBox checkIn1 value=InoutDoDisp[2] CheckBox checkIn2 value=InoutDoDisp[3] CheckBox checkIn1out value=InoutDoDisp[4] CheckBox checkIn2out value=InoutDoDisp[5] CheckBox checkIn1In2 value=InoutDoDisp[6] WAVE CoeffDoDisp=:ctrl:CoeffDoDisp; CheckBox checkA value=CoeffDoDisp[0] CheckBox checkB value=CoeffDoDisp[1] CheckBox checkC value=CoeffDoDisp[2] CheckBox checkD value=CoeffDoDisp[3] CheckBox checkContr value=CoeffDoDisp[4] CheckBox checkFWHM value=CoeffDoDisp[5] WAVE DetectorDoDisp=:ctrl:DetectorDoDisp; CheckBox checkO value=DetectorDoDisp[0] CheckBox checkH value=DetectorDoDisp[1] CheckBox check3rd value=DetectorDoDisp[2] CheckBox check4th value=DetectorDoDisp[3] CheckBox checkdSignal value=DetectorDoDisp[4] CheckBox checkdCoeff value=DetectorDoDisp[5] CheckBox checkMeanDet value=DetectorDoDisp[6] NVAR InoutOwnPlot=:ctrl:InoutOwnPlot; CheckBox checkInoutOwnPlot value=InoutOwnPlot NVAR CoeffOwnPlot=:ctrl:CoeffOwnPlot; CheckBox checkCoeffOwnPlot value=CoeffOwnPlot NVAR DetectorOwnPlot=:ctrl:DetectorOwnPlot; CheckBox checkDetOwnPlot value=DetectorOwnPlot NVAR InoutOwnList=:ctrl:InoutOwnList; CheckBox checkInoutOwnList value=InoutOwnList NVAR CoeffOwnList=:ctrl:CoeffOwnList; CheckBox checkCoeffOwnList value=CoeffOwnList NVAR DetectorOwnList=:ctrl:DetectorOwnList; CheckBox checkDetOwnList value=DetectorOwnList NVAR PlotMean=:ctrl:PlotMean; CheckBox checkPlotMean value=PlotMean NVAR PlotAvrg=:ctrl:PlotAvrg; CheckBox checkAvrg value=PlotAvrg NVAR PlotInfo=:ctrl:PlotInfo; CheckBox checkPlotInfo value=PlotInfo NVAR ListFilename=:ctrl:ListFilename; CheckBox checkListFilename value=ListFilename NVAR ListErr=:ctrl:ListErr; CheckBox checkListErr value=ListErr Wave ParamDoList=:ctrl:ParamDoList ; CheckBox checkListParam value=ParamDoList[0] CheckBox checkListX value=ParamDoList[1] CheckBox checkListY value=ParamDoList[2] CheckBox checkListZ value=ParamDoList[3] NVAR PlotVs=:ctrl:PlotVs; PopupMenu popupPlotVs mode=1+PlotVs NVAR PlotVs2=:ctrl:PlotVs2; PopupMenu popupPlotVs2 mode=1+PlotVs2 NVAR ShowFitting=:ctrl:ShowFitting; CheckBox checkShowFitting value=ShowFitting NVAR KeepFitPlot=:ctrl:KeepFitPlot; CheckBox checkKeepFitPlot value=KeepFitPlot NVAR ErrBars=:ctrl:ErrBars; CheckBox checkErrBars value=ErrBars NVAR LoadNr=:ctrl:LoadNr; SetVariable setvarLoadNr, value=:ctrl:LoadNr NVAR DispNr=:ctrl:DispNr; SetVariable setvarDispNr, value=:ctrl:DispNr NVAR DelNr=:ctrl:DelNr; SetVariable setvarDelNr, value=:ctrl:DelNr NVAR ParallelDeg=:ctrl:ParallelDeg; SetVariable setvarParallelDeg, value=:ctrl:ParallelDeg NVAR BraggDeg=:ctrl:BraggDeg; SetVariable setvarBragg, value=:ctrl:BraggDeg NVAR Thick=:ctrl:Thick; SetVariable setvarThick, value=:ctrl:Thick SVAR Path=:ctrl:Path; SetVariable setvarPath, value=:ctrl:Path NVAR MeanOutForIn=:ctrl:MeanOutForIn; CheckBox checkMeanOutForIn value=MeanOutForIn NVAR MeanInout=:ctrl:MeanInout; CheckBox checkMeanInout value=MeanInout NVAR MeanDetector=:ctrl:MeanDetector; CheckBox checkMeanDetector value=MeanDetector NVAR NormTo=:ctrl:NormTo; PopupMenu popupNormTo mode=1+NormTo NVAR FitType=:ctrl:FitType; PopupMenu popupFitType mode=1+FitType NVAR dCoeff1=:ctrl:dCoeff1; PopupMenu popupCoeff1 mode=1+dCoeff1 NVAR dCoeff2=:ctrl:dCoeff2; PopupMenu popupCoeff2 mode=1+dCoeff2 NVAR meanDet1=:ctrl:meanDet1; PopupMenu popupMeanDet1 mode=1+meanDet1 NVAR meanDet2=:ctrl:meanDet2; PopupMenu popupMeanDet2 mode=1+meanDet2 NVAR dSignal1=:ctrl:dSignal1; PopupMenu popupSignal1 mode=1+dSignal1 NVAR dSignal2=:ctrl:dSignal2; PopupMenu popupSignal2 mode=1+dSignal2 NVAR dSignalOp=:ctrl:dSignalOp; PopupMenu popupSignalOp mode=1+dSignalOp NVAR MeanNr1=:ctrl:MeanNr1; SetVariable setvarMeanNr1, value=:ctrl:MeanNr1 NVAR MeanNr2=:ctrl:MeanNr2; SetVariable setvarMeanNr2, value=:ctrl:MeanNr2 NVAR InoutType=:ctrl:InoutType; NVAR InFirst=:ctrl:InFirst; NVAR ParaSer=:ctrl:ParaSer; PopupMenu popupSequence mode=1+2*ParaSer+InoutType+2*InFirst NVAR PlotContour=:ctrl:PlotContour; CheckBox checkPlotCont value=PlotContour NVAR PlotContourLabel=:ctrl:PlotContourLabel; CheckBox checkPlotContLabel value=PlotContourLabel NVAR PlotImage=:ctrl:PlotImage; CheckBox checkPlotImg value=PlotImage NVAR PlotImageLabel=:ctrl:PlotImageLabel; CheckBox checkPlotImgLabel value=PlotImageLabel NVAR FileAppMode=root:FileAppMode; PopupMenu popupAppFileMode mode=FileAppMode NVAR AppMode=root:AppMode; PopupMenu popupAppMode mode=AppMode SVAR path=:ctrl:path Newpath /O datapath, path End Macro Copy_Values_to_Checkboxes() SetControlValues() End Macro Show_Control_Waves() Edit /K=1/W=(0,30,400,200) root:DetectorNames, root:DetectorColumns, :ctrl:DetectorDoDisp, :ctrl:DetectorDoFit, root:DetectorColorR, root:DetectorColorG, root:DetectorColorB DoWindow /K ctrl_detector // altes Fenster lschen DoWindow /C/T ctrl_detector,"Detectors" // neues Fenster umbenennen und Titel setzen ModifyTable width(Point)=25, alignment(Point)=1 Edit /K=1/W=(0,210,210,340) root:InoutNames, :ctrl:InoutDoDisp DoWindow /K ctrl_inout // altes Fenster lschen DoWindow /C/T ctrl_inout,"In/Out" // neues Fenster umbenennen und Titel setzen ModifyTable width=60 ModifyTable width(Point)=25, alignment(Point)=1 Edit /K=1/W=(220,210,450,340) root:ParamNames, root:ParamColumns, :ctrl:ParamDoList DoWindow /K ctrl_param // altes Fenster lschen DoWindow /C/T ctrl_param,"File Params" // neues Fenster umbenennen und Titel setzen ModifyTable width=60 ModifyTable width(Point)=25, alignment(Point)=1 Edit /K=1/W=(0,360,340,510) root:CoeffNames, root:CoeffInoutDiff0, root:CoeffInoutDiff1, :ctrl:CoeffDoDisp, root:CoeffAxis0, root:CoeffAxis1, root:CoeffAxis0inout, root:CoeffMarkerOut,root:CoeffMarkerIn1,root:CoeffMarkerIn2 DoWindow /K ctrl_coeff // altes Fenster lschen DoWindow /C/T ctrl_coeff,"Coefficients" // neues Fenster umbenennen und Titel setzen ModifyTable width=60 ModifyTable width(Point)=25, alignment(Point)=1 EndMacro Function ButtonProcListCtrl(ctrlName) : ButtonControl String ctrlName Execute("Show_Control_Waves()") End //********************************************************************************************************** //********************************************************************************************************** //********************************************************************************************************** //********************************************************************************************************** Function ButtonProc_Folder(ctrlName) : ButtonControl String ctrlName SVAR path=:ctrl:path newpath /O datapath pathinfo datapath path=s_path End Function ButtonProcPathForAll(ctrlName) : ButtonControl String ctrlName SVAR path=:ctrl:path String p=path String name Variable ex for(ex=1; ex<100; ex+=1) name="root:Experiment"+num2str(ex)+":ctrl:path" if(exists(name)==2) SVAR path=$name path=p; endif endfor SVAR path=root:path path=p; End Function SetVarPath(ctrlName,varNum,varStr,varName) : SetVariableControl String ctrlName Variable varNum String varStr String varName SVAR path=:ctrl:path Newpath /O datapath, path End //********************************************************************************************************** //********************************************************************************************************** Function SetTableFormatFileName(fname) String fname Execute("ModifyTable font("+fname+")=\"Arial Narrow\"") Execute("ModifyTable width("+fname+")=140") Execute("ModifyTable alignment("+fname+")=0") End Function SetTableFormatPoint() Execute("ModifyTable width(Point)=25, alignment(Point)=1") End //********************************************************************************************************** //********************************************************************************************************** // leer voll mit . mit + mit x // Kreis 8 19 41 42 43 // Quadrat 5 16 13 11 12 // Dreieck 6 17 44 // Raute 7 18 40 // Dreieck V 22 23 24 // Raute flach 25 26 27 // Raute schmal 28 29 30 // Sanduhr 3 14 // Sanduhr liegend 4 15 // Dreieck rechts unten 31 32 // Dreieck links unten 33 34 // Dreieck rechts oben 35 36 // Dreieck links oben 37 38 // # 39 // * 2 // x 1 // + 0 // / 20 // \ 21 // - 9 // | 10 Function ModGraph(i,d,k,wav) Variable i,d,k String wav Variable m WAVE CoeffMarkerOut=root:CoeffMarkerOut WAVE CoeffMarkerIn1=root:CoeffMarkerIn1 WAVE CoeffMarkerIn2=root:CoeffMarkerIn2 WAVE DetectorColorR=root:DetectorColorR WAVE DetectorColorG=root:DetectorColorG WAVE DetectorColorB=root:DetectorColorB if(k<0) // Plot zeigt Messsignal und keinen Fitkoeffizienten k=numpnts(CoeffMarkerOut)-1; endif if(i<2) m=CoeffMarkerOut[k] elseif(i & 1) // 3 oder 5 m=CoeffMarkerIn2[k] else m=CoeffMarkerIn1[k] endif if(numpnts($wav)>80) ModifyGraph mode($wav)=0 else ModifyGraph mode($wav)=4 endif ModifyGraph marker($wav)=m,opaque($wav)=1 ModifyGraph rgb($wav)=(DetectorColorR[d],DetectorColorG[d],DetectorColorB[d]) End Function ButtonProc_ListFiles(ctrlName) : ButtonControl String ctrlName SVAR ExpNo=:ctrl:ExpNo SVAR Info_Name=:ctrl:Info_Name WAVE/T ParamNames=root:ParamNames WAVE/D Order=:Order WAVE/D Param=:Param WAVE/D Timestamp=:Timestamp WAVE/D Duration=:Duration WAVE/D TimePt=:TimePt WAVE/D IntensPt=:IntensPt Edit /K=1 :File_Name,:Order,:Param Variable p WAVE/T ParamNames=root:ParamNames for(p=1; p<4; p+=1) Wave/D xyz=$ParamNames[p] if (waveexists(xyz)) AppendToTable xyz endif endfor AppendToTable :Timestamp,:Duration String WndName=ExpNo+"_Info"; DoWindow /K $WndName // altes Fenster lschen DoWindow /C $WndName DoWindow /T $WndName,ExpNo+" Info-File: "+Info_Name Execute("ModifyTable width=40") // Standardbreite setzen Execute("ModifyTable width(Timestamp)=100") Execute("ModifyTable format(Timestamp)=8") SetTableFormatFilename("File_Name") SetTableFormatPoint() End //********************************************************************************************************** //********************************************************************************************************** Function MakeDim(wavnam, dim) // ensure that wave wavnam exists dimension dim String wavnam Variable dim if(exists(wavnam)) Redimension/N=(dim) $wavnam else Make/O/D/N=(dim) $wavnam endif End Function MakeDimT(wavnam, dim) // same for text waves String wavnam Variable dim if(exists(wavnam)) Redimension/N=(dim) $wavnam else Make/O/T/N=(dim) $wavnam endif End Function SetNumberOfFiles(dim) // redimension / create all waves that scale with the number of data files Variable dim MakeDimT("File_Name",dim); MakeDim("Order",dim); MakeDim("Param",dim); Variable p WAVE/T ParamNames=root:ParamNames for(p=1; p<4; p+=1) Wave/D xyz=$ParamNames[p] if (waveexists(xyz)) Redimension/N=(dim) xyz endif endfor NVAR dmaxfit=root:dmaxfit NVAR kmax=root:kmax WAVE/T CoeffNames=root:CoeffNames WAVE/T DetectorNames=root:DetectorNames Variable k,d for(d=0; d zum letzten Experimentfolder gehen Variable ex=99 do name="root:Experiment"+num2str(ex) if(DataFolderExists(name)) SetDataFolder(name) break endif ex-=1 while(ex>0) MakeExpList() SetControlValues() End Function fKill_All_Experiments() String name SetDataFolder("root:") SetControlValues() // Fenster lschen String Windownames, ToBeKilled Variable items, j, i for(i=0; i<20; i+=1) windownames=WinList("*",";","WIN:7") items=ItemsInList(windownames,";" ) if(items==0) break endif for(j=0; j0) SetDataFolder("root:") SVAR path=:ctrl:path path="c:" MakeExpList() SetControlValues() End Macro Kill_All_Experiments() fKill_All_Experiments() End Function PopMenuProc_Experiment(ctrlName,popNum,popStr) : PopupMenuControl String ctrlName Variable popNum String popStr if(stringmatch(popStr,"root*")) SetDataFolder "root:" else Variable n = str2num(popStr[1,strlen(popStr)-1]); String name="root:Experiment"+num2str(n) SetDataFolder $name endif SetControlValues() End Function ButtonProcReloadInfo(ctrlName) : ButtonControl String ctrlName SVAR Info_Name=:ctrl:Info_Name LoadInfoData() End Function ButtonProcLoadNewInfo(ctrlName) : ButtonControl String ctrlName SVAR Info_Name=:ctrl:Info_Name Variable refnum Open/R/D/P=datapath /M="Info oder Excel-Datei ffnen"/T=".XLS.INF" refnum String str=S_Filename if(strlen(str)!=0) Info_Name=str LoadInfoData() endif End Function LoadInfoData() NVAR V_flag=:root:V_flag NVAR InFirst=:ctrl:InFirst SVAR S_waveNames=:root:S_waveNames SVAR S_worksheetName=:root:S_worksheetName SVAR Info_Name=:ctrl:Info_Name WAVE/T File_Name=:File_Name WAVE/D Order=:Order WAVE/D Param=:Param WAVE/D Timestamp=:Timestamp WAVE/D Duration=:Duration WAVE/D TimePt=:TimePt WAVE/T wave0=:wave0 WAVE wave1=:wave1 WAVE wave2=:wave2 WAVE wave3=:wave3 WAVE wave4=:wave4 WAVE wave5=:wave5 // WAVE exceldata0=:exceldata0 // WAVE/T excelvar0=:excelvar0 Wave /T ParamNames=root:ParamNames Variable nr,dim,p String str if(stringmatch(Info_Name,"*.xls")) Make/O/T/N=4 excelvar0 Make/O/D/N=4 exceldata0 Execute("XLLoadWave /Q/S=\"Scan Variables\" /R=(A3,A25) /N=excelvar/C=\"T\"/O/P=datapath \""+Info_Name+"\"") Execute("XLLoadWave /Q/S=\"Scan Variables\" /R=(B3,B25) /N=exceldata/O/P=datapath \""+Info_Name+"\"") // dim=1; Variable loopsnested=0 Variable ii Variable para,paramin=0,paramax=0,parastep=0,inout=0 for(ii=0; ii0) if(mod(sheet,2) == 0) para+=parastep endif endif if(para > paramax+parastep/2) para=paramin endif if(loopsnested>=3) // read z,y Execute("XLLoadWave /Q/S=\""+str+"\" /R=(O2,O4) /N=excelvar /C=\"T\"/O/P=datapath \""+Info_Name+"\"") Variable pos,source,dest String value for(source=0, dest=3; dest>=2; dest-=1, source+=2) pos=strsearch(excelvar0[source]," = ",0); if(pos>0) value=excelvar0[source] pos+=3 value=value[pos,inf] if(nr==0) Make /O/N=(dim)/D $ParamNames[dest] endif Wave/D xyz=$":"+ParamNames[dest] xyz[nr]=str2num(value) endif endfor endif endfor else // load text files KillWaves /Z wave0,wave1,wave2 Execute("LoadWave/J/N/O/P=datapath/K=0/B=\"C=1,F=-2;C=1,F=0;\"/V={\"\t\",\" $\",0,0} \""+Info_Name+"\"") WAVE/T wave0=:wave0 WAVE wave1=:wave1 WAVE wave2=:wave2 WAVE wave3=:wave3 WAVE wave4=:wave4 WAVE wave5=:wave5 dim=numpnts(wave0) Make/O/T/N=(dim) File_Name Make/O/D/N=(dim) Order,Param Make/O/D/N=(dim) Timestamp, Duration, TimePt File_Name=wave0 if(WaveExists(wave1)) Order=wave1 endif for(p=0; p<4; p+=1) Wave/D wav=$"wave"+num2str(p+1) Wave/D xyz=$ParamNames[p] if(waveexists(wav)) Make /O/D/N=(dim) $ParamNames[p] Wave/D xyz=$ParamNames[p] xyz=wav else KillWaves /Z xyz endif endfor endif // reserve "file number 0" for mean values InsertPoints 0, 1, File_Name, Order, Param, Timestamp, Duration File_Name[0]="mean value" for(p=1; p<4; p+=1) Wave/D xyz=$ParamNames[p] if(waveexists(xyz)) InsertPoints 0, 1, xyz xyz[0]=NaN endif endfor MakeExpList() End Function ButtonProcReloadFile(ctrlName) : ButtonControl String ctrlName NVAR LoadNr=:ctrl:LoadNr NVAR DispNr=:ctrl:DispNr WAVE/T File_Name=:File_Name Variable ii=LoadNr; if(ii>=numpnts(File_name)) ii=1; endif LoadNr=ii; DispNr=ii; if(stringmatch(File_name[ii],"*.xls*")) LoadExcelSheet(ii) else LoadTextSheet(ii) endif LoadFile(ii); End Function string2time(str) String str Variable /D day,month,year,hour,minute,second String ampm if( strsearch(str,"/",0) > 0) // month/day/year sscanf str,"%u/%u/%u %u:%u:%u %s",month,day,year,hour,minute,second,ampm else // day.month.year sscanf str,"%u.%u.%u %u:%u:%u %s",day,month,year,hour,minute,second,ampm endif if(year<1900) if(year>50) year+=1900 else year+=2000 endif endif if(stringmatch(UpperStr(ampm),"PM*")) if(hour<12) hour+=12 endif elseif(stringmatch(UpperStr(ampm),"AM*")) if(hour==12) hour-=12 endif endif second+=60*(minute+60*hour) second+=date2secs(year,month,day) return(second) End Function ButtonProc_LoadData(ctrlName) : ButtonControl String ctrlName Variable ii,dim NVAR LoadNr=:ctrl:LoadNr NVAR DispNr=:ctrl:DispNr WAVE/T File_Name=:File_Name WAVE/D Timestamp=:Timestamp WAVE/D Duration=:Duration SVAR Info_Name=:ctrl:Info_Name WAVE wave0=:wave0 WAVE wave1=:wave1 WAVE wave2=:wave2 WAVE/D data0=:data0 WAVE/D data1=:data1 WAVE/D data2=:data2 WAVE/D data3=:data3 WAVE/D data4=:data4 WAVE/D data5=:data5 WAVE/D data6=:data6 dim=numpnts(File_name) if(stringmatch(ctrlName,"button_LoadFitOne")) Variable refnum Open/R/D/P=datapath /M="open dat file or Excel sheet"/T=".XLS.INF" refnum if(strlen(S_Filename)!=0) ii=LoadNr DispNr=ii if(ii>=dim) ii=dim dim+=1 SetNumberOfFiles(dim) endif File_Name[ii]=S_Filename if(stringmatch(S_Filename,"*.xls")) Variable ss=1 // should be choseable by the user File_Name[ii]+=";Data Sheet "+num2str(ss) LoadExcelSheet(ii) else LoadTextSheet(ii) endif LoadFile(ii) endif elseif( strlen(Info_Name)>0) Make /O/D/N=2 exceldata0,exceldata1,exceldata2,exceldata3,exceldata4,exceldata5,exceldata6 SetNumberOfFiles(dim) for(ii=1; ii Messzeitraum = Timestamp +/- Duration End Function LoadExcelSheet(ii) Variable ii WAVE/T File_Name=:File_Name WAVE/D Timestamp=:Timestamp WAVE/D Duration=:Duration WAVE wave0=:wave0 WAVE wave1=:wave1 WAVE wave2=:wave2 // WAVE/D data0=:data0 // WAVE/D data1=:data1 // WAVE/D data2=:data2 // WAVE/D data3=:data3 // WAVE/D data4=:data4 // WAVE/D data5=:data5 // WAVE/D data6=:data6 String filename =StringFromList(0,File_Name[ii]) String sheetname=StringFromList(1,File_Name[ii]) KillWaves wave0,wave1,wave2 Make/O/N=2 wave0,wave1,wave2 Execute("XLLoadWave /S=\""+sheetname+"\" /R=(B8,B8) /K=1 /N/O/P=datapath \""+filename+"\"") Variable maxline=wave0[0] Make/O/D/N=(maxline) exceldata0,exceldata1,exceldata2,exceldata3,exceldata4,exceldata5 maxline+=9 Variable startingtime,stoppingtime; Execute("XLLoadWave /Q/S=\""+sheetname+"\" /R=(B6,D7) /K=1 /N/O/P=datapath \""+filename+"\"") startingtime=(wave0[0]-1462 + wave2[0])*24*3600 stoppingtime=(wave0[1]-1462 + wave2[1])*24*3600 Timestamp[ii]=(stoppingtime + startingtime)/2 Duration[ii] =(stoppingtime - startingtime)/2 Make /O/T/N=1 text0,text1,text2 Execute("XLLoadWave /Q/S=\""+sheetname+"\" /R=(B9,D9) /K=1 /C=\"T\"/N=text/O/P=datapath \""+filename+"\"") Execute("XLLoadWave /Q/D/S=\""+sheetname+"\" /R=(A10,F"+num2str(maxline)+") /N=exceldata/O/P=datapath \""+filename+"\"") KillWaves /Z data0,data1,data2,data3,data4,data5,data6 if(stringmatch(text0[0],"TempA")) Duplicate /O exceldata1,data1 // TempA->O Duplicate /O exceldata2,data2 // TempB->H // Make /O/D/N=(numpnts(exceldata3)) data5 Duplicate /O exceldata4,data5 data5=(exceldata4-1462 + exceldata3)*24*3600 // Time -> Phaseshifter SetScale d 0,0,"dat", data5 Duplicate /O exceldata0,data3 // Pressure -> 3rd else Duplicate /O exceldata1,data0 Duplicate /O exceldata0,data5 // Phaseshifter-angle Duplicate /O exceldata1,data1 // O Duplicate /O exceldata2,data2 // H Duplicate /O exceldata3,data3 // O+H -> 3rd Duplicate /O exceldata4,data6 // Monitor Duplicate /O exceldata5,data4 // seconds per point endif End Function DataLoaded() WAVE/T File_Name=:File_Name // WAVE Proc_Order=:Proc_Order // if(WaveExists(Proc_Order)) // if(numpnts(Proc_Order)==numpnts(File_Name)) // wurden die Daten berhaupt schon geladen? WAVE Order=:Order if(WaveExists(Order)) if(numpnts(Order)==numpnts(File_Name)) // wurden die Daten berhaupt schon geladen? return(1) endif endif return(0) End Function showfitwindow() NVAR ShowFitting=:ctrl:ShowFitting NVAR KeepFitPlot=:ctrl:KeepFitPlot if(ShowFitting) Display/K=1 if(KeepFitPlot==0) DoWindow /K preview // altes Fenster lschen DoWindow /C/T preview,"Preview" // neues Fenster umbenennen und Titel setzen endif else DoWindow /K preview // altes Fenster lschen endif End Function showfit(i,d,nr,title) Variable i,d,nr String title String WavName,StdPhName //,ModGraphFunction NVAR ShowFitting=:ctrl:ShowFitting NVAR KeepFitPlot=:ctrl:KeepFitPlot WAVE DetectorDoFit=:ctrl:DetectorDoFit WAVE/T DetectorNames=root:DetectorNames if(ShowFitting) if(DetectorDoFit[d]) StdPhName="Std_Phase"+num2str(nr) WavName="Data"+DetectorNames[d]+num2str(nr) AppendtoGraph $WavName vs $StdPhName ModGraph(i,d,-1,WavName); // ModGraphFunction="ModGraph"+DetectorNames[d] // if(exists(ModGraphFunction)) // Execute(ModGraphFunction+"(\""+WavName+"\")") // endif if(KeepFitPlot) DoWindow /K $"Plot_"+WavName // altes Fenster lschen DoWindow /C/T $"Plot_"+WavName,title // Titel setzen endif endif endif End Function showfitlegend() NVAR ShowFitting=:ctrl:ShowFitting if(ShowFitting) Legend/C/N=text0/A=MC endif End Function Make_dSignal(ii) Variable ii String name NVAR dSignal1=:ctrl:dSignal1 NVAR dSignal2=:ctrl:dSignal2 NVAR dSignalOp=:ctrl:dSignalOp WAVE/T DetectorNames=root:DetectorNames name="Data"+DetectorNames[dSignal1]+num2str(ii); wave wav1=$name, err1=$"Err_"+name; name="Data"+DetectorNames[dSignal2]+num2str(ii); wave wav2=$name, err2=$"Err_"+name; if(WaveExists(wav1)) if(WaveExists(wav2)) name="DatadSignal"+num2str(ii); MakeDim(name,numpnts(wav1)); wave wav=$name; name="Err_"+name; MakeDim(name,numpnts(wav1)); wave err=$name; if(dSignalOp==0) wav=(wav1-wav2); else wav=(wav1+wav2); endif err=sqrt(err1^2 + err2^2); endif endif End Function MakeAll_dSignal() // wenn sich dSignal1 oder dSignal2 gendert hat -> Differenzen neu berechnen Variable ii NVAR dSignal1=:ctrl:dSignal1 NVAR dSignal2=:ctrl:dSignal2 WAVE/T DetectorNames=root:DetectorNames WAVE/T File_name=:File_name if(DataLoaded()) for(ii=1; ii=3) // O -> O/(O+H) wav1/=wavnorm wav2/=wavnorm wave err1=$"Err_DataO"+num2str(ii) wave err2=$"Err_DataH"+num2str(ii) err1=sqrt(wav1*wav2/wavnorm); err2=err1; if(NormTo==4) // O -> O/(O+H) * wav1*=mittel; wav2*=mittel; err1*=mittel; err2*=mittel; endif else if(NormTo==2) // Monitor wave wav1=$"DataMon"+num2str(ii) wavnorm=wav1 mittel=mean(wavnorm,-inf,inf); endif wavnorm/=mittel for(d=0; d 2*Pi; ) W_coef[3] -= 2*PI endfor W_coef[3] *= 180/Pi W_sigma[3] *= 180/Pi cont=W_coef[1]/W_coef[0] if(cont<0) cont=-cont; endif err_cont=cont*sqrt((W_sigma[1]/W_coef[1])^2+(W_sigma[0]/W_coef[0])^2) err_fwhm=NaN if (FitType==2) fwhm=W_coef[4] err_fwhm=W_sigma[4] elseif(FitType==3) fwhm=W_coef[4] * 180/Pi err_fwhm=W_sigma[4] * 180/Pi endif endif for(k=0; k1)>=3) Variable dd = wav[nr] - wav[nr-1] if(dd > 315) wav[nr]-=360 elseif(dd < -315) wav[nr]+=360 endif endif wave wav=$("Err_"+InoutNames[i]+CoeffNames[k]+"_"+DetectorNames[d]); wav[nr]=W_sigma[k] endfor wave wav=$( InoutNames[i]+CoeffNames[4]+"_"+DetectorNames[d]); wav[nr]=cont wave wav=$("Err_"+InoutNames[i]+CoeffNames[4]+"_"+DetectorNames[d]); wav[nr]=err_cont wave wav=$( InoutNames[i]+CoeffNames[5]+"_"+DetectorNames[d]); wav[nr]=fwhm wave wav=$("Err_"+InoutNames[i]+CoeffNames[5]+"_"+DetectorNames[d]); wav[nr]=err_fwhm string str=InoutNames[i]+CoeffNames[6]+"_"+DetectorNames[d]; wave wav=$( InoutNames[i]+CoeffNames[6]+"_"+DetectorNames[d]); wav[nr]=chi2 wave wav=$("Err_"+InoutNames[i]+CoeffNames[6]+"_"+DetectorNames[d]); wav[nr]=1 // damit Mittelwertbildung funktioniert End Function MakeSineGuess(data,xdata) wave data,xdata Variable ymin=inf,ymax=-inf Variable pt Variable dim=numpnts(data) // find absolute minimum and maximum for(pt=0; ptymax) ymax=data[pt] endif endfor K0 = (ymax+ymin)/2 // offset K1 = (ymax-ymin)/2 // amplitude K2=5*Pi/(xdata[dim-1]-xdata[0]); // assume the whole x-rage 5*Pi in case no period can be found K3=0; // find local minima and maxima and calculate the periode and phase Variable filtermax=K0+0.5*K1 Variable filtermin =K0-0.5*K1 // thresholds to identify the local extrema Variable ptmin=-1,ptmax=-1; Variable periodsum=0, items=0 Make /O /N=(dim/2) zerophases,piphases Variable phase Variable zeroitems=0, piitems=0 for(pt=0; ptfiltermax) // entering region of maximum ptmax=pt ymax=data[pt] for(pt+=1; ptymax) // find local maximum ymax=data[pt] ptmax=pt endif if(data[pt]0) // local minimum also found already? phase=(xdata[ptmax]+xdata[ptmin])/2; zerophases[zeroitems]=phase; zeroitems+=1; periodsum+=(xdata[ptmax]-xdata[ptmin]) items+=1; ptmin=-1; endif break endif endfor elseif(data[pt]K0) // leaving region of minimum if(ptmax>0) // local maximum also found already? phase=(xdata[ptmax]+xdata[ptmin])/2; piphases[piitems]=phase; piitems+=1; periodsum+=(xdata[ptmin]-xdata[ptmax]) items+=1; ptmax=-1 endif break endif endfor else pt+=1; endif endfor if(items) // mean found period Variable period=periodsum/items; // half period K2=Pi/period; Variable i,phasesum=0; items=0; for(i=0; i 2Pi-Sprung verhindern if(abs(phasesum/items - phase) > Pi) if(phase>Pi) phase-=2*Pi else phase+=2*Pi endif endif endif phasesum+=phase items+=1 endfor for(i=0; i 2Pi-Sprung verhindern if(abs(phasesum/items - phase) > Pi) if(phase>Pi) phase-=2*Pi else phase+=2*Pi endif endif endif phasesum+=phase items+=1 endfor K3=phasesum/items; endif KillWaves/Z zerophases,piphases print "guess: K0="+num2str(K0)+", K1="+num2str(K1)+", K2="+num2str(K2)+", K3="+num2str(K3) End Function sinestretch(w,x) : FitFunc Wave w Variable x //CurveFitDialog/ These comments were created by the Curve Fitting dialog. Altering them will //CurveFitDialog/ make the function less convenient to work with in the Curve Fitting dialog. //CurveFitDialog/ Equation: //CurveFitDialog/ f(x) = A + B * sin(D + C*(1/cos((45+x-T)*Pi/180) - 1/cos((45-(x-T))*Pi/180))) //CurveFitDialog/ End of Equation //CurveFitDialog/ Independent Variables 1 //CurveFitDialog/ x //CurveFitDialog/ Coefficients 5 //CurveFitDialog/ w[0] = A //CurveFitDialog/ w[1] = B //CurveFitDialog/ w[2] = C //CurveFitDialog/ w[3] = D //CurveFitDialog/ w[4] = T return w[0] + w[1] * sin(w[3] + w[2]*(1/cos((45+x-w[4])*Pi/180) - 1/cos((45-(x-w[4]))*Pi/180))) End Function sine2order(w,x) : FitFunc Wave w Variable x //CurveFitDialog/ These comments were created by the Curve Fitting dialog. Altering them will //CurveFitDialog/ make the function less convenient to work with in the Curve Fitting dialog. //CurveFitDialog/ Equation: //CurveFitDialog/ f(x) = A + B*(0.8*sin(C*x+D) + 0.2*sin(C/2*x+E)) //CurveFitDialog/ End of Equation //CurveFitDialog/ Independent Variables 1 //CurveFitDialog/ x //CurveFitDialog/ Coefficients 5 //CurveFitDialog/ w[0] = A //CurveFitDialog/ w[1] = B //CurveFitDialog/ w[2] = C //CurveFitDialog/ w[3] = D //CurveFitDialog/ w[4] = E return w[0] + w[1]*(0.8*sin(w[2]*x+w[3]) + 0.2*sin(w[2]/2*x+w[4])) End Function FitData (det,nr) Variable det,nr Variable k WAVE/T CoeffNames=root:CoeffNames WAVE/T DetectorNames=root:DetectorNames WAVE DetectorDoFit=:ctrl:DetectorDoFit NVAR FitType=:ctrl:FitType NVAR kmax=root:kmax Variable fwhm=Nan wave data=$":Data"+DetectorNames[det]+num2str(nr) wave err=$":Err_Data"+DetectorNames[det]+num2str(nr) wave xdata=$":Std_Phase"+num2str(nr) KillWaves/Z $":Fit_Data"+DetectorNames[det]+num2str(nr) if(WaveExists(data)) if(DetectorDoFit[det]) WAVE wgt=:wgt Duplicate/O err,wgt wgt=1/err Variable err_fwhm,cont,err_cont // print GetWavesDataFolder(data,2) // print GetWavesDataFolder(xdata,2) // print GetWavesDataFolder(wgt,2) if (FitType==1) // gauss CurveFit/Q gauss data /X=xdata /W=wgt /D else // cos /B=19 MakeSineGuess(data,xdata); if(FitType==0) // normaler Sinus CurveFit /G sin data /X=xdata /W=wgt /D WaveStats data fwhm=(V_max-V_min)/(V_max+V_min) // Kontrast = Amplitude/Offset elseif(FitType==2) // Sinus mit variabler Parallelstellung CurveFit /G sin data /X=xdata /W=wgt /D NVAR ParallelDeg=:ctrl:ParallelDeg; Duplicate :W_coef, coef Redimension /N=5 :W_coef wave W_coef=:W_coef W_coef[0]=coef[0] W_coef[1]=coef[1] W_coef[2]=coef[2]* 55.3/2.74 W_coef[3]=coef[3] W_coef[4]=ParallelDeg KillWaves coef FuncFit sinestretch W_coef data /X=xdata /D else // Sinus mit zweiter Ordnung CurveFit /G sin data /X=xdata /W=wgt /D Duplicate :W_coef, coef Redimension /N=5 :W_coef wave W_coef=:W_coef W_coef[0]=coef[0] W_coef[1]=coef[1] W_coef[2]=coef[2] W_coef[3]=coef[3] W_coef[4]=coef[3] KillWaves coef FuncFit sine2order W_coef data /X=xdata /D endif endif // KillWaves wgt // NVAR V_chisq=:V_chisq // q = gammq( (N-M)/2, chisq/2) Variable q = gammq( (numpnts(data)-4)/2, V_chisq/2, 1e-7); // see Numerical Recipes in C++, p. 665 print "chi = "+num2str(V_chisq)+" Q=gammaq((N-M)/2,chi/2)="+num2str(q)+" N="+num2str(numpnts(data))+" M=4" saveWCoef(0,det,nr,V_chisq,fwhm) else // alte Fit-Daten lschen for(k=0; k=dim) break endif in1[d]=wav[s]; if(WithError) errin1[d]=errwav[s]; endif s+=1; d+=1 while (s filesIn2 = 1 filesIn1=floor((files-filesIn2)/2) // filesIn1 = (5-1)/2 = 2 filesOut=files-filesIn1-filesIn2 // filesOut = 5-2-1 = 2 MakeDim( OutName,filesOut+1); wave out=$":"+OutName; MakeDim( In1Name,filesIn1+1); wave in1=$":"+In1Name; MakeDim( In2Name,filesIn2+1); wave in2=$":"+In2Name; MakeDim( In12Name,filesIn2+1); wave in12=$":"+In12Name; if(WithError) wave errwav=$":Err_"+WavName MakeDim("Err_"+OutName,filesOut+2); wave errout=$":Err_"+OutName MakeDim("Err_"+In1Name,filesIn1+2); wave errin1=$":Err_"+In1Name MakeDim("Err_"+In2Name,filesIn2+2); wave errin2=$":Err_"+In2Name MakeDim("Err_"+In12Name,filesIn2+2); wave errin12=$":Err_"+In12Name endif s=1; d=1; // value [0] = mean value do out[d]=wav[s]; if(WithError) errout[d]=errwav[s]; endif s+=1; if(s>=dim) break endif in1[d]=wav[s]; if(WithError) errin1[d]=errwav[s]; endif s+=1; if(s>=dim) break endif in2[d]=wav[s]; if(WithError) errin2[d]=errwav[s]; endif s+=1; d+=1 while (s=dim) break endif in1[d]=wav[s]; s+=1; d+=1 while (s filesIn2 = 1 filesIn1=floor((files-filesIn2)/2) // filesIn1 = (5-1)/2 = 2 filesOut=files-filesIn1-filesIn2 // filesOut = 5-2-1 = 2 wave /T wav=$":"+WavName; MakeDimT( OutName,filesOut+1); wave /T out=$":"+OutName; MakeDimT( In1Name,filesIn1+1); wave /T in1=$":"+In1Name; MakeDimT( In2Name,filesIn2+1); wave /T in2=$":"+In2Name; s=1; d=1; // skip mean value do out[d]=wav[s]; s+=1; if(s>=dim) break endif in1[d]=wav[s]; s+=1; if(s>=dim) break endif in2[d]=wav[s]; s+=1; d+=1 while (s=numpnts(File_name)) nr=0 endif return(nr) End Function InoutSplitAll() Variable i,k,d NVAR kmax=root:kmax NVAR dmaxsplit=root:dmaxsplit NVAR imaxsplit=root:imaxsplit NVAR ParaSer=:ctrl:ParaSer NVAR InoutType=:ctrl:InoutType NVAR InFirst=:ctrl:InFirst NVAR FitType=:ctrl:FitType NVAR MeanOutForIn=:ctrl:MeanOutForIn NVAR MeanInout=:ctrl:MeanInout NVAR MeanDetector=:ctrl:MeanDetector WAVE/T InoutNames=root:InoutNames WAVE/T CoeffNames=root:CoeffNames WAVE/T DetectorNames=root:DetectorNames WAVE DetectorDoFit=:ctrl:DetectorDoFit NVAR dmaxfit=root:dmaxfit for(k=0; k fr jeden det separat for(d=0; d fr jedes inout separat for(i=1; i<=2+InoutType; i+=1) CalcMeanPeriod(0,dmaxfit-1,i,i,inr,onr,MeanC,ErrMeanC) FitSinWithPeriod(0,dmaxfit-1,i,i,inr,onr,MeanC,ErrMeanC) endfor else // ber inout und det mitteln CalcMeanPeriod(0,dmaxfit-1,imean1,imean2,inr,onr,MeanC,ErrMeanC) FitSinWithPeriod(0,dmaxfit-1,ifit1,ifit2,inr,onr,MeanC,ErrMeanC) endif endfor endif endif End Function CalcMeanPeriod(d1,d2,i1,i2,inr,onr,MeanC,ErrMeanC) Variable d1,d2,i1,i2,inr,onr,&MeanC,&ErrMeanC // Werte in MeanC und ErrMeanC an Aufrufer zurckliefern WAVE/T InoutNames=root:InoutNames WAVE/T CoeffNames=root:CoeffNames WAVE/T DetectorNames=root:DetectorNames WAVE DetectorDoFit=:ctrl:DetectorDoFit MeanC=0; ErrMeanC=0; Variable i,d,ionr; ionr=onr; for(i=i1; i<=i2; i+=1, ionr=inr) for(d=d1; d<=d2; d+=1) if(DetectorDoFit(d)) // gewichtetes Mittel ber alle Periode von out/in1/in2 berechnen // = sum_i (x_i/sigma_i^2) / sum_i (1/sigma_i^2) // ^2 = 1 / sum_i (1/sigma_i^2) wave wav=$ InoutNames[i]+CoeffNames[2]+"_"+DetectorNames[d] wave err=$"Err_"+InoutNames[i]+CoeffNames[2]+"_"+DetectorNames[d] MeanC+=wav[ionr] / (err[ionr]^2) ErrMeanC+= 1 / (err[ionr]^2) endif endfor endfor if(ErrMeanC!=0) MeanC/=ErrMeanC; ErrMeanC=sqrt(1/ErrMeanC); else MeanC=NaN; ErrMeanC=NaN; endif End Function FitSinWithPeriod(d1,d2,i1,i2,inr,onr,MeanC, ErrMeanC) Variable d1,d2,i1,i2,inr,onr,MeanC,ErrMeanC // d1,d2 = Detector-Bereich // i1,i2 = Inout-Bereich // nr = File-Nummer der Originaldaten // inr = index in der in-Wave // onr = index in der out-Wave WAVE/T InoutNames=root:InoutNames WAVE/T DetectorNames=root:DetectorNames WAVE DetectorDoFit=:ctrl:DetectorDoFit WAVE W_sigma=:W_sigma WAVE W_coef=:W_coef Variable i,d,ionr,nr ionr=onr; for(i=i1; i<=i2; i+=1, ionr=onr) showfitwindow() wave /T iofilename=$(InoutNames[i]+"File_Name") nr=filenr(iofilename[ionr]) if(nr) for(d=d1; d<=d2; d+=1) if(DetectorDoFit(d)) wave data=$"Data"+DetectorNames[d]+num2str(nr) wave err=$"Err_Data"+DetectorNames[d]+num2str(nr) wave xdata=$"Std_Phase"+num2str(nr) KillWaves/Z $"Fit_Data"+DetectorNames[d]+num2str(nr) Duplicate/O err,wgt wgt=1/err Variable cont,err_cont K2=MeanC showfit(i,d,nr,InoutNames[i]+DetectorNames[d]+num2str(ionr)) CurveFit/Q/B=19 /H="0010" sin data /X=xdata /W=wgt /D KillWaves wgt W_sigma[2]=ErrMeanC; // W_coef[2]=MeanC; saveWCoef(i,d,ionr,V_chisq,Nan) endif endfor endif showfitlegend() endfor End Function InoutKill(WavName) String WavName KillWaves/Z $"Out_"+WavName, $"Err_Out_"+WavName KillWaves/Z $"In1_"+WavName, $"Err_In1_"+WavName KillWaves/Z $"In2_"+WavName, $"Err_In2_"+WavName End Function InoutKillAll() Variable k,d NVAR kmax=root:kmax NVAR dmaxsplit=root:dmaxsplit WAVE/T CoeffNames=root:CoeffNames WAVE/T DetectorNames=root:DetectorNames for(k=0; k=2) // sin + phase if(diff<-128) diff+=360 elseif(diff>128) diff-=360 endif endif else // quotient diff=vali/valo err2=(vali/valo)^2*((erri/vali)^2+(erro/valo)^2) endif End Function MakeInoutDiff(in,out,k,d) // In-out berechnen, incl.mean values + error String in,out Variable k,d WAVE/T InoutNames=root:InoutNames WAVE/T CoeffNames=root:CoeffNames WAVE/T DetectorNames=root:DetectorNames NVAR ParaSer=:ctrl:ParaSer NVAR InFirst=:ctrl:InFirst String name=CoeffNames[k]+"_"+DetectorNames[d] String inoutname=in+out+"_"+name wave wavin=$in+"_"+name wave wavout=$out+"_"+name wave errin=$"Err_"+in+"_"+name wave errout=$"Err_"+out+"_"+name Variable dim,err2,diff,err2sum,diffsum,n,ni,no,i,o,err2i,err2o if(WaveExists(wavin)) if(ParaSer==0) // parallel dim=numpnts(wavin) // wavin: hat die kleinere Dimension von wavin und wavout MakeDim(inoutname,dim) MakeDim("Err_"+inoutname,dim+1) wave wavinout=$inoutname wave errinout=$"Err_"+inoutname diffsum=0 err2sum=0 for(n=1; n=1) // n>1 or InFirst==1 iodiff(k,i,o,diff,errin[ni],errout[no],err2); wavinout[n]=diff; diffsum+=diff; errinout[n]=sqrt(err2); n+=1 if(n>=dim) err2sum -= 3*err2i; break; endif no+=1; o=wavout[no]; err2o=errout[no]^2; err2sum+=4*err2o; endif iodiff(k,i,o,diff,errin[ni],errout[no],err2); wavinout[n]=diff; diffsum+=diff; errinout[n]=sqrt(err2); n+=1 if(n>=dim) err2sum -= 3*err2o; break; endif endfor wavinout[0]=diffsum/(dim-1) errinout[0]=sqrt(err2sum)/(dim-1) endif endif End Function MakeInoutX(in,out,name) // name = Order oder Timestamp, x-Achse erstellen String in,out,name String inoutname=in+out+"_"+name NVAR ParaSer=:ctrl:ParaSer NVAR InFirst=:ctrl:InFirst wave wavin=$in+"_"+name wave wavout=$out+"_"+name if(ParaSer==0) // parallel Duplicate /O wavout, $inoutname // wavout: hat die grere Dimension von wavin und wavout wave wavinout=$inoutname elseif(InFirst==2) Duplicate /O wavin, $inoutname // // Redimension /N=numpnts(wavin) wavout wave wavinout=$inoutname else Variable dim=numpnts(wavin)+numpnts(wavout)-1 MakeDim(inoutname,dim) wave wavinout=$inoutname Variable i,o,io for(i=1, o=1, io=1; io=dim) break; endif wavinout[io]=(wavin[i]+wavout[o])/2 i+=1 endfor endif wavinout[0]=wavinout[1]-(wavinout[2]-wavinout[1]); End Function MakeInoutDiffAll() String io1,io2,diff Variable k,d,dim NVAR kmaxfit=root:kmaxfit NVAR dmaxsplit=root:dmaxsplit NVAR InoutType=:ctrl:InoutType for(d=0; d0) if(MeanNr2>nmax) MeanNr2=nmax endif nmax=MeanNr2 endif n=1 if(MeanNr1!=0) if(MeanNr1>nmax) MeanNr1=nmax endif n=MeanNr1 endif endif End Function MakeMeanValues() // without in/out difference waves Variable i,k,d,n,nmax String WavName NVAR ParaSer=:ctrl:ParaSer NVAR InFirst=:ctrl:InFirst NVAR InoutType=:ctrl:InoutType NVAR imax=root:imax NVAR kmax=root:kmax NVAR dmax=root:dmax NVAR dmaxfit=root:dmaxfit NVAR dmaxsplit=root:dmaxsplit WAVE DetectorDoFit=:ctrl:DetectorDoFit WAVE/T InoutNames=root:InoutNames WAVE/T CoeffNames=root:CoeffNames WAVE/T DetectorNames=root:DetectorNames WAVE/D Timestamp=:Timestamp WAVE/D Param=:Param Timestamp[0]=Timestamp[1]-(Timestamp[2]-Timestamp[1]); Wave /T ParamNames=root:ParamNames Variable p for(p=0; p<4; p+=1) Wave/D xyz=$ParamNames[p] if(waveexists(xyz)) xyz[0]=xyz[1]-(xyz[2]-xyz[1]); endif endfor // for(i=0; i<=2+InoutType; i+=1) // all / out / in1 [/ in2] for(i=0; i3) // inout-differences: special error calculation in MakeInoutDiff() condition=0 endif elseif(d==dmaxfit) //dCoeff if(i>3) // inout-differences: special error calculation in MakeInoutDiff() condition=0 endif endif // else: d=meanDet: calculate always mean value endif endif if( condition) // logical ORs and ANDs do not work in igor! WavName=InoutNames[i]+CoeffNames[k]+"_"+DetectorNames[d] wave wav=$WavName wave err=$"Err_"+WavName if(WaveExists(wav)) Variable wavsum=0 Variable errsum=0 Variable dim=numpnts(wav) GetMeanNr(n,nmax,dim) if(WaveExists(err)) // gewichtetes Mittel: // = sum_i (x_i/sigma_i^2) / sum_i (1/sigma_i^2) // ^2 = 1 / sum_i (1/sigma_i^2) for(; n<=nmax; n+=1) wavsum+=wav[n] / (err[n]^2) errsum += 1 / (err[n]^2) endfor wav[0]=wavsum/errsum err[0]=sqrt(1/errsum) CalcTotalError(wav,err) else wav[0]=sum(wav,pnt2x(wav,n),pnt2x(wav,nmax)) / (nmax+1-n) endif endif endif endfor endfor endfor End Function CalcTotalError(wav,err) Wave wav,err // Gesamtfehler (stat. + systematisch), Rckgabewert in err[numpnts(wav)] // ^2 = 1/(N-1) sum_i ( (x_i-)^2/sigma_i^2 ) / sum_i (1/sigma_i^2) Variable errsum, totalerr, dim,n,nmax,items dim=numpnts(wav) if(numpnts(err)<=dim) Redimension /N=(dim+1) err endif GetMeanNr(n,nmax,dim) items=nmax+1-n; err[dim]=0 if(items>=2) // mindestens zwei Datenpunkte, sonst wird N-1 = 0 totalerr=0 errsum=0 for(; n<=nmax; n+=1) totalerr += (wav[n]-wav[0])^2/err[n]^2 errsum += 1 / err[n]^2 endfor totalerr /= (items-1) * errsum totalerr=sqrt(totalerr) // if(totalerr>err[dim]) err[dim]=totalerr // endif endif End //********************************************************************************************************** //********************************************************************************************************** //********************************************************************************************************** //********************************************************************************************************** //********************************************************************************************************** //********************************************************************************************************** Function MakeUniqueWnd() SVAR ExpNo=:ctrl:ExpNo string WndName, timestr sprintf timestr, "%.0f", DateTime WndName=ExpNo+"wnd"+timestr DoWindow /C $WndName // give a unique name DoWindow /T $WndName, WndName End Function SetVarProcMeanNr(ctrlName,varNum,varStr,varName) : SetVariableControl String ctrlName Variable varNum String varStr String varName MakeMeanValues() End Function ButtonProcAppFile(ctrlName) : ButtonControl String ctrlName NVAR FileAppMode=root:FileAppMode PlotFile(FileAppMode) End Function ButtonProc_Displayone(ctrlName) : ButtonControl String ctrlName PlotFile(0) End Function stretchAxes(app) Variable app // 1: same axes // 2: y on right // 3: 2nd y // 4: 2nd y, new x // 5: 3rd y // 6: 3rd y, new x if(app>=3) MakeUniqueWnd() ModifyGraph margin(right)=7,margin(top)=7,margin(bottom)=35, margin(left)=50 ModifyGraph nticks(bottom)=8,grid(bottom)=2,minor=1,sep=6,gridStyle=5,gridHair(bottom)=1 if(app>=5) ModifyGraph width=250,height=330 ModifyGraph /Z axisEnab(right)={0,0.30} ModifyGraph /Z axisEnab(left)={0,0.30} ModifyGraph /Z axisEnab(left2)={0.34,0.65} ModifyGraph /Z axisEnab(left3)={0.69,1} TextBox/C/N=text1/X=5.00/Y=-30.00 TextBox/C/N=text2/X=5.00/Y=0.00 TextBox/C/N=text3/X=5.00/Y=30.00 TextBox/C/N=results1/A=RT/Y=68.5/G=(47872,47872,47872) TextBox/C/N=results2/A=RT/Y=33.5/G=(47872,47872,47872) TextBox/C/N=results3/A=RT/Y=0/G=(47872,47872,47872) elseif(app>=3) ModifyGraph width=250,height=220 ModifyGraph /Z axisEnab(right)={0,0.46} ModifyGraph /Z axisEnab(left)={0,0.46} ModifyGraph /Z axisEnab(left2)={0.54,1} TextBox/C/N=text1/Y=-20.00 TextBox/C/N=text2/Y=20.00 TextBox/C/N=results1/A=RT/Y=52.50/G=(47872,47872,47872) TextBox/C/N=results2/A=RT/Y=0.00/G=(47872,47872,47872) endif endif End Function appendToPlot(app,Wav,X,xaxname,yaxname,nostr) Variable app wave Wav,X String &yaxname,&xaxname,&nostr xaxname="bottom" if(app<=1) yaxname="left" AppendToGraph Wav vs X elseif(app==2) // right y axis yaxname="right" AppendToGraph /R Wav vs X else // >=3 ModifyGraph standoff(bottom)=0 nostr=num2str(trunc((app+1)/2)) yaxname="left"+nostr if(app & 1) // 3 or 5 AppendToGraph /L=$yaxname Wav vs X else xaxname="bottom"+nostr AppendToGraph /L=$yaxname /B=$xaxname Wav vs X endif ModifyGraph freePos($yaxname)=0 ModifyGraph lblPos($yaxname)=48 ModifyGraph lblPos(left)=48 // ModifyGraph lblMargin($yaxname)=2 endif ModifyGraph highTrip($yaxname)=100000 End Function ButtonProc(ctrlName) : ButtonControl String ctrlName // Temporre Funktion fr spezielle Grafikformatierung MakeUniqueWnd() ModifyGraph standoff=0 ModifyGraph margin(right)=7,margin(top)=7,margin(bottom)=18, margin(left)=50 ModifyGraph nticks(bottom)=8,grid(bottom)=1,gridStyle=5,gridHair(bottom)=1 ModifyGraph manTick(bottom)={0,0.2,0,1},manMinor(bottom)={1,50} ModifyGraph width=250,height=105 ModifyGraph lblPos(left)=48 ModifyGraph lblMargin(left)=2 TextBox/C/N=results1/A=RT/Y=0/G=(47872,47872,47872) NVAR DispNr=:ctrl:DispNr wave StdPh=$("Std_Phase"+num2str(DispNr)) Variable n,a,xmin=inf,xmax=-inf,dd for(n=0; nxmax) xmax=a endif if(a create new window Display/K=1 if (Unique==1) // nur ein Fenster fr alle Kurvenplots DoWindow /K Display_unique // altes Fenster lschen DoWindow /C Display_unique DoWindow /T Display_unique,ExpNo+" Plot (File No "+num2str(DispNr)+")" // Titel else String name=ExpNo+"_Plot_File_No_"+num2str(DispNr) DoWindow /K $name // altes Fenster lschen DoWindow /C $name DoWindow /T $name,ExpNo+" Plot File No "+num2str(DispNr) // Titel endif endif StrPh="Std_Phase"+num2str(DispNr) Variable d,any any=0 String StdPhName, WavName, FitName,ErrName//,ModGraphFunction StdPhName="Std_Phase"+num2str(DispNr) for(d=dmaxfit-1; d>=0; d-=1) // dCoeff nicht anzeigen if(DetectorDoDisp[d]) any=1 WavName="Data"+DetectorNames[d]+num2str(DispNr) ErrName="Err_"+WavName appendToPlot(app,$WavName,$StdPhName,xaxname,yaxname,nostr) ModGraph(0,d,-1,WavName); if(ErrBars) if(NormTo==3) ErrorBars $WavName Y,wave=($ErrName,$ErrName) else ErrorBars $WavName Y,sqrt endif endif //Execute("ErrorBars "+WavName+" Y,sqrt"); if(strlen(Title)!=0) Title+="\r" endif Title+="\s(" + WavName + ") " if(stringmatch(DetectorNames[d],"dSignal")) Title+="dSignal ("+DetectorNames[dSignal1] if(dSignalOp==0) Title+="" else Title+="+" endif Title+=DetectorNames[dSignal2]+")" else Title+=DetectorNames[d]+" beam" endif if(app==2) // right y axis Title+=" \[0\F'Wingdings'\]0" endif if (DetectorDoFit[d]) FitName="Fit_"+WavName if(waveexists($FitName)) if(app==2) // right y axis AppendToGraph /R :$FitName else AppendToGraph :$FitName endif endif endif endif endfor if(any) if(NormTo==3) SetAxis $yaxname 0,1 endif String intensitytext String textname if(NormTo==3) intensitytext="probability (1 = "+num2str(IntensPt[DispNr])+"ct / "+ num2str(TimePt[DispNr])+ "s)" else intensitytext="intensity (counts/"+ num2str(TimePt[DispNr])+ "s)" endif if(app==2) // right y axis SetAxis /A/N=1 right AppendText /N=text1 " \[0\F'Wingdings'\]0\r"+Title // wird automatisch dazugefgt else ModifyGraph margin(top)=20,wbRGB=(221*256,221*256,221*256);DelayUpdate ModifyGraph nticks(bottom)=10 String fname=File_Name[DispNr] // if(stringmatch(Info_Name,"*.xls")) // fname=Info_Name+", "+File_Name[DispNr] // endif textname="results"+nostr TextBox/A=RB/X=0/Y=101/C/N=$textname/F=0/B=1 "\\Z07" AppendText /N=$textname fname if (PhD==1) Label $xaxname "\F'Symbol'D\F'Arial'D (\F'Symbol'm\F'Arial'm)" endif textname="text"+nostr if(app==2) AppendText /N=$textname Title else TextBox /C/N=$textname /A=MC/J title endif endif Label $yaxname intensitytext ModifyGraph zero($yaxname)=1 else title="Select at least one out of {O-Det, H-Det, 3rd, 4th, dSignal} !" TextBox /C/N=text1/A=MC/J title endif // DispNr+=1 // if(DispNr>=numpnts(File_Name)) // DispNr=1 // endif stretchAxes(app) End //********************************************************************************************************** //********************************************************************************************************** //********************************************************************************************************** //********************************************************************************************************** Function MakeWindowName(WndName) String WndName; String Title; SVAR ExpNo=:ctrl:ExpNo NVAR Unique=:ctrl:Unique if(stringmatch(WndName[strlen(WndName)-1],"_")) // wenn WndName auf '_' aufhrt, dann letztes Zeichen lschen WndName=WndName[0,strlen(WndName)-2] endif Title=ExpNo+" "+WndName WndName=ExpNo+"_"+WndName if(Unique) Title+=" " WndName+="_unique" elseif(WinType(WndName)) // Fenser existiert schon Variable i for(i=1; i<100; i+=1) String name=WndName+num2str(i); Variable typ=WinType(name) if(typ==0) break; endif endfor WndName+="_"+num2str(i); Title+=" "+num2str(i); endif DoWindow /K $WndName // delete old DoWindow/C $WndName // rename ew DoWindow/T $WndName,Title // set title End Function GetXName(name,vs) String &name // pass by reference Variable vs Variable ret=0 Wave /T ParamNames=root:ParamNames if(vs==0) name="Order" elseif (vs==1) name="Timestamp" elseif(vs<=5) // Param,Xvalue,Yvalue,Zvalue name=ParamNames[vs-2] else // 6=Signal, 7=Fits name="Std_Phase1" ret=vs-5 endif return(ret) End Function ReduceAxis(Xname) String Xname String axname="Reduc_"+Xname Wave XX=$":"+Xname Variable dim=numpnts(XX) Make /O/D/N=(dim) $axname Wave ax=$axname Variable a, diff, n,nn, adim, xmin=inf, xmax=-inf, maxspread=0; for(n=1; nxmax) xmax=a endif if(amaxspread) // calculate maximum difference between "equal" values maxspread=diff endif break endif endfor if(nn==n) // new value ax[adim]=XX[n]; adim+=1 endif endfor ax[0]=xmin-(xmax-xmin)/10 Redimension /N=(adim) ax sort ax, ax return(maxspread) End Function MakeCoeffDetectorPlot(WndName,i1,i2,k1,k2,d1,d2) String WndName // i1,i2: Inout-Bereich Variable i1,i2,k1,k2,d1,d2 // k1,k2: Coeff-Bereich Variable i,k,d, ii // d1,d2: Detector-Bereich String WavName,ErrName,XName,XErrName,XWavName,Title //ModGraphFunction,Title Variable x,xmin=inf,xmax=-inf NVAR AppendRight=:ctrl:AppendRight WAVE InoutDoDisp=:ctrl:InoutDoDisp WAVE CoeffDoDisp=:ctrl:CoeffDoDisp WAVE DetectorDoDisp=:ctrl:DetectorDoDisp // NVAR vsTime=:ctrl:vsTime // NVAR vsParam=:ctrl:vsParam NVAR PlotVs=:ctrl:PlotVs WAVE/T InoutNames=root:InoutNames WAVE/T CoeffNames=root:CoeffNames WAVE/T DetectorNames=root:DetectorNames NVAR dCoeff1=:ctrl:dCoeff1 NVAR dCoeff2=:ctrl:dCoeff2 NVAR dSignal1=:ctrl:dSignal1 NVAR dSignal2=:ctrl:dSignal2 NVAR dSignalOp=:ctrl:dSignalOp NVAR InoutOwnPlot=:ctrl:InoutOwnPlot NVAR CoeffOwnPlot=:ctrl:CoeffOwnPlot NVAR PlotMean=:ctrl:PlotMean NVAR PlotAvrg=:ctrl:PlotAvrg NVAR FitType=:ctrl:FitType NVAR imaxsplit=root:imaxsplit NVAR PlotInfo=:ctrl:PlotInfo String xaxname,yaxname,nostr="1"; String folder folder=GetDataFolder(1) XName=""; GetXName(XName,PlotVs) if(AppendRight==0) // neue Grafik erzeugen Display/K=1 MakeWindowName(WndName); endif // x-Bereich ermitteln for(i=i1; i=6) ii-=4; elseif(ii>=4) ii-=2; endif XWavName=InoutNames[ii]+XName wave XX=$XWavName xmin=inf xmax=-inf for(d=1; dxmax) xmax=XX[d]+xerr endif endfor x=(xmax-xmin)/80 xmin-=x xmax+=x XX[0]=XX[1]-(xmax-xmin)/10 endif endfor Title="" for(i=i1; i=6) ii-=4; elseif(ii>=4) ii-=2; endif XWavName=InoutNames[ii]+XName wave XX=$XWavName for(k=k1; k1) WavErrX[0]=XX[nmin] endif WavErrX[1]=xmax if(nmax2) // if(adim=2) err2a[a]=sqrt(err2a[a] / (items[a]-1)); err2a[a]*=erra[a]; else err2a[a]=erra[a]; endif endfor ModifyGraph mode($WavName)=3 //AppendToGraph avrg vs ax appendToPlot(AppendRight,avrg,ax,xaxname,yaxname,nostr) ErrorBars $aname Y,wave=(erra,erra) ModifyGraph mode($aname)=4,marker($aname)=41,opaque($aname)=1,lsize($aname)=3; WAVE DetectorColorR=root:DetectorColorR WAVE DetectorColorG=root:DetectorColorG WAVE DetectorColorB=root:DetectorColorB ModifyGraph rgb($aname)=(DetectorColorR[d]/2,DetectorColorG[d]/2,DetectorColorB[d]/2); if(AppendRight<=2) for(a=1; a4) text="\JC\{\"%.2g\","+folder+aname+"["+num2str(a)+"]}" else text="\JC\{\"%.3g\","+folder+aname+"["+num2str(a)+"]}" text+="\r\F'Symbol's\F]0\Bstat\M=\{\"%.2g\","+folder+erraname+"["+num2str(a)+"] }\r\F'Symbol's\F]0\Bdev\M=\{\"%.2g\","+folder+err2aname+"["+num2str(a)+"] }" text+="\rN="+num2str(items[a]); endif TextBox /A=LB /Y=0 /X=(xoffs) /C/N=$nam /F=0/B=1 text; endfor endif endif //endif endif // Titel berechnen if(stringmatch(Title,"*\\s*")==1) Title+="\r" endif Title+="\\s(" + WavName + ") " if(InoutOwnPlot==0) Title+=InoutNames[i] endif if(CoeffOwnPlot==0) Title+=CoeffNames[k]+" " endif if(stringmatch(DetectorNames[d],"meanDet")) Title+="mean ("+DetectorNames[dCoeff1]+","+DetectorNames[dCoeff2]+")" elseif(stringmatch(DetectorNames[d],"dCoeff")) Title+="dCoeff ("+DetectorNames[dCoeff1]+""+DetectorNames[dCoeff2]+")" elseif(stringmatch(DetectorNames[d],"dSignal")) Title+="dSignal ("+DetectorNames[dSignal1] if(dSignalOp==0) Title+="" else Title+="+" endif Title+=DetectorNames[dSignal2]+")" else Title+=DetectorNames[d]+" beam" endif if(AppendRight==2) Title+=" \[0\F'Wingdings'\]0" endif endif endfor ModifyGraph nticks($xaxname)=10 ModifyGraph zero($yaxname)=1 ModifyGraph lowTrip($yaxname)=0.01 String axisname="CoeffAxis"; if(FitType==1) // gauss axisname+="1" else axisname+="0" endif if(i>=imaxsplit) axisname+="inout" endif wave /T axiswave=root:$axisname if(WaveExists(axiswave)) Label $yaxname axiswave[k] // if(AppendRight) // Label right axiswave[k] // else // Label left axiswave[k] // endif endif if(PlotVs==0) Label $xaxname "number of measurement" elseif(PlotVs==1) Label $xaxname "Time" elseif(PlotVs==2) Label $xaxname "sample angle []" else Label $xaxname XName endif endif endfor endif endfor SetAxis /A/N=1 $yaxname ModifyGraph standoff($yaxname)=0 if(AppendRight==2) AppendText /N=text1 " \[0\F'Wingdings'\]0\r"+Title // wird automatisch dazugefgt else ModifyGraph margin(top)=20,wbRGB=(221*256,221*256,221*256) SetAxis $xaxname xmin,xmax string textname="text"+nostr TextBox /C/N=$textname/A=MC/J Title if(PlotInfo) SVAR Info_Name=:ctrl:Info_Name textname="results"+nostr TextBox/A=RB/X=0/Y=101/C/N=$textname/F=0/B=1 "\\Z07" AppendText /N=$textname Info_Name endif stretchAxes(AppendRight) endif End Function LoopDetectorPlots(WndName,i1,i2,k1,k2) String WndName Variable i1,i2,k1,k2 Variable d,b WAVE DetectorDoDisp=:ctrl:DetectorDoDisp NVAR DetectorOwnPlot=:ctrl:DetectorOwnPlot WAVE/T DetectorNames=root:DetectorNames NVAR dmaxsplit=root:dmaxsplit b=sum(DetectorDoDisp,-inf,inf)==1 b+=DetectorOwnPlot if(b) for(d=0; d5) // Plot Originaldaten Variable xtyp=GetXName(xname,PlotVs2); rxname="Std_Phase1" GetXName(yname,PlotVs); wave /D wavey=$yname // ber alle Files, nicht in/out speziell String xn,yn,zn xn=InoutNames[i]+"XX" yn=InoutNames[i]+"YY" zn=InoutNames[i]+"Data"+DetectorNames[d] Variable points=0 Make /O/D/N=0 $xn,$yn,$zn wave /D xx=$xn, yy=$yn, zz=$zn Variable n0,nstep; GetInoutSteps(i, n0, nstep); dim=numpnts(File_Name) Variable xdim=0,xmin=inf,xmax=-inf; Variable ydim=0,ymin=inf,ymax=-inf; for(; n0ymax) ymax=y endif ydim+=1 if(xtyp==2) wave data=$"Fit_Data"+DetectorNames[d]+num2str(n0); len=numpnts(data); Redimension /N=(points+len) xx,yy,zz zz[points,points+len-1]=data[x-points] xx[points,points+len-1]=pnt2x(data,x-points) else wave data=$"Data"+DetectorNames[d]+num2str(n0); wave stdphase=$"Std_Phase"+num2str(n0); len=numpnts(data); Redimension /N=(points+len) xx,yy,zz zz[points,points+len-1]=data[x-points] xx[points,points+len-1]=stdphase[x-points] endif yy[points,points+len-1]=y xmin=xx[points]; xmax=xx[points+len-1]; xdim=len; points+=len; endfor ztitle=InoutNames[i]+DetectorNames[d]+" " if(xtyp==1) ztitle+="Detector Signal" else ztitle+="Detector Fit" endif MakeContourPlot(xn,yn,zn, xname,yname,ztitle, xdim,xmin,xmax, ydim,ymin,ymax) // KillWaves /Z xx,yy,zz else // Plot Fitergebnis GetXName(xname,PlotVs2); ReduceAxis(xname); // "Reduc_"+xname erstellen = $xname ohne doppelte Werte rxname="Reduc_"+xname GetXName(yname,PlotVs); ReduceAxis(yname); ryname="Reduc_"+yname for(k=0; k=imaxsplit) axisname+="inout" endif wave /T axiswave=root:$axisname ztitle="" if(WaveExists(axiswave)) ztitle=DetectorNames[d]+" "+axiswave[k] endif zname=InoutNames[i]+CoeffNames[k]+"_"+DetectorNames[d]; Wave rxx=$rxname Wave ryy=$ryname MakeContourPlot(xname,yname,zname, xname,yname,ztitle, numpnts(rxx)-1,rxx[1],rxx[numpnts(rxx)-1], numpnts(ryy)-1,ryy[1],ryy[numpnts(ryy)-1]) endif endfor endif endif endfor endif endfor End Function MakeContourPlot(xname,yname,WavName, xtitle,ytitle,ztitle, xdim,x1,x2, ydim,y1,y2) String xname,yname,WavName, xtitle,ytitle,ztitle Variable /D x1,x2,y1,y2; Variable xdim,ydim; // $xname,$yname,$WavName = waves containing the data triplets x,y,z // xtitle,ytitle,ztitle = Text displayed on the axes // xdim = number of points on x axis // x1,x2 = value of first and last point // ydim = " // y1,y2 = " NVAR PlotVs2=:ctrl:PlotVs2 NVAR PlotVs=:ctrl:PlotVs NVAR PlotInfo=:ctrl:PlotInfo SVAR ExpNo=:ctrl:ExpNo NVAR PlotContour=:ctrl:PlotContour NVAR PlotContourLabel=:ctrl:PlotContourLabel NVAR PlotImage=:ctrl:PlotImage NVAR PlotImageLabel=:ctrl:PlotImageLabel String str,title if(PlotImageLabel) if(ydim*xdim>200) PlotImageLabel=0 DoWindow /C Control CheckBox checkPlotImgLabel value=PlotImageLabel endif endif Wave xx=$xname Wave yy=$yname Wave zz=$WavName String matrixname="Matrix_"+WavName String plotname=ExpNo+WavName+xname+yname // requires a displayed contour data set Display /K=1 DoWindow /K $plotname // altes Fenster lschen DoWindow /C $plotname DoWindow /T $plotname,ExpNo+" "+matrixname AppendXYZContour zz vs {xx,yy}; //DelayUpdate Variable /D n,zmin=inf, zmax=-inf for(n=1; nzmax) zmax=ZZ[n] endif if(ZZ[n]=10) format=" \\{\"%.0f\"" endif Tag/N=$name/F=0/Z=1/B=1/I=1/X=0.00/Y=0.00/L=1 $matrixname, x,format+", TagWaveRef()["+num2str(pt)+"] }" endfor endfor endif endif ModifyGraph margin(top)=20,wbRGB=(221*256,221*256,221*256) if(strlen(ztitle)>0) TextBox /C/N=text0/A=LB/X=0/Y=100/J ztitle endif if(PlotInfo) SVAR Info_Name=:ctrl:Info_Name TextBox/A=RB/X=0/Y=101/C/N=results/F=0/B=1 "\\Z07" AppendText /N=results Info_Name endif Label left ytitle Label bottom xtitle End Function ButtonProc_DisplayVsVsVs2(ctrlName) : ButtonControl String ctrlName NVAR PlotVs=:ctrl:PlotVs NVAR PlotVs2=:ctrl:PlotVs2 NVAR PlotInfo=:ctrl:PlotInfo String XName=""; String YName=""; GetXName(XName,PlotVs2) GetXName(YName,PlotVs) wave yy=$YName; wave xx=$XName; Display/K=1 MakeWindowName(YName+"_vs_"+XName); AppendToGraph yy vs xx ModifyGraph mode=4, marker=8 ModifyGraph margin(top)=20,wbRGB=(221*256,221*256,221*256) if(PlotInfo) SVAR Info_Name=:ctrl:Info_Name TextBox/A=RB/X=0/Y=101/C/N=results/F=0/B=1 "\\Z07" AppendText /N=results Info_Name endif Label left YName Label bottom XName End Function FWriteLine(file,text) Variable file // fprintf kann nur kurze Strings speichern String text for(; strlen(text)>100; ) fprintf file,"%s",text[0,99] text=text[100,inf] endfor fprintf file,"%s\n",text End Function ButtonProc_SaveCoeff(ctrlName) : ButtonControl String ctrlName WAVE/T DetectorNames=root:DetectorNames WAVE DetectorDoDisp=:ctrl:DetectorDoDisp NVAR dmaxsplit=root:dmaxsplit WAVE/T InoutNames=root:InoutNames WAVE InoutDoDisp=:ctrl:InoutDoDisp NVAR imax=root:imax NVAR InoutType=:ctrl:InoutType WAVE/T CoeffNames=root:CoeffNames WAVE CoeffDoDisp=:ctrl:CoeffDoDisp NVAR kmax=root:kmax NVAR ListErr=:ctrl:ListErr Wave ParamDoList=:ctrl:ParamDoList ; Variable i, iimax, k,d String WavName,FileName iimax=imax if(InoutType==0) // kein In2 iimax-=1 endif for(i=0; i0) // file does exist fileexist=1 Close refnum endif // save List in temporary file print wavlist Save /P=datapath /W /O /J/B wavlist as "temp.txt" wave wav=$StringFromList(0,wavlist) Variable l,lines=numpnts(wav) Variable temp,final // copy temporary file line by line into final file Open /R /P=datapath temp as "temp.txt" Open /A /P=datapath final as FileName String text FReadLine temp, text if(fileexist==0) FWriteLine(final,text) // write first line (Wave Names) only if new file is created FReadLine temp, text // mean values FWriteLine(final,text) else FReadLine temp, text // skip mean values endif for(l=1; l anhngen // Close refnum // Save /M="\r\n" /O /A=2 /J/B wavlist as FileName // endif endif endif endfor End Function ButtonProc_LoadCoeff(ctrlName) : ButtonControl String ctrlName Variable i,refnum Open/R/D/P=datapath /M="Info oder Excel-Datei ffnen"/T=".XLS.INF" refnum String str=S_Filename if(strlen(str)!=0) LoadWave /A/W/O/K=0 /P=datapath /J str String wavlist=S_waveNames for(i=0; i==i; i+=1) str=StringFromList(i,wavlist) if(strlen(str)==0) break endif if(stringmatch(str,"*File_Name")) // WAVE /T txt=$str // InsertPoints 0, 1, txt // txt[0]="mean value" else WAVE wav=$str // InsertPoints 0, 1, wav // if(stringmatch(str,"Err_*")) // InsertPoints numpnts(wav),1,wav // endif Variable n=strsearch(str,"Timestamp",0) if(n>=0) SetScale d 0,0,"dat", wav if(n>0) str=str[0,n-1]+"Order" // In_/Out_/... + Order else str="Order" endif Variable nmax=numpnts(wav) Make /D/O/N=(nmax) $str WAVE ord=$str for(n=0; n in ParaSer=1 InoutType=0 // 3 = out --> in1 --> in2 ParaSer=1 InoutType=1 // 4 = in --> out ParaSer=1 InoutType=0 InFirst=1 // 5 = (reserved) // 6 = in --> out, .... in ParaSer=1 InoutType=0 InFirst=2 if(popNum==5) popNum=6 endif if(popNum!=2*ParaSer + InoutType + 2*InFirst) InoutType=popNum & 1 ParaSer=(popNum>=2) InFirst=0 if(popNum>=4) InFirst=(popNum-2)/2 endif if(DataLoaded()) UseCoeff() endif endif End Function CheckProc_ShowFitting(ctrlName,checked) : CheckBoxControl String ctrlName Variable checked NVAR ShowFitting=:ctrl:ShowFitting ShowFitting=checked End Function CheckProc_ErrBars(ctrlName,checked) : CheckBoxControl String ctrlName Variable checked NVAR ErrBars=:ctrl:ErrBars ErrBars=checked; End //Function CheckProc_1(ctrlName,checked) : CheckBoxControl // String ctrlName // Variable checked // NVAR AppendRight=:ctrl:AppendRight // AppendRight=checked //End //Function SetVarProc(ctrlName,varNum,varStr,varName) : SetVariableControl // String ctrlName // Variable varNum // String varStr // String varName // NVAR Parallel=:ctrl:Parallel // NVAR ParallelDeg=:ctrl:ParallelDeg // ParallelDeg=varNum // Parallel=ParallelDeg*Pi/180 //End Function CheckProc_MeanOutForIn(ctrlName,checked) : CheckBoxControl String ctrlName Variable checked NVAR MeanOutForIn=:ctrl:MeanOutForIn NVAR MeanInout=:ctrl:MeanInout MeanOutForIn=checked; if(MeanOutForIn) if(MeanInout) MeanInout=0; CheckBox checkMeanInout value=MeanInout endif endif End Function CheckProc_MeanInout(ctrlName,checked) : CheckBoxControl String ctrlName Variable checked NVAR MeanOutForIn=:ctrl:MeanOutForIn NVAR MeanInout=:ctrl:MeanInout MeanInout=checked if(MeanInout) if(MeanOutForIn) MeanOutForIn=0 CheckBox checkMeanOutForIn value=MeanOutForIn endif endif End Function CheckProc_MeanDetector(ctrlName,checked) : CheckBoxControl String ctrlName Variable checked NVAR MeanDetector=:ctrl:MeanDetector MeanDetector=checked End Function ButtonReFit(ctrlName) : ButtonControl String ctrlName WAVE/T File_Name=:File_Name WAVE/T DetectorNames=root:DetectorNames NVAR dmaxfit=root:dmaxfit if(DataLoaded()) // Fitten variable d,ii for(ii=1; ii/(O+H)",value= #"\"none;/(O+H) old;/Mon;1/(O+H);/(O+H)\"" CheckBox checkChi2,pos={257,332},size={35,14},proc=CheckProc_Chi2,title="chi" CheckBox checkChi2,value= 0 Button buttonAppendRight,pos={10,358},size={40,20},proc=ButtonProc_AppendRight,title="Add" SetVariable setvarParallelDeg,pos={294,78},size={90,16},title="parallel=" SetVariable setvarParallelDeg,format="%g" SetVariable setvarParallelDeg,limits={-Inf,Inf,0.1},value= root:ctrl:ParallelDeg CheckBox checkMeanOutForIn,pos={226,143},size={82,14},proc=CheckProc_MeanOutForIn,title="use Out for In" CheckBox checkMeanOutForIn,value= 0 CheckBox checkMeanInout,pos={226,156},size={124,14},proc=CheckProc_MeanInout,title="use in/out mean value" CheckBox checkMeanInout,value= 0 CheckBox checkMeanDetector,pos={226,169},size={135,14},proc=CheckProc_MeanDetector,title="use detector mean value" CheckBox checkMeanDetector,value= 0 Button buttonReFit,pos={104,210},size={51,20},proc=ButtonReFit,title="Re-Fit All" CheckBox checkKeepFitPlot,pos={9,244},size={86,14},proc=CheckProc_KeepFitPlot,title="keep windows" CheckBox checkKeepFitPlot,value= 0 CheckBox checkFitdDet,pos={9,154},size={76,14},proc=CheckProc_FitdDet,title="fit dSignal = " CheckBox checkFitdDet,value= 0 PopupMenu popupSignal1,pos={87,147},size={45,21},proc=PopMenuProc_dSignal1 PopupMenu popupSignal1,mode=2,popvalue="H",value= #"\"O;H;3rd;4th\"" PopupMenu popupSignal2,pos={87,167},size={45,21},proc=PopMenuProc_dSignal2 PopupMenu popupSignal2,mode=1,popvalue="O",value= #"\"O;H;3rd;4th\"" CheckBox checkdCoeff,pos={328,345},size={49,14},proc=CheckProc_dCoeff,title="dCoeff" CheckBox checkdCoeff,value= 0 PopupMenu popupExperiment,pos={2,6},size={124,21},proc=PopMenuProc_Experiment,title="Experiment:" PopupMenu popupExperiment,mode=1,popvalue="root",value= #"root:ExpList" Button buttonDuplExp,pos={309,6},size={40,20},proc=ButtonProc_DuplExp Button buttonKillExp,pos={349,6},size={40,20},proc=ButtonProc_KillExp,title="Kill" Button buttonReloadInfo,pos={86,55},size={76,20},proc=ButtonProcReloadInfo,title="Re-Load Info" CheckBox checkInvertPhd,pos={226,104},size={44,14},proc=CheckProc_InvertPhd,title="invert" CheckBox checkInvertPhd,value= 0 PopupMenu popupPlotVs,pos={46,336},size={88,21},proc=PopMenuProc_Vs,title="vs" PopupMenu popupPlotVs,mode=1,popvalue="Order",value= #"\"Order;Time;Param;Xvalue;Yvalue;Zvalue\"" Button buttonPlotFileApp,pos={168,210},size={40,20},proc=ButtonProcAppFile,title="Add" Button button_SaveCoeff,pos={64,316},size={54,20},proc=ButtonProc_SaveCoeff,title="Save" Button button_LoadCoeff,pos={118,316},size={54,20},proc=ButtonProc_LoadCoeff,title="Load" CheckBox checkMeanDet,pos={328,358},size={62,14},proc=CheckProc_meanDet,title="MeanDet" CheckBox checkMeanDet,value= 0 PopupMenu popupMeanDet1,pos={59,288},size={45,21},proc=PopMenuProc_meanDet1 PopupMenu popupMeanDet1,mode=2,popvalue="H",value= #"\"O;H;3rd;4th;dSig;dCo\"" PopupMenu popupMeanDet2,pos={128,288},size={45,21},proc=PopMenuProc_meanDet2 PopupMenu popupMeanDet2,mode=1,popvalue="O",value= #"\"O;H;3rd;4th;dSig;dCo\"" Button button_LoadFitOne,pos={34,190},size={76,20},proc=ButtonProc_LoadData,title="Load && Fit File:" Button button_ClearOneFile,pos={295,190},size={52,20},proc=ButtonProc_ClearFile,title="Clear File:" CheckBox checkErrBars,pos={167,244},size={90,14},proc=CheckProc_ErrBars,title="show error bars" CheckBox checkErrBars,value= 1 SetVariable setvarBragg,pos={294,94},size={90,16},title="Bragg=",format="%g" SetVariable setvarBragg,value= root:ctrl:BraggDeg SetVariable setvarThick,pos={294,110},size={90,16},title="thick=",format="%gmm" SetVariable setvarThick,value= root:ctrl:Thick Button buttonReloadFile,pos={10,190},size={24,20},proc=ButtonProcReloadFile,title="Re-" CheckBox checkListParam,pos={131,391},size={48,14},proc=CheckProc_ListParam,title="Param" CheckBox checkListParam,value= 0 CheckBox checkListX,pos={96,404},size={25,14},proc=CheckProc_ListX,title="X" CheckBox checkListX,value= 0 CheckBox checkListY,pos={125,404},size={25,14},proc=CheckProc_ListY,title="Y" CheckBox checkListY,value= 0 CheckBox checkListZ,pos={154,404},size={25,14},proc=CheckProc_ListZ,title="Z" CheckBox checkListZ,value= 0 PopupMenu popupPlotVs2,pos={129,436},size={101,21},proc=PopMenuProc_Vs2,title="vs2" PopupMenu popupPlotVs2,mode=5,popvalue="Yvalue",value= #"\"Order;Time;Param;Xvalue;Yvalue;Zvalue;Signal Axis;Fit Axis\"" Button buttonSurfacePlot,pos={247,434},size={44,25},proc=ButtonProc_ContourPlot,title="2D-Plot" CheckBox checkPlotCont,pos={291,433},size={55,14},proc=CheckProc_PlotCont,title="Contour" CheckBox checkPlotCont,value= 0 CheckBox checkPlotImg,pos={291,446},size={47,14},proc=CheckProc_PlotImg,title="Image" CheckBox checkPlotImg,value= 0 CheckBox checkPlotContLabel,pos={349,433},size={44,14},proc=CheckProc_PlotContLabel,title="Label" CheckBox checkPlotContLabel,value= 0 CheckBox checkPlotImgLabel,pos={349,446},size={44,14},proc=CheckProc_PlotImgLabel,title="Label" CheckBox checkPlotImgLabel,value= 0 Button buttonPathForAll,pos={352,36},size={37,15},proc=ButtonProcPathForAll,title="for all" SetVariable setvarMeanNr1,pos={10,418},size={42,16},proc=SetVarProcMeanNr,title=" " SetVariable setvarMeanNr1,value= root:ctrl:MeanNr1 SetVariable setvarMeanNr2,pos={52,418},size={42,16},proc=SetVarProcMeanNr,title=" " SetVariable setvarMeanNr2,value= root:ctrl:MeanNr2 PopupMenu popupSignalOp,pos={44,167},size={43,21},proc=PopMenuProc_dSignalOp PopupMenu popupSignalOp,mode=2,popvalue="+",value= #"\";+\"" CheckBox checkIn1In2,pos={189,358},size={43,14},proc=CheckProc_In1In2,title="in-in2" CheckBox checkIn1In2,value= 0 PopupMenu popupAppMode,pos={50,357},size={84,21},proc=PopMenuProc_AppMode PopupMenu popupAppMode,mode=3,popvalue="2nd y axis",value= #"\"same axes;y on right;2nd y axis;2nd y, new x;3rd y axis;3rd y, new x\"" PopupMenu popupAppFileMode,pos={208,209},size={81,21},proc=PopMenuProc_FileAppMode PopupMenu popupAppFileMode,mode=5,popvalue="3rd y axis",value= #"\"same axes;y on right;2nd y axis;2nd y, new x;3rd y axis;3rd y, new x\"" Button button_temp,pos={168,174},size={30,16},proc=ButtonProc,title="temp" Button button_temp2,pos={142,356},size={30,16},proc=ButtonProc_1,title="temp" EndMacro //********************************************************************************************************** //********************************************************************************************************** //*********************************** ENDE ********************************************* //********************************************************************************************************** //********************************************************************************************************** //********************************************************************************************************** //********************************************************************************************************** Window Table2() : Table PauseUpdate; Silent 1 // building window... String fldrSav= GetDataFolder(1) SetDataFolder root:Experiment1: Edit/W=(5.25,41.75,510,564.5) Phase_Shifter,O_beam,H_beam,O_H_beam,Mon,X_Time as "Data Sheet 4" SetDataFolder fldrSav EndMacro Macro Reduce_Temp_Timesteps() // macro shows up in the Macros-Window Func_Reduce_Temp_Timesteps() End Function Func_Reduce_Temp_Timesteps() wave temptime=:temptime wave tempcelsius=:tempcelsius wave temptime2=:temptime2 wave tempcelsius2=:tempcelsius2 Duplicate /O temptime,temptime2 Duplicate /O tempcelsius,tempcelsius2 Variable /D celsum,celitems,i,i2 Variable /D t,tim=temptime[0] tim=tim-mod(tim,900) // 15 min celsum=0; celitems=0; i2=0; for(i=0; i= tim+900) if(celsum!=0) temptime2[i2]=tim tempcelsius2[i2]=celsum/celitems i2+=1; tim+=900 endif celsum=0; celitems=0; endif celsum+=tempcelsius[i] celitems+=1 endfor Redimension /N=(i2) tempcelsius2,temptime2 End Macro Load_Temperature() Variable refnum Open/R/D/P=datapath /M="Load Temperature File"/T=".XLS.INF" refnum String str=S_Filename if(strlen(str)!=0) LoadWave /L={0,0,0,0,2} /N=data/O/K=0 /P=datapath /J str Duplicate /O data0,temptime Duplicate /O data1,tempcelsius endif End Function make_ctrl_var(varname,points) // make new control variable in all experiments String varname // points=0: make variable Variable points // points>0: make wave String name,oldfolder oldfolder=GetDataFolder(1) SetDataFolder "root:ctrl" Execute("Variable /G "+varname) Variable ex for(ex=1; ex<100; ex+=1) name="root:Experiment"+num2str(ex)+":ctrl" if(DataFolderExists(name)) SetDataFolder name if(points==0) Execute("Variable /G "+varname) elseif(points>0) Make /D/O/N=(points) $varname elseif(points<0) Make /T/O/N=(points) $varname endif endif endfor SetDataFolder oldfolder End Function kill_ctrl_var(varname) // kill a control variable in all experiments String varname String name,oldfolder oldfolder=GetDataFolder(1) SetDataFolder "root:ctrl" KillVariables /Z $varname Variable ex for(ex=1; ex<100; ex+=1) name="root:Experiment"+num2str(ex)+":ctrl" if(DataFolderExists(name)) SetDataFolder name KillVariables /Z $varname KillWaves /Z $varname endif endfor SetDataFolder oldfolder End Function fitfixphase(scannr,fixnr,destnr,ph0) Variable scannr, fixnr, destnr,ph0 // file scannr: complete contrast scan // file fixnr: O,H intensity without phase shifter movement // file destnr: where the phase will be saved WAVE/T File_name=:File_name Variable dim=numpnts(File_Name) if(destnr>=dim) destnr=dim SetNumberOfFiles(dim+1) endif WAVE/T CoeffNames=root:CoeffNames WAVE/T DetectorNames=root:DetectorNames WAVE/D TimePt=:TimePt Make /O/D/N=3 coef Variable d,k,i String str; for(d=0; d<2; d+=1) // take coeff A, B, C from contrast scan for(k=0; k<3; k+=1) str=CoeffNames[k]+"_"+DetectorNames[d] wave cw=$str coef[k]=cw[scannr] endfor str="Data"+DetectorNames[d]+num2str(fixnr) wave det=$str wave errdet=$"Err_"+str wave xx=$"Std_Phase"+num2str(fixnr) str="Data"+DetectorNames[d]+num2str(destnr) dim=numpnts(det) MakeDim(str,dim); wave ph=$str MakeDim("Err_"+str,dim); wave errph=$"Err_"+str Duplicate /O xx, $"Std_Phase"+num2str(destnr) Variable timestretch=TimePt[scannr]/TimePt[fixnr] ph=asin((det*timestretch-coef[0])/coef[1])*180/Pi - coef[2]*ph0 errph=0; endfor End Function CheckProc_ListParam(ctrlName,checked) : CheckBoxControl String ctrlName Variable checked Wave ParamDoList=:ctrl:ParamDoList ParamDoList[0]=checked End Function MakeAngleRuler(wav,inst) Variable wav,inst if(wav + inst == 0) print "Syntax: MakeAngleRuler(wav,inst)" print " wav: 1=1.9A, 2=2.7A" print " inst: 1=ILL, 2=NIST" else if(!exists(":totref19x")) Make /O/N=1 totref19x,totref19y,totref19dx totref19x[0]=0 totref19y[0]=4 totref19dx[0]=0.088; endif if(!exists(":totref27x")) Make /O/N=1 totref27x,totref27y,totref27dx totref27x[0]=0 totref27y[0]=4 totref27dx[0]=0.126; endif if(!exists(":diag1x")) Make /O/N=1 diag1x,diag1y,diag1dx diag1x[0]=0 diag1y[0]=10 diag1dx[0]=atan(17/10000)*180/Pi; endif if(!exists(":diag2x")) Make /O/N=1 diag2x,diag2y,diag2dx diag2x[0]=0 diag2y[0]=10 diag2dx[0]=atan(18/20000)*180/Pi; endif String title="" String totref,diag if(inst==2) diag="diag2" else diag="diag1" endif RemoveFromGraph $(diag+"y") AppendToGraph $(diag+"y") vs $(diag+"x") ModifyGraph mode($(diag+"y"))=3,marker($(diag+"y"))=17,rgb($(diag+"y"))=(0,0,0);DelayUpdate ErrorBars $(diag+"y") X,wave=($(diag+"dx"),$(diag+"dx")) title+="\\s("+diag+"y)= channel diagonal\r" if(wav==2) totref="totref27" else totref="totref19" endif RemoveFromGraph $(totref+"y") AppendToGraph $(totref+"y") vs $(totref+"x") ModifyGraph mode($(totref+"y"))=3,marker($(totref+"y"))=2;DelayUpdate ErrorBars totref27y X,wave=($(totref+"dx"),$(totref+"dx")) title+="\\s("+totref+"y)= total reflection\r" TextBox/C/N=texttotref/B=1/F=0/A=MC title Edit /K=1 totref19x,totref19y,totref19dx,totref27x,totref27y,totref27dx,diag1x,diag1y,diag1dx,diag2x,diag2y,diag2dx Execute("ModifyTable width=50") DoWindow /K ctrl_totref // altes Fenster lschen DoWindow /C/T ctrl_totref,"Total Reflaction" // neues Fenster umbenennen und Titel setzen endif End Function gaussparabel(w,x) : FitFunc Wave w Variable x //CurveFitDialog/ These comments were created by the Curve Fitting dialog. Altering them will //CurveFitDialog/ make the function less convenient to work with in the Curve Fitting dialog. //CurveFitDialog/ Equation: //CurveFitDialog/ f(x) = offs+ampl*exp(-(x-x0)^2 / (2 * sig^2))+p*(x-x0)^2 //CurveFitDialog/ End of Equation //CurveFitDialog/ Independent Variables 1 //CurveFitDialog/ x //CurveFitDialog/ Coefficients 5 //CurveFitDialog/ w[0] = offs //CurveFitDialog/ w[1] = ampl //CurveFitDialog/ w[2] = x0 //CurveFitDialog/ w[3] = sig //CurveFitDialog/ w[4] = p return w[0]+w[1]*exp(-(x-w[2])^2 / (2 * w[3]^2))+w[4]*(x-w[2])^2 End Function gausscosh(w,x) : FitFunc Wave w Variable x //CurveFitDialog/ These comments were created by the Curve Fitting dialog. Altering them will //CurveFitDialog/ make the function less convenient to work with in the Curve Fitting dialog. //CurveFitDialog/ Equation: //CurveFitDialog/ f(x) = offs + ampl*exp( -(x-x0)^2 / (2 * sig^2)) + p*cosh((x-x0)) //CurveFitDialog/ End of Equation //CurveFitDialog/ Independent Variables 1 //CurveFitDialog/ x //CurveFitDialog/ Coefficients 5 //CurveFitDialog/ w[0] = offs //CurveFitDialog/ w[1] = ampl //CurveFitDialog/ w[2] = x0 //CurveFitDialog/ w[3] = sig //CurveFitDialog/ w[4] = p return w[0] + w[1]*exp( -(x-w[2])^2 / (2 * w[3]^2)) + w[4]*cosh((x-w[2])) End Window Exp1_Plot_Contr_dSignal_vs_Time() : Graph PauseUpdate; Silent 1 // building window... String fldrSav= GetDataFolder(1) SetDataFolder root:Experiment1: Display /W=(545.25,231.5,939.75,440)/K=1 In1_Contr_dSignal vs In1_Timestamp as "Exp1 Plot_Contr_dSignal " AppendToGraph In2_Contr_dSignal vs In2_Timestamp SetDataFolder fldrSav ModifyGraph margin(top)=20,wbRGB=(56576,56576,56576) ModifyGraph mode=3 ModifyGraph marker(In1_Contr_dSignal)=16,marker(In2_Contr_dSignal)=12 ModifyGraph rgb=(65280,32512,16384) ModifyGraph opaque=1 ModifyGraph zero(left)=1 ModifyGraph nticks(bottom)=10 ModifyGraph lowTrip(left)=0.01 ModifyGraph prescaleExp(left)=2 ModifyGraph dateInfo(bottom)={0,0,0} Label left "contrast [%]" Label bottom "Time" SetAxis/A/N=1 left SetAxis bottom 3194987119,3195461954.1625 ErrorBars In1_Contr_dSignal XY,wave=(:Experiment1:In1_Duration,:Experiment1:In1_Duration),wave=(:Experiment1:Err_In1_Contr_dSignal,:Experiment1:Err_In1_Contr_dSignal) ErrorBars In2_Contr_dSignal XY,wave=(:Experiment1:In2_Duration,:Experiment1:In2_Duration),wave=(:Experiment1:Err_In2_Contr_dSignal,:Experiment1:Err_In2_Contr_dSignal) TextBox/N=text0/A=MC/X=-25.99/Y=49.17 "\\s(In1_Contr_dSignal) Contrast Path 2\r\\s(In2_Contr_dSignal) Contrast Path 1" TextBox/N=results/F=0/B=1/A=RB/X=0.00/Y=101.00 "\\Z07\rE:lemmel:S18_140_2005mar:serie2pos_all.inf" TextBox/N=text1/F=0/A=MC/X=-45.94/Y=-28.73 "c" TextBox/N=text2/F=0/A=MC/X=-29.47/Y=-6.08 "a" TextBox/N=text3/F=0/A=MC/X=-12.99/Y=-46.96 "d" TextBox/N=text4/F=0/A=MC/X=6.03/Y=-27.62 "b" TextBox/N=text5/F=0/A=MC/X=21.81/Y=-40.88 "e" TextBox/N=text6/F=0/A=MC/X=44.08/Y=-3.87 "f" EndMacro