source: trunk/User Procedures/Indra 2/IN3_Main.ipf @ 1171

Last change on this file since 1171 was 1171, checked in by ilavsky, 9 months ago

Add Search for optimal solution to 3D aggregates

  • Property svn:executable set to *
File size: 80.9 KB
Line 
1#pragma TextEncoding = "UTF-8"
2#pragma rtGlobals=3                     // Use modern global access method.
3#pragma version = 1.99
4#pragma IgorVersion=7.05
5
6//DO NOT renumber Main files every time, these are main release numbers...
7
8//*************************************************************************\
9//* Copyright (c) 2005 - 2021, Argonne National Laboratory
10//* This file is distributed subject to a Software License Agreement found
11//* in the file LICENSE that is included with this distribution.
12//*************************************************************************/
13
14//1.99 added ability to load jpg image if user wants to see data collection image (and it exists...).
15//1.98  September2020 release.
16//1.97 February 2020, fix GUI for step scanning
17        //1.97 add controls if to remove vibrations or not, seems sometimes is not vibrations which causes less points to be recorded...
18        //1.97 add is2DCollimated and fix sbFLyscan handling. few more fixes.
19//1.96 added use of FWHM from sample to GUI. Added ability to overwrite Flyscan amplifier dead times.
20//1.95 Added button to open Read me.
21//1.94 Added smooth R data option.
22//1.93 added Desmaering as optional data reduction step.
23//1.92  removed unused functions
24//1.91 #pragma IgorVersion=7.00
25//1.90 added OverRideSampleTransmission, added live processing and added graph with saved subtracted data.
26//              fixes to annoying behaviors (needless user questions), reorganized menu
27//              enable negative override for Bkg5
28//      Added first version of Import & Process panel. For now cannot handel step scanning.
29//1.89 fixes for 2016-02
30//1.88 panel scaling. 
31//1.87 removed Wavename string from selection tool. Unnecessary and confusing users.
32//1.87 remove dropout option
33//1.86 added save to Load & Process button, renamed
34//1.85 Flyscan improvements for 9ID March 2015
35//1.84 updated Flyscan for August 2014 and added overwrite for UPD range 5 dark current
36//1.83 updated Flyscan support for April 2014 version, minor improvements
37//1.82 FlyScan support, preliminary version
38//1.81 adds panel check for version and FlyScan data reduction, added check version control on Main panel and Fly Import panel.
39//1.80 Added few more items on Tab0
40//1.79 4/2013 JIL, added pin diode transmission
41//1.78, 2/2013, JIL: Added option to calibrate by weight. Needed for USAXS users.
42
43Constant IN3_ReduceDataMainVersionNumber=2.01           //these two needs to be the same!
44Constant IN3_NewReduceDataMainVersionNum=2.01           //these two needs to be the same!
45constant SmoothBlankForUSAXS = 1
46Constant Indra_PDIntBackFixScaleVmin=1.1
47Constant Indra_PDIntBackFixScaleVmax=0.3e-10
48constant        RwaveSmooth1time = 0.01
49constant        RwaveSmooth2time = 0.01
50constant        RwaveSmooth3time = 0.03
51constant        RwaveSmooth4time = 0.3
52constant        RwaveSmooth5time = 0.6
53constant CalMaxRatioUseSamFWHM = 1.12
54
55//************************************************************************************************************
56//************************************************************************************************************
57//************************************************************************************************************
58//************************************************************************************************************
59//****************************************************************************************
60 
61
62Function IN3_Main()
63
64        string OldDf=GetDataFolder(1)
65
66        IN3_Initialize()
67        KillWIndow/Z RcurvePlotGraph
68        KillWIndow/Z USAXSDataReduction
69        IN3_MainPanel()
70        ING2_AddScrollControl()
71        IN3_UpdatePanelVersionNumber("USAXSDataReduction", IN3_ReduceDataMainVersionNumber)
72        setDataFolder OldDf
73end
74
75
76//************************************************************************************************************
77//************************************************************************************************************
78
79Function IN3_NewMain()
80
81        string OldDf=GetDataFolder(1)
82        IN2G_CheckScreenSize("height",790)
83        IN3_Initialize()
84        IN3_FlyScanInitializeImport()
85        KillWIndow/Z RcurvePlotGraph
86        KillWIndow/Z USAXSDataReduction
87        IN3_MainPanelNew()
88        ING2_AddScrollControl()
89        IN3_UpdatePanelVersionNumber("USAXSDataReduction", IN3_NewReduceDataMainVersionNum)
90        setDataFolder OldDf
91
92end
93
94
95//************************************************************************************************************
96//************************************************************************************************************
97Function IN3_DoubleClickFUnction()
98
99        STRUCT WMButtonAction B_Struct
100        B_Struct.ctrlName="ProcessData2"
101        B_Struct.eventcode=2
102        B_Struct.win="USAXSDataReduction"
103        IN3_InputPanelButtonProc(B_Struct)
104       
105end
106
107
108//************************************************************************************************************
109//************************************************************************************************************
110
111Function IN3_MainPanelNew()
112
113        string oldDf=GetDataFolder(1)
114        setDataFolder root:Packages:Indra3
115
116        PauseUpdate             // building window...
117        NewPanel /K=1 /W=(22.25,43.25,445,860) as "USAXS data reduction"
118        DoWindow/C USAXSDataReduction
119        TitleBox Title title="\Zr170USAXS data reduction",pos={5,3},frame=0,fstyle=3,size={300,24},fColor=(1,4,52428), anchor=MC
120        TitleBox Info1 title="\Zr100To limit range of data being used for subtraction, set cursor A",pos={10,708},frame=0,fstyle=1,anchor=MC, size={380,20},fColor=(1,4,52428)
121        TitleBox Info2 title="\Zr100 on first point and B on last point of either sample of blank data",pos={10,723},frame=0,fstyle=1, anchor=MC,size={380,20},fColor=(1,4,52428)
122        //some local controls
123
124        IR3C_AddDataControls("USAXSHDFPath", "USAXS_FlyScanImport", "USAXSDataReduction","h5", "","Sort _XYZ","IN3_DoubleClickFUnction")
125        Button SelectDataPath, pos={85,28},size={160,15}
126        SetVariable DataPathString, pos={6,48},size={410,18}
127        SetVariable NameMatchString, pos={6,69}
128        SetVariable DataExtensionString, pos={255,69}
129        Button SelectAll, pos={10,91}
130        Button DeSelectAll, pos={150,91}
131        PopupMenu SortOptionString, pos={285,91}
132        TitleBox Info1PanelProc, pos={10,108}
133        ListBox ListOfAvailableData,pos={3,123}, size={252,148}
134
135        Button GetHelp,pos={315,10},size={80,15},fColor=(65535,32768,32768), proc=IN3_InputPanelButtonProc,title="Get Help", help={"Open www manual page for this tool"}
136        Button GetReadme,pos={315,27},size={80,15}, proc=IN3_InputPanelButtonProc,title="Read me", help={"Open Read me short instructions"}
137               
138        CheckBox IsBlank,pos={265,113},size={90,14},proc=IN3_MainPanelCheckBox,title="Process as blank"
139        CheckBox IsBlank,variable= root:Packages:Indra3:IsBlank, help={"Check, if you want to process this run as blank"}
140        CheckBox SmoothRCurveData,pos={360,113},size={90,14},proc=IN3_MainPanelCheckBox,title="Smooth"
141        CheckBox SmoothRCurveData,variable= root:Packages:Indra3:SmoothRCurveData, help={"Check, if you want to smooth these data"}
142
143        Button ProcessData2,pos={265,130},size={130,20},proc=IN3_InputPanelButtonProc,title="Load/process one", help={"Load data and process them"}
144        Button SelectNextSampleAndProcess2,pos={265,152},size={130,20},proc=IN3_InputPanelButtonProc,title="Load/Process Many", help={"Select next sample in order - process - and save"}
145        Button SaveResults,pos={265,174},size={130,20},proc=IN3_InputPanelButtonProc,title="Save Data", help={"Save results into original folder"}
146        Button LiveProcessing,pos={265,196},size={130,16},proc=IN3_InputPanelButtonProc,title="Live processing", help={"Switch on and off live data visualization and processing"}
147
148        NVAR UserSavedData=root:Packages:Indra3:UserSavedData
149        if(!UserSavedData)
150                Button SaveResults fColor=(65280,0,0)
151                TitleBox SavedData pos={261,217}, title="  Data   NOT   saved  ", fColor=(0,0,0), frame=1,labelBack=(65280,0,0), fixedSize=1,size={160,18}
152        else
153                Button SaveResults
154                TitleBox SavedData pos={261,217}, title="  Data   are   saved  ", fColor=(0,0,0),labelBack=(47872,47872,47872),  frame=2,fixedSize=1,size={160,18}
155        endif
156        TitleBox RemoveFromNameTbx pos={260,240}, title="Remove from name (str):",size={150,15}
157        SetVariable RemoveFromNameString,pos={260,260},size={157,15},noproc,title=" "
158        SetVariable RemoveFromNameString,help={"String which will be removed from data name"}
159        SetVariable RemoveFromNameString,value= root:Packages:USAXS_FlyScanImport:RemoveFromNameString
160
161        SetVariable userFriendlySamplename title="Sample name:",pos={10,274},size={380,20},noedit=1, labelBack=0
162        SetVariable userFriendlySamplename variable=root:Packages:Indra3:userFriendlySamplename,format="",limits={-1,1,1}
163        SetVariable userFriendlySamplename frame=0,fstyle=1,help={"Name of current data set loaded"}
164
165        SetVariable OriginalDataFolder title="Folder name:",pos={10,292},size={380,20},noedit=1, labelBack=0
166        SetVariable OriginalDataFolder variable=root:Packages:Indra3:userFriendlySampleDFName,format="",limits={-1,1,1}
167        SetVariable OriginalDataFolder frame=0,fstyle=1,help={"Folder from which current data set was loaded"}
168
169        //more local controls.
170        SVAR BlankName = root:Packages:Indra3:BlankName
171        NVAR IsBlank=root:Packages:Indra3:IsBlank
172        NVAR SmoothRCurveData = root:Packages:Indra3:SmoothRCurveData
173        string temppopStr
174        if(strlen(BlankName)>3)
175                temppopStr = BlankName
176        else
177                temppopStr = "---"
178                IsBlank = 1
179                SmoothRCurveData = 1
180        endif
181        PopupMenu SelectBlankFolder,pos={15,315},size={330,21},proc=IN3_InputPopMenuProc,title="Blank folder", help={"Select folder with Blank data"}
182        PopupMenu SelectBlankFolder,mode=1,popvalue=temppopStr,value= #"\"---;\"+IN3_GenStringOfFolders(1)",fColor=(1,16019,65535)
183        PopupMenu SelectBlankFolder, disable = IsBlank
184        TitleBox SelectBlankFolderWarning title="\Zr120 Blank auto selected!!",pos={290,292},frame=0,fstyle=1, anchor=MC,size={120,20},fColor=(65535,0,0), disable=1
185        CheckBox SmartSelectBlank,pos={290,315},size={90,14},noproc,title="Smart select Blank?"
186        CheckBox SmartSelectBlank,variable= root:Packages:Indra3:SmartSelectBlank, help={"Check, if you want to try to select Blank smartly (using order numbers)"}
187
188
189        //Data Tabs definition
190        TabControl DataTabs,pos={4,340},size={410,320},proc=NI3_TabPanelControl
191        TabControl DataTabs,tabLabel(0)="Sample",tabLabel(1)="Diode"
192        TabControl DataTabs,tabLabel(2)="Geometry",tabLabel(3)="Calibration",tabLabel(4)="MSAXS",tabLabel(5)="Desmear", value= 0
193        //tab 0 Sample controls
194        NVAR CalculateWeight=root:Packages:Indra3:CalculateWeight
195        NVAR CalculateThickness=root:Packages:Indra3:CalculateThickness
196        NVAR CalibrateToWeight=root:Packages:Indra3:CalibrateToWeight
197        NVAR CalibrateToVolume=root:Packages:Indra3:CalibrateToVolume
198        NVAR CalibrateArbitrary=root:Packages:Indra3:CalibrateArbitrary
199
200        CheckBox CalibrateArbitrary,pos={20,365},size={90,14},proc=IN3_MainPanelCheckBox,title="Calibrate Arbitrary"
201        CheckBox CalibrateArbitrary,variable= root:Packages:Indra3:CalibrateArbitrary, help={"Check, if you not want to calibrate data"}
202        CheckBox CalibrateToVolume,pos={20,380},size={90,14},proc=IN3_MainPanelCheckBox,title="Calibrate [cm2/cm3]"
203        CheckBox CalibrateToVolume,variable= root:Packages:Indra3:CalibrateToVolume, help={"Check, if you want to calibrate data to sample volume"}
204        CheckBox CalibrateToWeight,pos={20,395},size={90,14},proc=IN3_MainPanelCheckBox,title="Calibrate [cm2/g]"
205        CheckBox CalibrateToWeight,variable= root:Packages:Indra3:CalibrateToWeight, help={"Check, if you want to calibrate data to sample weight"}
206
207        CheckBox CalculateThickness,pos={230,370},size={90,14},proc=IN3_MainPanelCheckBox,title="Calculate Thickness"
208        CheckBox CalculateThickness,variable= root:Packages:Indra3:CalculateThickness, help={"Check, if you want to calculate sample thickness from transmission"}
209
210        CheckBox CalculateWeight,pos={230,392},size={90,14},proc=IN3_MainPanelCheckBox,title="Calculate Weight", disable=CalibrateToVolume
211        CheckBox CalculateWeight,variable= root:Packages:Indra3:CalculateWeight, help={"Check, if you want to calculate sample weight from transmission"}
212
213        SetVariable SampleThickness,pos={20,425},size={300,22},title="\Zr120Sample Thickness [mm] =", bodyWidth= 80
214        SetVariable SampleThickness ,proc=IN3_ParametersChanged
215        SetVariable SampleThickness,limits={0,Inf,0},variable= root:Packages:Indra3:SampleThickness, noedit=(CalculateThickness||CalculateWeight)//, frame=!(CalculateThickness&&CalculateWeight)
216
217        SetVariable OverideSampleThickness,pos={20,450},size={300,22},title="\Zr120Overide Sample Thickness [mm] =", bodyWidth= 80
218        SetVariable OverideSampleThickness ,proc=IN3_ParametersChanged
219        SetVariable OverideSampleThickness,limits={0,Inf,0},variable= root:Packages:Indra3:OverideSampleThickness, noedit=(CalculateThickness||CalculateWeight)//, frame=!(CalculateThickness&&CalculateWeight)
220
221
222        Button RecoverDefault,pos={330,423},size={80,20} ,proc=IN3_InputPanelButtonProc,title="Spec value", help={"Reload original value from spec record"}
223
224        SetVariable SampleTransmission,pos={20,485},size={300,22},title="\Zr120Sample Transmission ="
225        SetVariable SampleTransmission ,bodyWidth=100, proc=IN3_ParametersChanged
226        SetVariable SampleTransmission,limits={0,Inf,0},variable= root:Packages:Indra3:SampleTransmission, noedit=0, frame=0
227
228        SetVariable SampleLinAbsorption,pos={20,508},size={300,22},title="\Zr120Sample absorp. coef [1/cm] ="
229        SetVariable SampleLinAbsorption ,proc=IN3_ParametersChanged, bodyWidth=100
230        SetVariable SampleLinAbsorption,limits={0,Inf,0},variable= root:Packages:Indra3:SampleLinAbsorption, noedit=!CalculateThickness, frame=CalculateThickness
231
232        SetVariable SampleDensity,pos={20,528},size={300,22},title="\Zr120Sample density [g/cm3] ="
233        SetVariable SampleDensity ,proc=IN3_ParametersChanged, bodyWidth=100
234        SetVariable SampleDensity,limits={0,Inf,0},variable= root:Packages:Indra3:SampleDensity, noedit=!CalculateWeight, frame=CalculateWeight
235
236        SetVariable SampleWeightInBeam,pos={20,550},size={300,22},title="\Zr120Sample weight [g/cm2 bm area] ="
237        SetVariable SampleWeightInBeam ,proc=IN3_ParametersChanged, bodyWidth=100
238        SetVariable SampleWeightInBeam,limits={0,Inf,0},variable= root:Packages:Indra3:SampleWeightInBeam, noedit=CalculateWeight, frame=!CalculateWeight
239
240        SetVariable SampleFilledFraction,pos={20,550},size={300,22},title="\Zr120Sample filled fraction =", help={"amount of sample filled by material, 1 - porosity as fraction"}
241        SetVariable SampleFilledFraction ,proc=IN3_ParametersChanged, bodyWidth=100
242        SetVariable SampleFilledFraction,limits={0,Inf,0},variable= root:Packages:Indra3:SampleFilledFraction, noedit=!CalculateThickness, frame=CalculateThickness
243
244        SetVariable USAXSPinTvalue,pos={20,575},size={300,22},title="\Zr120pinDiode Transmission  =", help={"If exists, measured transmission by pin diode"}
245        SetVariable USAXSPinTvalue , bodyWidth=100
246        SetVariable USAXSPinTvalue,limits={0,1,0},variable= root:Packages:Indra3:USAXSPinTvalue, noedit=1, frame=CalculateWeight
247
248        CheckBox UsePinTransmission,pos={320,577},size={90,14},proc=IN3_MainPanelCheckBox,title="Use?"//, disable=CalibrateToVolume
249        CheckBox UsePinTransmission,variable= root:Packages:Indra3:UsePinTransmission, help={"Use pin diode trnamission (if exists)"}
250
251        SetVariable PeakToPeakTransmission,pos={20,595},size={300,22},title="\Zr120Peak-to-Peak T =", frame=0, noedit=1
252        SetVariable PeakToPeakTransmission, bodyWidth=100
253        SetVariable PeakToPeakTransmission,limits={0,Inf,0},variable= root:Packages:Indra3:SampleTransmissionPeakToPeak
254        SetVariable MSAXSCorrectionT0, pos={20,615},size={300,22},title="\Zr120MSAXS/SAXS Cor =", frame=0, noedit=1
255        SetVariable MSAXSCorrectionT0, bodyWidth=100
256        SetVariable MSAXSCorrectionT0,limits={0,Inf,0},variable= root:Packages:Indra3:MSAXSCorrection
257
258        SetVariable FlyScanRebinToPoints,pos={20,635},size={300,22},title="\Zr120FlyScan rebin to ="
259        SetVariable FlyScanRebinToPoints ,bodyWidth=100, proc=IN3_ParametersChanged
260        SetVariable FlyScanRebinToPoints,limits={0,Inf,0},variable= root:Packages:Indra3:FlyScanRebinToPoints
261
262        //tab 2 - geometry controls
263
264        SetVariable SpecCommand,pos={20,370},size={370,22},disable=2,title="Command:"
265        SetVariable SpecCommand , frame=0,fstyle=1
266        SetVariable SpecCommand,limits={0,Inf,0},variable= root:Packages:Indra3:SpecCommand
267
268        SetVariable PhotoDiodeSize,pos={20,390},size={250,22},title="PD size [mm] ="
269        SetVariable PhotoDiodeSize ,proc=IN3_ParametersChanged
270        SetVariable PhotoDiodeSize,limits={0,Inf,0},variable= root:Packages:Indra3:PhotoDiodeSize
271        SetVariable Wavelength,pos={20,415},size={250,22},title="Wavelength [A] ="
272        SetVariable Wavelength ,proc=IN3_ParametersChanged
273        SetVariable Wavelength,limits={0,Inf,0},variable= root:Packages:Indra3:Wavelength
274        SetVariable SDDistance,pos={20,440},size={250,22},title="SD distance [mm] ="
275        SetVariable SDDistance ,proc=IN3_ParametersChanged
276        SetVariable SDDistance,limits={0,Inf,0},variable= root:Packages:Indra3:SDDistance
277
278        SetVariable SlitLength,pos={20,465},size={250,22},title="Slit Length [A^-1] =", frame=0, disable=2
279        SetVariable SlitLength ,proc=IN3_ParametersChanged
280        SetVariable SlitLength,limits={0,Inf,0},variable= root:Packages:Indra3:SlitLength
281        SetVariable NumberOfSteps,pos={20,490},size={250,22},title="Number of steps =", disable=2, frame=0
282        SetVariable NumberOfSteps ,proc=IN3_ParametersChanged
283        SetVariable NumberOfSteps,limits={0,Inf,0},variable= root:Packages:Indra3:NumberOfSteps
284
285
286        //tab 1 Diode controls
287        SetVariable VtoF,pos={20,370},size={180,22},proc=IN3_UPDParametersChanged,title="UPD V to f factor :"
288        SetVariable VtoF ,format="%3.1e"
289        SetVariable VtoF,limits={0,Inf,0},value= root:Packages:Indra3:UPD_Vfc
290        SetVariable Gain1,pos={20,395},size={150,22},proc=IN3_UPDParametersChanged,title="Gain 1 :"
291        SetVariable Gain1 ,format="%3.1e",labelBack=(65280,0,0)
292        SetVariable Gain1,limits={0,Inf,0},value= root:Packages:Indra3:UPD_G1
293        SetVariable Gain2,pos={20,420},size={150,22},proc=IN3_UPDParametersChanged,title="Gain 2 :"
294        SetVariable Gain2 ,format="%3.1e",labelBack=(0,52224,0)
295        SetVariable Gain2,limits={0,Inf,0},value= root:Packages:Indra3:UPD_G2
296        SetVariable Gain3,pos={20,445},size={150,22},proc=IN3_UPDParametersChanged,title="Gain 3 :"
297        SetVariable Gain3 ,format="%3.1e",labelBack=(0,0,65280)
298        SetVariable Gain3,limits={0,Inf,0},value= root:Packages:Indra3:UPD_G3
299        SetVariable Gain4,pos={20,470},size={150,22},proc=IN3_UPDParametersChanged,title="Gain 4 :"
300        SetVariable Gain4 ,format="%3.1e",labelBack=(65280,35512,15384)
301        SetVariable Gain4,limits={0,Inf,0},value= root:Packages:Indra3:UPD_G4
302        SetVariable Gain5,pos={20,495},size={150,22},proc=IN3_UPDParametersChanged,title="Gain 5 :"
303        SetVariable Gain5 ,format="%3.1e",labelBack=(29696,4096,44800)
304        SetVariable Gain5,limits={0,Inf,0},value= root:Packages:Indra3:UPD_G5
305        NVAR UPD_DK1Err=root:packages:Indra3:UPD_DK1Err
306        NVAR UPD_DK2Err=root:packages:Indra3:UPD_DK2Err
307        NVAR UPD_DK3Err=root:packages:Indra3:UPD_DK3Err
308        NVAR UPD_DK4Err=root:packages:Indra3:UPD_DK4Err
309        NVAR UPD_DK5Err=root:packages:Indra3:UPD_DK5Err
310        SetVariable Bkg1,pos={20,520},size={150,18},proc=IN3_UPDParametersChanged,title="Background 1"
311        SetVariable Bkg1 ,format="%g", labelBack=(65280,0,0)
312        SetVariable Bkg1,limits={-inf,Inf,UPD_DK1Err},value= root:Packages:Indra3:UPD_DK1
313        SetVariable Bkg2,pos={20,545},size={150,18},proc=IN3_UPDParametersChanged,title="Background 2"
314        SetVariable Bkg2 ,format="%g",labelBack=(0,52224,0)
315        SetVariable Bkg2,limits={-inf,Inf,UPD_DK2Err},value= root:Packages:Indra3:UPD_DK2
316        SetVariable Bkg3,pos={20,570},size={150,18},proc=IN3_UPDParametersChanged,title="Background 3"
317        SetVariable Bkg3 ,format="%g",labelBack=(0,0,65280)
318        SetVariable Bkg3,limits={-inf,Inf,UPD_DK3Err},value= root:Packages:Indra3:UPD_DK3
319        SetVariable Bkg4,pos={20,595},size={150,18},proc=IN3_UPDParametersChanged,title="Background 4"
320        SetVariable Bkg4 ,format="%g",labelBack=(65280,35512,15384)
321        SetVariable Bkg4,limits={-inf,Inf,UPD_DK4Err},value= root:Packages:Indra3:UPD_DK4
322        SetVariable Bkg5,pos={20,620},size={150,18},proc=IN3_UPDParametersChanged,title="Background 5"
323        SetVariable Bkg5 ,format="%g",labelBack=(29696,4096,44800)
324        SetVariable Bkg5,limits={-inf,Inf,UPD_DK5Err},value= root:Packages:Indra3:UPD_DK5
325        SetVariable Bkg1Err,pos={175,520},size={70,18},title="Err"
326        SetVariable Bkg1Err ,format="%2.2g", labelBack=(65280,0,0)
327        SetVariable Bkg1Err,limits={-inf,Inf,0},value= root:Packages:Indra3:UPD_DK1Err,noedit=1
328        SetVariable Bkg2Err,pos={175,545},size={70,18},title="Err"
329        SetVariable Bkg2Err ,format="%2.2g", labelBack=(0,52224,0)
330        SetVariable Bkg2Err,limits={-inf,Inf,0},value= root:Packages:Indra3:UPD_DK2Err,noedit=1
331        SetVariable Bkg3Err,pos={175,570},size={70,18},title="Err"
332        SetVariable Bkg3Err ,format="%2.2g", labelBack=(0,0,65280)
333        SetVariable Bkg3Err,limits={-inf,Inf,0},value= root:Packages:Indra3:UPD_DK3Err,noedit=1
334        SetVariable Bkg4Err,pos={175,595},size={70,18},title="Err"
335        SetVariable Bkg4Err ,format="%2.2g", labelBack=(65280,35512,15384)
336        SetVariable Bkg4Err,limits={-inf,Inf,0},value= root:Packages:Indra3:UPD_DK4Err,noedit=1
337        SetVariable Bkg5Err,pos={175,620},size={90,18},title="Err"
338        SetVariable Bkg5Err ,format="%2.2g", labelBack=(29696,4096,44800)
339        SetVariable Bkg5Err,limits={-inf,Inf,0},value= root:Packages:Indra3:UPD_DK5Err,noedit=1
340        SetVariable Bkg5Overwrite,pos={20,640},size={245,18},proc=IN3_UPDParametersChanged,title="Overwrite Background 5"
341        SetVariable Bkg5Overwrite ,format="%g"
342        SetVariable Bkg5Overwrite,limits={-inf,Inf,0},value= root:Packages:Indra3:OverwriteUPD_DK5
343
344        TitleBox Info5 title="\Zr100Subtract Flat backg = ",pos={290,610},frame=0,fstyle=1, anchor=LC,size={150,20},fColor=(1,4,52428)
345        SetVariable SubtractFlatBackground,pos={300,630},size={100,22},title=" ", frame=1
346        SetVariable SubtractFlatBackground ,proc=IN3_ParametersChanged
347        SetVariable SubtractFlatBackground,limits={0,Inf,0},variable= root:Packages:Indra3:SubtractFlatBackground
348
349        TitleBox Info3 title="\Zr100 Amplifier dead times [sec]",pos={230,365},frame=0,fstyle=1, anchor=MC,size={200,20},fColor=(1,4,52428)
350        TitleBox Info4 title="\Zr100 RAW                Overwrite",pos={230,376},frame=0,fstyle=1, anchor=MC,size={200,20},fColor=(1,4,52428)
351
352        SetVariable FSRage1DeadTime,pos={250,395},size={70,22},noproc,title="R1:"
353        SetVariable FSRage1DeadTime ,format="%2.3g",labelBack=(65280,0,0), noedit=1
354        SetVariable FSRage1DeadTime,limits={0,Inf,0},value= root:Packages:Indra3:FSRage1DeadTime
355        SetVariable FSRage2DeadTime,pos={250,420},size={70,22},noproc,title="R2:"
356        SetVariable FSRage2DeadTime ,format="%2.3g",labelBack=(0,52224,0), noedit=1
357        SetVariable FSRage2DeadTime,limits={0,Inf,0},value= root:Packages:Indra3:FSRage2DeadTime
358        SetVariable FSRage3DeadTime,pos={250,445},size={70,22},noproc,title="R3:"
359        SetVariable FSRage3DeadTime ,format="%2.3g",labelBack=(0,0,65280), noedit=1
360        SetVariable FSRage3DeadTime,limits={0,Inf,0},value= root:Packages:Indra3:FSRage3DeadTime
361        SetVariable FSRage4DeadTime,pos={250,470},size={70,22},noproc,title="R4:"
362        SetVariable FSRage4DeadTime ,format="%2.3g",labelBack=(65280,35512,15384), noedit=1
363        SetVariable FSRage4DeadTime,limits={0,Inf,0},value= root:Packages:Indra3:FSRage4DeadTime
364        SetVariable FSRage5DeadTime,pos={250,495},size={70,22},noproc,title="R5:"
365        SetVariable FSRage5DeadTime ,format="%2.3g",labelBack=(29696,4096,44800), noedit=1
366        SetVariable FSRage5DeadTime,limits={0,Inf,0},value= root:Packages:Indra3:FSRage5DeadTime
367
368        SetVariable FSOverWriteRage1DeadTime,pos={340,395},size={60,18},noproc,title=" "
369        SetVariable FSOverWriteRage1DeadTime ,format="%g", labelBack=(65280,0,0)
370        SetVariable FSOverWriteRage1DeadTime,limits={-0,Inf,0},value= root:Packages:Indra3:FSOverWriteRage1DeadTime
371        SetVariable FSOverWriteRage2DeadTime,pos={340,420},size={60,18},noproc,title=" "
372        SetVariable FSOverWriteRage2DeadTime ,format="%g",labelBack=(0,52224,0)
373        SetVariable FSOverWriteRage2DeadTime,limits={-0,Inf,0},value= root:Packages:Indra3:FSOverWriteRage2DeadTime
374        SetVariable FSOverWriteRage3DeadTime,pos={340,445},size={60,18},noproc,title=" "
375        SetVariable FSOverWriteRage3DeadTime ,format="%g",labelBack=(0,0,65280)
376        SetVariable FSOverWriteRage3DeadTime,limits={-0,Inf,0},value= root:Packages:Indra3:FSOverWriteRage3DeadTime
377        SetVariable FSOverWriteRage4DeadTime,pos={340,470},size={60,18},noproc,title=" "
378        SetVariable FSOverWriteRage4DeadTime ,format="%g",labelBack=(65280,35512,15384)
379        SetVariable FSOverWriteRage4DeadTime,limits={-0,Inf,0},value= root:Packages:Indra3:FSOverWriteRage4DeadTime
380        SetVariable FSOverWriteRage5DeadTime,pos={340,495},size={60,18},noproc,title=" "
381        SetVariable FSOverWriteRage5DeadTime ,format="%g",labelBack=(29696,4096,44800)
382        SetVariable FSOverWriteRage5DeadTime,limits={-0,Inf,0},value= root:Packages:Indra3:FSOverWriteRage5DeadTime
383
384
385
386//calibration stuff...
387        SetVariable MaximumIntensity,pos={20,370},size={300,22},title="Sample Maximum Intensity =", frame=0, disable=2
388        SetVariable MaximumIntensity,limits={0,Inf,0},variable= root:Packages:Indra3:MaximumIntensity
389        SetVariable PeakWidth,pos={20,390},size={300,22},title="Sample Peak Width [deg]=", frame=0, disable=2
390        SetVariable PeakWidth,limits={0,Inf,0},variable= root:Packages:Indra3:PeakWidth
391        SetVariable PeakWidthArcSec,pos={20,410},size={300,22},title="Sample Peak Width [arc sec]=", frame=0, disable=2
392        SetVariable PeakWidthArcSec,limits={0,Inf,0},variable= root:Packages:Indra3:PeakWidthArcSec
393
394        SetVariable BlankMaximum,pos={20,440},size={300,22},title="Blank Maximum Intensity =  ", frame=1
395        SetVariable BlankMaximum ,proc=IN3_ParametersChanged
396        SetVariable BlankMaximum,limits={0,Inf,0},variable= root:Packages:Indra3:BlankMaximum
397        SetVariable BlankWidth,pos={20,460},size={300,22},title="Blank Peak Width [deg] =    ", frame=1
398        SetVariable BlankWidth ,proc=IN3_ParametersChanged
399        SetVariable BlankWidth,limits={0,Inf,0},variable= root:Packages:Indra3:BlankFWHM
400        SetVariable BlankWidthArcSec,pos={20,480},size={300,22},title="Blank Peak Width [arc sec]=", frame=1
401        SetVariable BlankWidthArcSec ,proc=IN3_ParametersChanged
402        SetVariable BlankWidthArcSec,limits={0,Inf,0},variable= root:Packages:Indra3:BlankWidth
403
404        Button RecoverDefaultBlnkVals,pos={240,510},size={100,20} ,proc=IN3_InputPanelButtonProc,title="Spec values", help={"Reload original value from spec record"}
405
406        CheckBox CalibrateUseSampleFWHM,pos={18,590},size={300,14},proc=IN3_MainPanelCheckBox,title="Use Sample FWHM for calibration?"
407        CheckBox CalibrateUseSampleFWHM,variable= root:Packages:Indra3:CalibrateUseSampleFWHM, help={"Check, if you want to use FWHM for absolute intensity calibration"}
408       
409
410//MSAXS stuff
411        CheckBox UseMSAXSCorrection,pos={20,370},size={300,14},proc=IN3_MainPanelCheckBox,title="MSAXS correctin on absolute intensity?"
412        CheckBox UseMSAXSCorrection,variable= root:Packages:Indra3:UseMSAXSCorrection, help={"Check, if you want to use MSAXS correction"}
413
414        SetVariable MSAXSCorrection,pos={20,390},size={300,22},title="MSAXS Correction =", frame=0, disable=2
415        SetVariable MSAXSCorrection,limits={0,Inf,0},variable= root:Packages:Indra3:MSAXSCorrection
416        SetVariable MSAXSStartPoint,pos={20,410},size={300,22},title="MSAXS start point =", frame=0, disable=2
417        SetVariable MSAXSStartPoint,limits={0,Inf,0},variable= root:Packages:Indra3:MSAXSStartPoint
418        SetVariable MSAXSEndPoint,pos={20,430},size={300,22},title="MSAXS end point =", frame=0, disable=2
419        SetVariable MSAXSEndPoint,limits={0,Inf,0},variable= root:Packages:Indra3:MSAXSEndPoint
420
421
422//Desmear tab
423        CheckBox DesmearData,pos={20,365},size={90,14},proc=IN3_MainPanelCheckBox,title="Desmear Data?"
424        CheckBox DesmearData,variable= root:Packages:Indra3:DesmearData, help={"Check, if you  want to desmear data immediately"}
425
426        SetVariable BckgStartQ,pos={20,390},size={300,22},limits={0.01,0.5,0.01}, title="Background extrapolation start ="
427        SetVariable BckgStartQ,variable= root:Packages:Indra3:DesmearBckgStart, proc=IN3_ParametersChanged
428        SVAR BackgroundFunction=root:Packages:Indra3:DsmBackgroundFunction
429        PopupMenu BackgroundFnct,pos={20,420},size={258,21}, proc=IN3_InputPopMenuProc,title="background function :   "
430        PopupMenu BackgroundFnct,mode=1,value= "PowerLaw w flat;flat;power law;Porod;",popvalue=BackgroundFunction
431
432       
433
434        setDataFolder OldDf
435        NI3_TabPanelControl("",0)
436
437        CheckBox RemoveDropouts,pos={20,665},size={150,14},title="Remove Flyscan dropouts?", proc=IN3_MainPanelCheckBox
438        CheckBox RemoveDropouts,variable= root:Packages:Indra3:RemoveDropouts, help={"Check, if you want to remove flyscan dropouts"}
439        SetVariable RemoveDropoutsAvePnts,pos={20,685},size={150,22},title="Intg. pnts (~50) =", frame=1
440        SetVariable RemoveDropoutsAvePnts,limits={10,100,10},variable= root:Packages:Indra3:RemoveDropoutsAvePnts, proc=IN3_ParametersChanged
441
442        SetVariable RemoveDropoutsTime,pos={220,665},size={180,22},title="Drpt. Time [s] =", frame=1
443        SetVariable RemoveDropoutsTime,limits={0.01,5,0.1},variable= root:Packages:Indra3:RemoveDropoutsTime, proc=IN3_ParametersChanged
444        SetVariable RemoveDropoutsFraction,pos={220,685},size={180,22},title="Drp Int. fract. (0.1-0.7) =", frame=1
445        SetVariable RemoveDropoutsFraction,limits={0,1,0.1},variable= root:Packages:Indra3:RemoveDropoutsFraction, proc=IN3_ParametersChanged
446
447
448        CheckBox RemoveOscillations,pos={230,743},size={180,22},title="Remove Oscillations ", noproc
449        CheckBox RemoveOscillations,variable= root:Packages:Indra3:RemoveOscillations, help={"Check, if you want to remove vibrations"}
450        CheckBox DisplayJPGFile,pos={230,758},size={180,22},title="Display JPG File ", noproc
451        CheckBox DisplayJPGFile,variable= root:Packages:Indra3:DisplayJPGFile, help={"Check, if you want to display jpg file (if it exists)"}
452//
453
454        SetVariable ListProcDisplayDelay,pos={20,773},size={180,22},title="Display delay ", frame=1
455        SetVariable ListProcDisplayDelay,limits={0.1,100,1},variable= root:Packages:Indra3:ListProcDisplayDelay
456
457        CheckBox OverWriteExistingData,pos={20,795},size={150,14},title="Overwrite existing data?", noproc
458        CheckBox OverWriteExistingData,variable= root:Packages:Indra3:OverWriteExistingData, help={"Check, if you want to overwrite data which already exist"}
459
460        CheckBox FindMinQForData,pos={230,773},size={150,14},title="Find MinQ automatically?", noproc
461        CheckBox FindMinQForData,variable= root:Packages:Indra3:FindMinQForData, help={"Check, if you want to locate min-q for data start"}
462        SetVariable MinQMinFindRatio,pos={220,795},size={170,22},title="I_S/I_Bl ratio =  ", frame=1
463        SetVariable MinQMinFindRatio,limits={0.1,10,0.01},variable= root:Packages:Indra3:MinQMinFindRatio, noproc
464
465
466
467       
468//      Button Recalculate,pos={50,755},size={120,20},proc=IN3_InputPanelButtonProc,title="Recalculate", help={"Recalculate the data"}
469//      Button RemovePoint,pos={200,755},size={170,20},proc=IN3_InputPanelButtonProc,title="Remove point with csr A", help={"Remove point with cursor A"}
470end
471
472
473//*****************************************************************************************************************
474//*****************************************************************************************************************
475//*****************************************************************************************************************
476//*****************************************************************************************************************
477//*****************************************************************************************************************
478Function IN3_FailedLoadMessage(Filename) : Panel
479      string FileName
480        PauseUpdate             // building window...
481        NewPanel /W=(348,238,695,363)/K=1 as "File Failed to Load Message"
482        DoWindow/C FailedLoadmessage
483        ModifyPanel cbRGB=(65535,0,0)
484        SetDrawLayer UserBack
485        SetDrawEnv fsize= 20,fstyle= 3
486        DrawText 24,30,"\\JC"+ FileName
487        SetDrawEnv fsize=14, fstyle=3
488        Drawtext 15, 60, "\\JCFile failed to load. Are you still collecting data?"
489        SetDrawEnv fsize=14, fstyle=3
490        Drawtext 15, 80, "Or the file may corrupted?"
491        DrawText 10,100, "This message should disapper in 3 seconds on its own"
492        DoUpdate
493EndMacro
494//************************************************************************************************************
495//************************************************************************************************************
496Function/T IN3_USAXSScanLoadHdf5File2(LoadManyDataSets)
497        variable LoadManyDataSets
498       
499        string ListOfLoadedDataSets=""
500       
501        string OldDf=getDataFolder(1)
502        setDataFolder root:
503        NewDataFolder/O root:raw
504        SetDataFolder root:raw
505        Wave/T WaveOfFiles      = root:Packages:USAXS_FlyScanImport:WaveOfFiles
506        Wave WaveOfSelections   = root:Packages:USAXS_FlyScanImport:WaveOfSelections
507        SVAR DataExtension      = root:Packages:USAXS_FlyScanImport:DataExtension
508        SVAR RemoveFromNameString = root:Packages:USAXS_FlyScanImport:RemoveFromNameString     
509        NVAR OverWriteExistingData = root:Packages:Indra3:OverWriteExistingData
510        NVAR DisplayJPGFile = root:Packages:Indra3:DisplayJPGFile
511       
512        variable NumSelFiles=sum(WaveOfSelections)     
513        variable NumOpenedFiles=0
514        if(NumSelFiles==0)
515                return ""
516        endif   
517        variable i, Overwrite
518        string FileName, ListOfExistingFolders, tmpDtaFldr, shortNameBckp, TargetRawFoldername
519        String browserName, FileNameNoExtension, HDF5RawFolderWithData, SpecFileName, JPGFileName
520        Variable locFileID
521        For(i=0;i<numpnts(WaveOfSelections);i+=1)
522                if(WaveOfSelections[i]&&(LoadManyDataSets || NumOpenedFiles<1))
523                        WaveOfSelections[i]=0
524                        NumOpenedFiles=1
525                        FileName= WaveOfFiles[i]
526                        FileNameNoExtension = ReplaceString("."+DataExtension, FileName, "")
527                        //this will display jpg image if it exists...
528                        KillWindow/Z SampleImageDuringMeasurementImg
529                        if(DisplayJPGFile)
530                                JPGFileName = FileNameNoExtension+".jpg"
531                                setDataFOlder root:Packages:Indra3:
532                                ImageLoad/P=USAXSHDFPath/T=jpeg/Q/O/Z/N=SampleImageDuringMeasurement JPGFileName
533                                if(V_flag)      //success...
534                                        Wave Img = root:Packages:Indra3:SampleImageDuringMeasurement
535                                        NewImage/K=1/N=SampleImageDuringMeasurementImg Img
536                                        MoveWindow /W=SampleImageDuringMeasurementImg 40,45,910,664
537                                        AutoPositionWindow/R=USAXSDataReduction/M=1 SampleImageDuringMeasurementImg
538                                endif
539                                setDataFOlder root:raw
540                        endif
541                        //end if display image...               
542                                                                //IN2G_CreateUserName(NameIn,MaxShortLength, MakeUnique, FolderWaveStrNum)
543                        FileNameNoExtension=IN2G_CreateUserName(ReplaceString(RemoveFromNameString,FileNameNoExtension,""),31,0,11)
544                                                                //shortFileName = IN2G_CreateUserName(shortFileName,31,0,11)
545                        //check if such data exist already...
546                        ListOfExistingFolders = DataFolderDir(1)
547                        HDF5OpenFile/R/Z /P=USAXSHDFPath locFileID as FileName
548                        if(V_flag!=0)   //failed
549                           HDF5CLoseFile/Z locFileID
550                                IN3_FailedLoadMessage(FileName)
551                                sleep/s 3
552                                DoWindow FailedLoadmessage
553                                if(V_Flag)              //this is for Igor 6 compatibility, KillWIndow /Z is only Igor 7
554                                        KillWindow FailedLoadmessage
555                                endif
556                                print "Could not open "+FileName
557                                abort
558                                return ""
559                        else
560                                // Open OK?
561                                //Variable timerRefNum
562                                //timerRefNum = startMSTimer
563                                HDF5LoadGroup /O /R /T /IMAG=1 :, locFileID, "/"                       
564                                //Variable microSeconds
565                                //microSeconds = StopMSTimer(timerRefNum)
566                                //print microSeconds
567                                if(strlen(S_dataFolderPaths)<5)
568                                        Abort "HDF5 import failed in "+GetDataFolder(1)
569                                endif
570                                HDF5RawFolderWithData=stringFromList(0,S_dataFolderPaths,";")
571                                //create Config_Version and make sure it has correct content...
572                                KillWaves/Z Config_Version
573                                HDF5LoadData/Z /A="config_version"/Q  /Type=2 locFileID , "/entry/program_name"
574                                if(V_Flag!=0)
575                                        Make/T/N=1 Config_Version
576                                        Config_Version[0]="0"
577                                endif
578                           HDF5CloseFile/Z locFileID            //cLose HDF5 file here...
579                                //make sure config version is properly created.
580                                Wave/T Config_Version
581                                variable/g $(HDF5RawFolderWithData+"HdfWriterVersion")
582                                NVAR HdfWriterVersion = $(HDF5RawFolderWithData+"HdfWriterVersion")
583                                HdfWriterVersion = str2num(Config_Version[0])
584                                KillWaves/Z Config_Version                                     
585                                //Now, figure out if we have flyscan or step scan. 
586                                //we are in root:raw here
587                                Wave/T/Z program_name = $(HDF5RawFolderWithData+"entry:program_name")
588                                variable isStepScan, isFlyScan
589                                if(StringMatch(program_name[0], "bluesky"))
590                                        isStepScan = 1
591                                        isFlyScan = 0
592                                elseif(StringMatch(program_name[0], "saveFlyData.py"))
593                                        isStepScan = 0
594                                        isFlyScan = 1
595                                else    //default to flyscan. May need to be in the future...
596                                        isStepScan = 0
597                                        isFlyScan = 1
598                                endif
599
600                                print "Imported HDF5 file : "+FileName
601#if(exists("AfterFlyImportHook")==6) 
602                                AfterFlyImportHook(HDF5RawFolderWithData)
603#endif 
604                                string tempStrProcessedName
605                                if(isFlyScan)           //flyscan import
606                                        tempStrProcessedName = IN3_FSConvertToUSAXS(HDF5RawFolderWithData, FileNameNoExtension)
607                                elseif(isStepScan)
608                                        tempStrProcessedName = IN3_StepScanConvertToUSAXS(HDF5RawFolderWithData, FileNameNoExtension)           
609                                else
610                                        Abort "Unknown scan type. Bug! Report me"               
611                                endif
612                                ListOfLoadedDataSets += tempStrProcessedName    +";"
613                                print "Converted : "+HDF5RawFolderWithData+" into USAXS data : "+ tempStrProcessedName
614                                KillDataFOlder/Z HDF5RawFolderWithData
615                        endif
616
617                endif
618        endfor
619        setDataFolder OldDf
620       
621        return ListOfLoadedDataSets
622end
623
624//************************************************************************************************************
625//************************************************************************************************************
626//************************************************************************************************************
627//************************************************************************************************************
628
629Function IN3_USAXSDataRedCheckVersion()
630        DoWindow USAXSDataReduction
631        if(V_Flag)
632                if(!IN3_CheckPanelVersionNumber("USAXSDataReduction", IN3_NewReduceDataMainVersionNum))
633                        DoAlert /T="The USAXS Data Reduction  panel was created by incorrect version of Indra " 1, "USAXS Data Reduction needs to be restarted to work properly. Restart now?"
634                        if(V_flag==1)
635                                DoWindow/K USAXSDataReduction
636                                //IN3_Main()
637                        else            //at least reinitialize the variables so we avoid major crashes...
638                                IN3_Initialize()
639                        endif
640                endif
641        endif
642end
643//************************************************************************************************************
644//************************************************************************************************************
645///////////////////////////////////////////
646//****************************************************************************************
647//              Default variables and strings
648//
649//      these are known at this time:
650//              Variables=LegendSize;TagSize;AxisLabelSize;
651//              Strings=FontType;
652//
653//      how to use:
654//      When needed insert font size through lookup function - e.g., IN2G_LkUpDfltVar("LegendSize")
655//      or for font type IN2G_LkUpDfltStr("FontType")
656//      NOTE: Both return string values, because that is what is generally needed!!!!
657// further variables and strings can be added, but need to be added to control panel too...
658//      see example in : IR1_LogLogPlotU()  in this procedure file...
659//***********************************************************
660//***********************************************************
661Function IN3_ConfigureGUIfonts()
662        IN2G_ConfigMain()
663end
664
665//Function/S IN2G_LkUpDfltStr(StrName)
666//      string StrName
667//
668//      string result
669//      string OldDf=getDataFolder(1)
670//      SetDataFolder root:
671//      if(!DataFolderExists("root:Packages:IrenaConfigFolder"))
672//              IN2G_InitConfigMain()
673//      endif
674//      SetDataFolder root:Packages
675//      setDataFolder root:Packages:IrenaConfigFolder
676//      SVAR /Z curString = $(StrName)
677//      if(!SVAR_exists(curString))
678//              IN2G_InitConfigMain()
679//              SVAR curString = $(StrName)
680//      endif   
681//      result =        "'"+curString+"'"
682//      setDataFolder OldDf
683//      return result
684//end
685////***********************************************************
686////***********************************************************
687//
688//Function/S IN2G_LkUpDfltVar(VarName)
689//      string VarName
690//
691//      string result
692//      string OldDf=getDataFolder(1)
693//      SetDataFolder root:
694//      if(!DataFolderExists("root:Packages:IrenaConfigFolder"))
695//              IN2G_InitConfigMain()
696//      endif
697//      SetDataFolder root:Packages
698//      setDataFolder root:Packages:IrenaConfigFolder
699//      NVAR /Z curVariable = $(VarName)
700//      if(!NVAR_exists(curVariable))
701//              IN2G_InitConfigMain()
702//              NVAR curVariable = $(VarName)
703//      endif   
704//      if(curVariable>=10)
705//              result = num2str(curVariable)
706//      else
707//              result = "0"+num2str(curVariable)
708//      endif
709//      setDataFolder OldDf
710//      return result
711//end
712//***********************************************************
713//***********************************************************
714
715//Function IN3_InitConfigMain()
716//
717//      //initialize lookup parameters for user selected items.
718//      string OldDf=getDataFolder(1)
719//      SetDataFolder root:
720//      NewDataFolder/O/S root:Packages
721//      NewDataFolder/O/S root:Packages:IrenaConfigFolder
722//     
723//      string ListOfVariables
724//      string ListOfStrings
725//      //here define the lists of variables and strings needed, separate names by ;...
726//      ListOfVariables="LegendSize;TagSize;AxisLabelSize;LegendUseFolderName;LegendUseWaveName;DefaultFontSize;LastUpdateCheck;"
727//      ListOfStrings="FontType;ListOfKnownFontTypes;DefaultFontType;"
728//      variable i
729//      //and here we create them
730//      for(i=0;i<itemsInList(ListOfVariables);i+=1)   
731//              IN2G_CreateItem("variable",StringFromList(i,ListOfVariables))
732//      endfor         
733//                                                                             
734//      for(i=0;i<itemsInList(ListOfStrings);i+=1)     
735//              IN2G_CreateItem("string",StringFromList(i,ListOfStrings))
736//      endfor 
737//      //Now set default values
738//      String VariablesDefaultValues
739//      String StringsDefaultValues
740//      if (stringMatch(IgorInfo(2),"*Windows*"))               //Windows
741//              VariablesDefaultValues="LegendSize:8;TagSize:8;AxisLabelSize:8;LegendUseFolderName:0;LegendUseWaveName:0;"
742//      else
743//              VariablesDefaultValues="LegendSize:10;TagSize:10;AxisLabelSize:10;LegendUseFolderName:0;LegendUseWaveName:0;"
744//      endif
745//      StringsDefaultValues="FontType:"+StringFromList(0, IN3_CreateUsefulFontList() ) +";"
746//
747//      variable CurVarVal
748//      string CurVar, CurStr, CurStrVal
749//      For(i=0;i<ItemsInList(VariablesDefaultValues);i+=1)
750//              CurVar = StringFromList(0,StringFromList(i, VariablesDefaultValues),":")
751//              CurVarVal = numberByKey(CurVar, VariablesDefaultValues)
752//              NVAR temp=$(CurVar)
753//              if(temp==0)
754//                      temp = CurVarVal
755//              endif
756//      endfor
757//      For(i=0;i<ItemsInList(StringsDefaultValues);i+=1)
758//              CurStr = StringFromList(0,StringFromList(i, StringsDefaultValues),":")
759//              CurStrVal = stringByKey(CurStr, StringsDefaultValues)
760//              SVAR tempS=$(CurStr)
761//              if(strlen(tempS)<1)
762//                      tempS = CurStrVal
763//              endif
764//      endfor
765//     
766//      SVAR ListOfKnownFontTypes=ListOfKnownFontTypes
767//      ListOfKnownFontTypes=IN3_CreateUsefulFontList()
768//      setDataFolder OldDf
769//end
770////***********************************************************
771////***********************************************************
772//
773//Function IN3_ReadIrenaGUIPackagePrefs()
774//
775//      struct  IrenaPanelDefaults Defs
776//      IN3_InitConfigMain()
777//      SVAR DefaultFontType=root:Packages:IrenaConfigFolder:DefaultFontType
778//      NVAR DefaultFontSize=root:Packages:IrenaConfigFolder:DefaultFontSize
779//      NVAR LegendSize=root:Packages:IrenaConfigFolder:LegendSize
780//      NVAR TagSize=root:Packages:IrenaConfigFolder:TagSize
781//      NVAR AxisLabelSize=root:Packages:IrenaConfigFolder:AxisLabelSize
782//      NVAR LegendUseFolderName=root:Packages:IrenaConfigFolder:LegendUseFolderName
783//      NVAR LegendUseWaveName=root:Packages:IrenaConfigFolder:LegendUseWaveName
784//      NVAR LastUpdateCheck=root:Packages:IrenaConfigFolder:LastUpdateCheck
785//      SVAR FontType=root:Packages:IrenaConfigFolder:FontType
786//      LoadPackagePreferences /MIS=1   "Irena" , "IrenaDefaultPanelControls.bin", 0 , Defs
787//      if(V_Flag==0)           
788//              //print Defs
789//              //print "Read Irena Panels and graphs preferences from local machine and applied them. "
790//              //print "Note that this may have changed font size and type selection originally saved with the existing experiment."
791//              //print "To change them please use \"Configure default fonts and names\""
792//              if(Defs.Version==1 || Defs.Version==2)          //Lets declare the one we know as 1
793//                      DefaultFontType=Defs.PanelFontType
794//                      DefaultFontSize = Defs.defaultFontSize
795//                      LastUpdateCheck = Defs.LastUpdateCheck
796//                      if (stringMatch(IgorInfo(2),"*Windows*"))               //Windows
797//                              DefaultGUIFont /Win   all= {DefaultFontType, DefaultFontSize, 0 }
798//                      else
799//                              DefaultGUIFont /Mac   all= {DefaultFontType, DefaultFontSize, 0 }
800//                      endif
801//                      //and now recover the stored other parameters, no action on these...
802//                       LegendSize=Defs.LegendSize
803//                       TagSize=Defs.TagSize
804//                       AxisLabelSize=Defs.AxisLabelSize
805//                       LegendUseFolderName=Defs.LegendUseFolderName
806//                       LegendUseWaveName=Defs.LegendUseWaveName
807//                       FontType=Defs.LegendFontType
808//              else
809//                      DoAlert 1, "Old version of GUI and Graph Fonts (font size and type preference) found. Do you want to update them now? These are set once on a computer and can be changed in \"Configure default fonts and names\""
810//                      if(V_Flag==1)
811//                              Execute("IN3_MainConfigPanel() ")
812//                      else
813//                      //      SavePackagePreferences /Kill   "Irena" , "IrenaDefaultPanelControls.bin", 0 , Defs      //does not work below 6.10
814//                      endif
815//              endif
816//      else            //problem loading package defaults
817//              Struct WMButtonAction ba
818//              ba.ctrlName="DefaultValues"
819//              IN3_KillPrefsButtonProc(ba)
820//              DoAlert 1, "GUI and Graph defaults (font size and type preferences) not found. They wewre set to defaults. Do you want to set check now? These are set once on a computer and can be changed in \"Configure default fonts and names\" dialog"
821//              if(V_Flag==1)
822//                      Execute("IN3_MainConfigPanel() ")
823//              endif   
824//      endif
825//end
826//***********************************************************
827//***********************************************************
828//***********************************************************
829//***********************************************************
830Function IN3_KillPrefsButtonProc(ba) : ButtonControl
831        STRUCT WMButtonAction &ba
832
833        switch( ba.eventCode )
834                case 2: // mouse up
835                        // click code here
836                        if(stringmatch(ba.ctrlName,"OKBUtton"))
837                                DoWIndow/K IR2C_MainConfigPanel
838                        elseif(stringmatch(ba.ctrlName,"DefaultValues"))
839                                string defFnt
840                                variable defFntSize
841                                if (stringMatch(IgorInfo(2),"*Windows*"))               //Windows
842                                        defFnt=stringFromList(0,IN3_CreateUsefulFontList())
843                                        defFntSize=12
844                                else
845                                        defFnt="Geneva"
846                                        defFntSize=9
847                                endif
848                                SVAR ListOfKnownFontTypes=root:Packages:IrenaConfigFolder:ListOfKnownFontTypes
849                                SVAR DefaultFontType=root:Packages:IrenaConfigFolder:DefaultFontType
850                                DefaultFontType = defFnt
851                                NVAR DefaultFontSize=root:Packages:IrenaConfigFolder:DefaultFontSize
852                                DefaultFontSize = defFntSize
853                                IN2G_ChangePanelControlsStyle()
854                                IN2G_SaveIrenaGUIPackagePrefs(0)
855                                PopupMenu DefaultFontType,win=IR2C_MainConfigPanel, mode=(1+WhichListItem(defFnt, ListOfKnownFontTypes))
856                                PopupMenu DefaultFontSize,win=IR2C_MainConfigPanel, mode=(1+WhichListItem(num2str(defFntSize), "8;9;10;11;12;14;16;18;20;24;26;30;"))
857                        endif
858                        break
859        endswitch
860        return 0
861End
862//***********************************************************
863//***********************************************************
864////***********************************************************
865//Function IN3_SaveIrenaGUIPackagePrefs(KillThem)
866//      variable KillThem
867//     
868//      struct  IrenaPanelDefaults Defs
869//      IN2G_InitConfigMain()
870//      SVAR DefaultFontType=root:Packages:IrenaConfigFolder:DefaultFontType
871//      NVAR DefaultFontSize=root:Packages:IrenaConfigFolder:DefaultFontSize
872//      NVAR LegendSize=root:Packages:IrenaConfigFolder:LegendSize
873//      NVAR TagSize=root:Packages:IrenaConfigFolder:TagSize
874//      NVAR AxisLabelSize=root:Packages:IrenaConfigFolder:AxisLabelSize
875//      NVAR LegendUseFolderName=root:Packages:IrenaConfigFolder:LegendUseFolderName
876//      NVAR LegendUseWaveName=root:Packages:IrenaConfigFolder:LegendUseWaveName
877//      NVAR LastUpdateCheck=root:Packages:IrenaConfigFolder:LastUpdateCheck
878//      SVAR FontType=root:Packages:IrenaConfigFolder:FontType
879//
880//      Defs.Version                    =               2
881//      Defs.PanelFontType              =               DefaultFontType
882//      Defs.defaultFontSize    =               DefaultFontSize
883//      Defs.LegendSize                 =               LegendSize
884//      Defs.TagSize                    =               TagSize
885//      Defs.AxisLabelSize              =               AxisLabelSize
886//      Defs.LegendUseFolderName =      LegendUseFolderName
887//      Defs.LegendUseWaveName =        LegendUseWaveName
888//      Defs.LegendFontType     =               FontType
889//      Defs.LastUpdateCheck    =               LastUpdateCheck
890//     
891//      if(KillThem)
892//              SavePackagePreferences /Kill   "Irena" , "IrenaDefaultPanelControls.bin", 0 , Defs              //does not work below 6.10
893//      //      IR2C_ReadIrenaGUIPackagePrefs()
894//      else
895//              SavePackagePreferences /FLSH=1   "Irena" , "IrenaDefaultPanelControls.bin", 0 , Defs
896//      endif
897//end
898////***********************************************************
899//***********************************************************
900
901//Function IN3_ChangePanelControlsStyle()
902//
903//      SVAR DefaultFontType=root:Packages:IrenaConfigFolder:DefaultFontType
904//      NVAR DefaultFontSize=root:Packages:IrenaConfigFolder:DefaultFontSize
905//
906//      if (stringMatch(IgorInfo(2),"*Windows*"))               //Windows
907//              DefaultGUIFont /Win   all= {DefaultFontType, DefaultFontSize, 0 }
908//      else
909//              DefaultGUIFont /Mac   all= {DefaultFontType, DefaultFontSize, 0 }
910//      endif
911//
912//end
913//
914//***********************************************************
915//***********************************************************
916
917//***********************************************************
918//***********************************************************
919//***********************************************************
920//***********************************************************
921//***********************************************************
922
923Function/S IN3_CreateUsefulFontList()
924
925        string SystemFontList=FontList(";")
926        string PreferredFontList="Tahoma;Times;Arial$;Geneva;Palatino;Book Antiqua;"
927        PreferredFontList+="Courier;Vardana;Monaco;Courier CE;System;Verdana;"
928       
929        variable i
930        string UsefulList="", tempList=""
931        For(i=0;i<ItemsInList(PreferredFontList);i+=1)
932                tempList=GrepList(SystemFontList, stringFromList(i,PreferredFontList))
933                if(strlen(tempList)>0)
934                        UsefulList+=tempList+";"
935                endif
936        endfor
937        return UsefulList
938end
939
940
941//***********************************************************
942//***********************************************************
943//***********************************************************
944//************************************************************************************************************
945//************************************************************************************************************
946//*****************************************************************************************************************
947//*****************************************************************************************************************
948//*****************************************************************************************************************
949//*****************************************************************************************************************
950//*****************************************************************************************************************
951
952
953Function IN3_Initialize()
954
955
956        string OldDf=GetDataFolder(1)
957        setdatafolder root:
958        NewDataFolder/O/S root:Packages
959        NewDataFolder/O USAXS
960        NewDataFolder/O/S Indra3
961
962
963        string ListOfVariables
964        string ListOfStrings
965        variable i, j
966       
967       
968        //Main parameters
969        ListOfVariables="IsBlank;is2DCollimated;CalculateThickness;Wavelength;RecalculateAutomatically;SampleFilledFraction;Kfactor;"
970        ListOfVariables+="SampleThickness;OverideSampleThickness;SampleTransmission;SampleLinAbsorption;SampleTransmissionPeakToPeak;"
971        ListOfVariables+="SampleThicknessBckp;BlankWidthBckp;BlankFWHMBckp;BlankMaximumBckp;"
972        ListOfVariables+="UPD_G1;UPD_G2;UPD_G3;UPD_G4;UPD_G5;UPD_Vfc;"
973        ListOfVariables+="UPD_DK1;UPD_DK2;UPD_DK3;UPD_DK4;UPD_DK5;"
974        ListOfVariables+="UPD_DK1Err;UPD_DK2Err;UPD_DK3Err;UPD_DK4Err;UPD_DK5Err;"
975        ListOfVariables+="PhotoDiodeSize;SlitLength;NumberOfSteps;SDDistance;"
976        ListOfVariables+="PeakCenterFitStartPoint;PeakCenterFitEndPoint;"
977        ListOfVariables+="BeamCenter;MaximumIntensity;PeakWidth;PeakWidthArcSec;"
978        ListOfVariables+="SampleQOffset;DisplayPeakCenter;DisplayAlignSaAndBlank;SampleAngleOffset;SmoothRCurveData;"
979        ListOfVariables+="RemoveDropouts;RemoveDropoutsTime;RemoveDropoutsFraction;RemoveDropoutsAvePnts;"
980        ListOfVariables+="FSOverWriteRage1DeadTime;FSOverWriteRage2DeadTime;FSOverWriteRage3DeadTime;FSOverWriteRage4DeadTime;FSOverWriteRage5DeadTime;"
981        ListOfVariables+="FSRage1DeadTime;FSRage2DeadTime;FSRage3DeadTime;FSRage4DeadTime;FSRage5DeadTime;"
982
983        ListOfVariables+="CalibrateToWeight;CalibrateToVolume;CalibrateArbitrary;SampleWeightInBeam;CalculateWeight;BeamExposureArea;SampleDensity;"
984        ListOfVariables+="CalibrateUseSampleFWHM;"
985
986        ListOfVariables+="BlankWidth;MSAXSCorrection;UseMSAXSCorrection;UsePinTransmission;USAXSPinTvalue;"
987        ListOfVariables+="MSAXSStartPoint;MSAXSEndPoint;BlankFWHM;BlankMaximum;"
988
989        ListOfVariables+="SubtractFlatBackground;UserSavedData;OverWriteExistingData;"
990        ListOfVariables+="TrimDataStart;TrimDataEnd;OverwriteUPD_DK5;RemoveOscillations;"
991
992        ListOfVariables+="UseModifiedGauss;UseGauss;UseLorenz;"
993        ListOfVariables+="FlyScanRebinToPoints;ListProcDisplayDelay;"
994       
995        ListOfVariables+="FindMinQForData;MinQMinFindRatio;"
996
997        ListOfVariables+="DesmearData;DesmearNumberOfInterations;DesmearNumPoints;DesmearBckgStart;"
998
999        ListOfVariables+="SmartSelectBlank;DisplayJPGFile;"
1000
1001        // these are created automatically... "DataFoldername;IntensityWavename;QWavename;ErrorWaveName;"
1002        ListOfStrings="SampleName;BlankName;userFriendlySamplename;userFriendlyBlankName;userFriendlySampleDFName;"
1003        ListOfStrings+="ListOfASBParameters;LastSample;DataFolderName;DsmBackgroundFunction;"
1004        //and here we create them
1005        for(i=0;i<itemsInList(ListOfVariables);i+=1)   
1006                IN2G_CreateItem("variable",StringFromList(i,ListOfVariables))
1007        endfor         
1008        for(i=0;i<itemsInList(ListOfStrings);i+=1)     
1009                IN2G_CreateItem("string",StringFromList(i,ListOfStrings))
1010        endfor 
1011
1012        NVAR UsePinTransmission
1013        UsePinTransmission = 1
1014
1015        NVAR/Z PhotoDiodeSize
1016        if (PhotoDiodeSize<=0)                                                          //avoid next lines if already exists....
1017                PhotoDiodeSize=5.5
1018        endif
1019        NVAR SampleFilledFraction
1020        if(SampleFilledFraction<=0)
1021                SampleFilledFraction=1
1022        endif
1023        NVAR ListProcDisplayDelay
1024        if(ListProcDisplayDelay<=0)
1025                ListProcDisplayDelay=2
1026        endif
1027       
1028        NVAR IsBlank
1029        NVAR SmoothRCurveData
1030        if(isBlank)
1031                SmoothRCurveData=1
1032        endif
1033       
1034        NVAR MinQMinFindRatio
1035        if(MinQMinFindRatio<1.01)
1036                MinQMinFindRatio=1.05
1037        endif
1038        NVAR FindMinQForData
1039        FindMinQForData = 1
1040        NVAR OverWriteExistingData
1041        OverWriteExistingData = 1
1042        NVAR RemoveOscillations
1043        RemoveOscillations = 1
1044       
1045        NVAR DisplayPeakCenter
1046        NVAR FlyScanRebinToPoints
1047        if(FlyScanRebinToPoints<100)
1048                FlyScanRebinToPoints=500                        //2020-2-3 changed to 500, cpu seems to be good by now.
1049        endif
1050        NVAR DisplayAlignSaAndBlank
1051        if(DisplayPeakCenter+DisplayAlignSaAndBlank!=1)
1052                DisplayPeakCenter=1
1053                DisplayAlignSaAndBlank=0
1054        endif
1055        NVAR UseModifiedGauss
1056        NVAR UseGauss
1057        NVAR UseLorenz
1058        if(UseModifiedGauss+UseGauss+UseLorenz!=1)
1059                UseModifiedGauss=1
1060                UseGauss=0
1061                UseLorenz=0
1062        endif
1063        NVAR CalibrateToWeight
1064        NVAR CalibrateToVolume
1065        NVAR CalibrateArbitrary
1066        //add check so Volume is default and only 1 is selected.
1067        if(CalibrateArbitrary+CalibrateToVolume+CalibrateToWeight!=1)
1068                 CalibrateToWeight=0
1069                 CalibrateToVolume=1
1070                 CalibrateArbitrary=0
1071        endif
1072        NVAR RemoveDropouts
1073        RemoveDropouts=1
1074        NVAR RemoveDropoutsTime
1075        NVAR RemoveDropoutsFraction
1076        if(RemoveDropoutsTime<0.01)
1077                RemoveDropoutsTime=0.25
1078        endif
1079        if(RemoveDropoutsFraction<0.01)
1080                RemoveDropoutsFraction=0.7
1081        endif
1082        NVAR RemoveDropoutsAvePnts
1083        if(RemoveDropoutsAvePnts<10)
1084                RemoveDropoutsAvePnts=50
1085        endif
1086        SVAR DsmBackgroundFunction
1087        if(strlen(DsmBackgroundFunction)<3)
1088                DsmBackgroundFunction = "PowerLaw w flat"
1089        endif
1090        NVAR DesmearBckgStart
1091        if(DesmearBckgStart<0.01)
1092                DesmearBckgStart=0.1
1093        endif
1094        setDataFolder OldDf
1095end
1096//*****************************************************************************************************************
1097//*****************************************************************************************************************
1098//*****************************************************************************************************************
1099//*****************************************************************************************************************
1100//*****************************************************************************************************************
1101
1102
1103Function IN3_MainPanel()
1104
1105        string oldDf=GetDataFolder(1)
1106        setDataFolder root:Packages:Indra3
1107
1108        PauseUpdate             // building window...
1109        NewPanel /K=1 /W=(2.25,43.25,390,710) as "USAXS data reduction"
1110        DoWindow/C USAXSDataReduction
1111        TitleBox Title title="\Zr210USAXS data reduction panel",pos={40,3},frame=0,fstyle=3,size={300,24},fColor=(1,4,52428), anchor=MC
1112        TitleBox Info1 title="\Zr100To limit range of data being used for subtraction, set cursor A",pos={5,565},frame=0,fstyle=1,anchor=MC, size={380,20},fColor=(1,4,52428)
1113        TitleBox Info2 title="\Zr100 on first point and B on last point of either sample of blank data",pos={5,580},frame=0,fstyle=1, anchor=MC,size={380,20},fColor=(1,4,52428)
1114        //some local controls
1115        CheckBox IsBlank,pos={20,35},size={90,14},proc=IN3_MainPanelCheckBox,title="Process as blank"
1116        CheckBox IsBlank,variable= root:Packages:Indra3:IsBlank, help={"Check, if you want to process this run as blank"}
1117        Button GetHelp,pos={290,25},size={80,15},fColor=(65535,32768,32768), proc=IN3_InputPanelButtonProc,title="Get Help", help={"Open www manual page for this tool"}
1118        Button GetReadme,pos={290,40},size={80,15}, proc=IN3_InputPanelButtonProc,title="Read me", help={"Open Read me short instructions"}
1119
1120        //use general controls package, modify asnecessary
1121        string AllowedUserTypes="USAXS_PD;"
1122        string XUserTypeLookup="USAXS_PD:AR_Encoder;"
1123        IR2C_AddDataControls("Indra3","USAXSDataReduction","","",AllowedUserTypes,"USAXS raw data",XUserTypeLookup,"", 0,0)
1124        SVAR DataFolderName=    root:Packages:Indra3:DataFolderName
1125        DataFolderName="---"
1126        PopupMenu QvecDataName disable=1
1127        PopupMenu IntensityDataName disable=1
1128        PopupMenu ErrorDataName disable=1
1129        CheckBox UseQRSData disable=1
1130        CheckBox UseUserDefinedData disable=1
1131        SetVariable WaveMatchStr, disable=1
1132        NVAR useUserDefinedData=root:Packages:Indra3:UseUserDefinedData
1133        UseUserDefinedData=1
1134        //more local controls.
1135        SVAR BlankName = root:Packages:Indra3:BlankName
1136        string temppopStr
1137        if(strlen(BlankName)>3)
1138                temppopStr = BlankName
1139        else
1140                temppopStr = "---"
1141        endif
1142        PopupMenu SelectBlankFolder,pos={8,80},size={180,21},proc=IN3_InputPopMenuProc,title="Blank folder", help={"Select folder with Blank data"}
1143        PopupMenu SelectBlankFolder,mode=1,popvalue=temppopStr,value= #"\"---;\"+IN3_GenStringOfFolders(1)"
1144        NVAR IsBlank=root:Packages:Indra3:IsBlank
1145        PopupMenu SelectBlankFolder, disable = IsBlank
1146       
1147        Button ProcessData,pos={5,110},size={110,20},proc=IN3_InputPanelButtonProc,title="Load and process", help={"Load data and process them"}
1148        Button SelectNextSampleAndProcess,pos={120,110},size={145,20},proc=IN3_InputPanelButtonProc,title="Load Process Save next", help={"Select next sample in order - process - and save"}
1149        Button SaveResults,pos={270,110},size={110,20},proc=IN3_InputPanelButtonProc,title="Save Data", help={"Save results into original folder"}
1150        NVAR UserSavedData=root:Packages:Indra3:UserSavedData
1151        if(!UserSavedData)
1152                Button SaveResults fColor=(65280,0,0)
1153                TitleBox SavedData pos={200,135}, title="  Data   NOT   saved  ", fColor=(0,0,0), frame=1,labelBack=(65280,0,0)
1154        else
1155                Button SaveResults
1156                TitleBox SavedData pos={200,135}, title="  Data   are   saved  ", fColor=(0,0,0),labelBack=(47872,47872,47872),  frame=2
1157        endif
1158        SetVariable userFriendlySamplename title="Sample name:",pos={5,160},size={380,20},disable=2, labelBack=(65535,65535,65535)
1159        SetVariable userFriendlySamplename variable=root:Packages:Indra3:userFriendlySamplename,format="",limits={-1,1,1}
1160        SetVariable userFriendlySamplename frame=0,fstyle=1,help={"Name of current data set loaded"}
1161
1162        SetVariable OriginalDataFolder title="Folder name:",pos={5,180},size={380,20},disable=2, labelBack=(65535,65535,65535)
1163        SetVariable OriginalDataFolder variable=root:Packages:Indra3:userFriendlySampleDFName,format="",limits={-1,1,1}
1164        SetVariable OriginalDataFolder frame=0,fstyle=1,help={"Folder from which current data set was loaded"}
1165
1166
1167
1168        //Data Tabs definition
1169        TabControl DataTabs,pos={2,200},size={380,320},proc=NI3_TabPanelControl
1170        TabControl DataTabs,tabLabel(0)="Sample",tabLabel(1)="Diode"
1171        TabControl DataTabs,tabLabel(2)="Geometry",tabLabel(3)="Calibration",tabLabel(4)="MSAXS", value= 0
1172        //tab 0 Sample controls
1173        NVAR CalculateWeight=root:Packages:Indra3:CalculateWeight
1174        NVAR CalculateThickness=root:Packages:Indra3:CalculateThickness
1175        NVAR CalibrateToWeight=root:Packages:Indra3:CalibrateToWeight
1176        NVAR CalibrateToVolume=root:Packages:Indra3:CalibrateToVolume
1177        NVAR CalibrateArbitrary=root:Packages:Indra3:CalibrateArbitrary
1178
1179        CheckBox CalibrateArbitrary,pos={20,225},size={90,14},proc=IN3_MainPanelCheckBox,title="Calibrate Arbitrary"
1180        CheckBox CalibrateArbitrary,variable= root:Packages:Indra3:CalibrateArbitrary, help={"Check, if you not want to calibrate data"}
1181        CheckBox CalibrateToVolume,pos={20,240},size={90,14},proc=IN3_MainPanelCheckBox,title="Calibrate [cm2/cm3]"
1182        CheckBox CalibrateToVolume,variable= root:Packages:Indra3:CalibrateToVolume, help={"Check, if you want to calibrate data to sample volume"}
1183        CheckBox CalibrateToWeight,pos={20,255},size={90,14},proc=IN3_MainPanelCheckBox,title="Calibrate [cm2/g]"
1184        CheckBox CalibrateToWeight,variable= root:Packages:Indra3:CalibrateToWeight, help={"Check, if you want to calibrate data to sample weight"}
1185
1186        CheckBox CalculateThickness,pos={220,230},size={90,14},proc=IN3_MainPanelCheckBox,title="Calculate Thickness"
1187        CheckBox CalculateThickness,variable= root:Packages:Indra3:CalculateThickness, help={"Check, if you want to calculate sample thickness from transmission"}
1188
1189        CheckBox CalculateWeight,pos={220,252},size={90,14},proc=IN3_MainPanelCheckBox,title="Calculate Weight", disable=CalibrateToVolume
1190        CheckBox CalculateWeight,variable= root:Packages:Indra3:CalculateWeight, help={"Check, if you want to calculate sample weight from transmission"}
1191
1192        SetVariable SampleThickness,pos={5,285},size={280,22},title="\Zr120Sample Thickness [mm] =", bodyWidth=100
1193        SetVariable SampleThickness ,proc=IN3_ParametersChanged
1194        SetVariable SampleThickness,limits={0,Inf,0},variable= root:Packages:Indra3:SampleThickness, noedit=(CalculateThickness||CalculateWeight)//, frame=!(CalculateThickness&&CalculateWeight)
1195        SetVariable OverideSampleThickness ,pos={555,285}
1196
1197        Button RecoverDefault,pos={290,283},size={80,20} ,proc=IN3_InputPanelButtonProc,title="Spec value", help={"Reload original value from spec record"}
1198
1199        SetVariable SampleTransmission,pos={5,335},size={280,22},title="\Zr120Sample Transmission ="
1200        SetVariable SampleTransmission ,bodyWidth=100, proc=IN3_ParametersChanged
1201        SetVariable SampleTransmission,limits={0,Inf,0},variable= root:Packages:Indra3:SampleTransmission, noedit=0, frame=0
1202
1203        SetVariable SampleLinAbsorption,pos={5,360},size={280,22},title="\Zr120Sample absorp. coef [1/cm] ="
1204        SetVariable SampleLinAbsorption ,proc=IN3_ParametersChanged, bodyWidth=100
1205        SetVariable SampleLinAbsorption,limits={0,Inf,0},variable= root:Packages:Indra3:SampleLinAbsorption, noedit=!CalculateThickness, frame=CalculateThickness
1206
1207        SetVariable SampleDensity,pos={5,385},size={280,22},title="\Zr120Sample density [g/cm3] ="
1208        SetVariable SampleDensity ,proc=IN3_ParametersChanged, bodyWidth=100
1209        SetVariable SampleDensity,limits={0,Inf,0},variable= root:Packages:Indra3:SampleDensity, noedit=!CalculateWeight, frame=CalculateWeight
1210
1211        SetVariable SampleWeightInBeam,pos={5,410},size={300,22},title="\Zr120Sample weight [g/cm2 bm area] ="
1212        SetVariable SampleWeightInBeam ,proc=IN3_ParametersChanged, bodyWidth=100
1213        SetVariable SampleWeightInBeam,limits={0,Inf,0},variable= root:Packages:Indra3:SampleWeightInBeam, noedit=CalculateWeight, frame=!CalculateWeight
1214
1215        SetVariable SampleFilledFraction,pos={5,410},size={280,22},title="\Zr120Sample filled fraction =", help={"amount of sample filled by material, 1 - porosity as fraction"}
1216        SetVariable SampleFilledFraction ,proc=IN3_ParametersChanged, bodyWidth=100
1217        SetVariable SampleFilledFraction,limits={0,Inf,0},variable= root:Packages:Indra3:SampleFilledFraction, noedit=!CalculateThickness, frame=CalculateThickness
1218
1219        SetVariable USAXSPinTvalue,pos={5,435},size={280,22},title="\Zr120pinDiode Transmission  =", help={"If exists, measured transmission by pin diode"}
1220        SetVariable USAXSPinTvalue , bodyWidth=100
1221        SetVariable USAXSPinTvalue,limits={0,1,0},variable= root:Packages:Indra3:USAXSPinTvalue, noedit=1, frame=CalculateWeight
1222
1223        CheckBox UsePinTransmission,pos={290,437},size={90,14},proc=IN3_MainPanelCheckBox,title="Use?"//, disable=CalibrateToVolume
1224        CheckBox UsePinTransmission,variable= root:Packages:Indra3:UsePinTransmission, help={"Use pin diode trnamission (if exists)"}
1225
1226        SetVariable PeakToPeakTransmission,pos={5,455},size={300,22},title="\Zr120Peak-to-Peak T =", frame=0, noedit=1
1227        SetVariable PeakToPeakTransmission, bodyWidth=100
1228        SetVariable PeakToPeakTransmission,limits={0,Inf,0},variable= root:Packages:Indra3:SampleTransmissionPeakToPeak
1229        SetVariable MSAXSCorrectionT0,pos={5,475},size={300,22},title="MSAXS/SAXS Cor =", frame=0, noedit=1
1230        SetVariable MSAXSCorrectionT0 , bodyWidth=100
1231        SetVariable MSAXSCorrectionT0,limits={0,Inf,0},variable= root:Packages:Indra3:MSAXSCorrection
1232
1233        SetVariable FlyScanRebinToPoints,pos={5,495},size={300,22},title="\Zr120FlyScan rebin to ="
1234        SetVariable FlyScanRebinToPoints ,bodyWidth=100, proc=IN3_ParametersChanged
1235        SetVariable FlyScanRebinToPoints,limits={0,Inf,0},variable= root:Packages:Indra3:FlyScanRebinToPoints
1236
1237        //tab 2 - geometry controls
1238
1239        SetVariable SpecCommand,pos={8,230},size={370,22},disable=2,title="Command:"
1240        SetVariable SpecCommand , frame=0,fstyle=1
1241        SetVariable SpecCommand,limits={0,Inf,0},variable= root:Packages:Indra3:SpecCommand
1242
1243        SetVariable PhotoDiodeSize,pos={8,250},size={250,22},title="PD size [mm] ="
1244        SetVariable PhotoDiodeSize ,proc=IN3_ParametersChanged
1245        SetVariable PhotoDiodeSize,limits={0,Inf,0},variable= root:Packages:Indra3:PhotoDiodeSize
1246        SetVariable Wavelength,pos={8,275},size={250,22},title="Wavelength [A] ="
1247        SetVariable Wavelength ,proc=IN3_ParametersChanged
1248        SetVariable Wavelength,limits={0,Inf,0},variable= root:Packages:Indra3:Wavelength
1249        SetVariable SDDistance,pos={8,300},size={250,22},title="SD distance [mm] ="
1250        SetVariable SDDistance ,proc=IN3_ParametersChanged
1251        SetVariable SDDistance,limits={0,Inf,0},variable= root:Packages:Indra3:SDDistance
1252
1253        SetVariable SlitLength,pos={8,325},size={250,22},title="Slit Length [A^-1] =", frame=0, disable=2
1254        SetVariable SlitLength ,proc=IN3_ParametersChanged
1255        SetVariable SlitLength,limits={0,Inf,0},variable= root:Packages:Indra3:SlitLength
1256        SetVariable NumberOfSteps,pos={8,350},size={250,22},title="Number of steps =", disable=2, frame=0
1257        SetVariable NumberOfSteps ,proc=IN3_ParametersChanged
1258        SetVariable NumberOfSteps,limits={0,Inf,0},variable= root:Packages:Indra3:NumberOfSteps
1259
1260
1261        //tab 1 Diode controls
1262        SetVariable VtoF,pos={29,230},size={200,22},proc=IN3_UPDParametersChanged,title="UPD V to f factor :"
1263        SetVariable VtoF ,format="%3.1e"
1264        SetVariable VtoF,limits={0,Inf,0},value= root:Packages:Indra3:UPD_Vfc
1265        SetVariable Gain1,pos={29,255},size={200,22},proc=IN3_UPDParametersChanged,title="Gain 1 :"
1266        SetVariable Gain1 ,format="%3.1e",labelBack=(65280,0,0)
1267        SetVariable Gain1,limits={0,Inf,0},value= root:Packages:Indra3:UPD_G1
1268        SetVariable Gain2,pos={29,277},size={200,22},proc=IN3_UPDParametersChanged,title="Gain 2 :"
1269        SetVariable Gain2 ,format="%3.1e",labelBack=(0,52224,0)
1270        SetVariable Gain2,limits={0,Inf,0},value= root:Packages:Indra3:UPD_G2
1271        SetVariable Gain3,pos={29,299},size={200,22},proc=IN3_UPDParametersChanged,title="Gain 3 :"
1272        SetVariable Gain3 ,format="%3.1e",labelBack=(0,0,65280)
1273        SetVariable Gain3,limits={0,Inf,0},value= root:Packages:Indra3:UPD_G3
1274        SetVariable Gain4,pos={29,321},size={200,22},proc=IN3_UPDParametersChanged,title="Gain 4 :"
1275        SetVariable Gain4 ,format="%3.1e",labelBack=(65280,35512,15384)
1276        SetVariable Gain4,limits={0,Inf,0},value= root:Packages:Indra3:UPD_G4
1277        SetVariable Gain5,pos={29,343},size={200,22},proc=IN3_UPDParametersChanged,title="Gain 5 :"
1278        SetVariable Gain5 ,format="%3.1e",labelBack=(29696,4096,44800)
1279        SetVariable Gain5,limits={0,Inf,0},value= root:Packages:Indra3:UPD_G5
1280        NVAR UPD_DK1Err=root:packages:Indra3:UPD_DK1Err
1281        NVAR UPD_DK2Err=root:packages:Indra3:UPD_DK2Err
1282        NVAR UPD_DK3Err=root:packages:Indra3:UPD_DK3Err
1283        NVAR UPD_DK4Err=root:packages:Indra3:UPD_DK4Err
1284        NVAR UPD_DK5Err=root:packages:Indra3:UPD_DK5Err
1285        SetVariable Bkg1,pos={20,365},size={200,18},proc=IN3_UPDParametersChanged,title="Background 1"
1286        SetVariable Bkg1 ,format="%g", labelBack=(65280,0,0)
1287        SetVariable Bkg1,limits={-inf,Inf,UPD_DK1Err},value= root:Packages:Indra3:UPD_DK1
1288        SetVariable Bkg2,pos={20,387},size={200,18},proc=IN3_UPDParametersChanged,title="Background 2"
1289        SetVariable Bkg2 ,format="%g",labelBack=(0,52224,0)
1290        SetVariable Bkg2,limits={-inf,Inf,UPD_DK2Err},value= root:Packages:Indra3:UPD_DK2
1291        SetVariable Bkg3,pos={20, 409},size={200,18},proc=IN3_UPDParametersChanged,title="Background 3"
1292        SetVariable Bkg3 ,format="%g",labelBack=(0,0,65280)
1293        SetVariable Bkg3,limits={-inf,Inf,UPD_DK3Err},value= root:Packages:Indra3:UPD_DK3
1294        SetVariable Bkg4,pos={20,431},size={200,18},proc=IN3_UPDParametersChanged,title="Background 4"
1295        SetVariable Bkg4 ,format="%g",labelBack=(65280,35512,15384)
1296        SetVariable Bkg4,limits={-inf,Inf,UPD_DK4Err},value= root:Packages:Indra3:UPD_DK4
1297        SetVariable Bkg5,pos={20,453},size={200,18},proc=IN3_UPDParametersChanged,title="Background 5"
1298        SetVariable Bkg5 ,format="%g",labelBack=(29696,4096,44800)
1299        SetVariable Bkg5,limits={-inf,Inf,UPD_DK5Err},value= root:Packages:Indra3:UPD_DK5
1300        SetVariable Bkg1Err,pos={225,365},size={90,18},title="Err"
1301        SetVariable Bkg1Err ,format="%2.2g", labelBack=(65280,0,0)
1302        SetVariable Bkg1Err,limits={-inf,Inf,0},value= root:Packages:Indra3:UPD_DK1Err,noedit=1
1303        SetVariable Bkg2Err,pos={225,387},size={90,18},title="Err"
1304        SetVariable Bkg2Err ,format="%2.2g", labelBack=(0,52224,0)
1305        SetVariable Bkg2Err,limits={-inf,Inf,0},value= root:Packages:Indra3:UPD_DK2Err,noedit=1
1306        SetVariable Bkg3Err,pos={225,409},size={90,18},title="Err"
1307        SetVariable Bkg3Err ,format="%2.2g", labelBack=(0,0,65280)
1308        SetVariable Bkg3Err,limits={-inf,Inf,0},value= root:Packages:Indra3:UPD_DK3Err,noedit=1
1309        SetVariable Bkg4Err,pos={225,431},size={90,18},title="Err"
1310        SetVariable Bkg4Err ,format="%2.2g", labelBack=(65280,35512,15384)
1311        SetVariable Bkg4Err,limits={-inf,Inf,0},value= root:Packages:Indra3:UPD_DK4Err,noedit=1
1312        SetVariable Bkg5Err,pos={225,453},size={90,18},title="Err"
1313        SetVariable Bkg5Err ,format="%2.2g", labelBack=(29696,4096,44800)
1314        SetVariable Bkg5Err,limits={-inf,Inf,0},value= root:Packages:Indra3:UPD_DK5Err,noedit=1
1315        SetVariable Bkg5Overwrite,pos={20,475},size={300,18},proc=IN3_UPDParametersChanged,title="Overwrite Background 5"
1316        SetVariable Bkg5Overwrite ,format="%g"
1317        SetVariable Bkg5Overwrite,limits={0,Inf,0},value= root:Packages:Indra3:OverwriteUPD_DK5
1318        SetVariable SubtractFlatBackground,pos={8,497},size={300,22},title="Subtract Flat background=", frame=1
1319        SetVariable SubtractFlatBackground ,proc=IN3_ParametersChanged
1320        SetVariable SubtractFlatBackground,limits={0,Inf,1},variable= root:Packages:Indra3:SubtractFlatBackground
1321
1322
1323//calibration stuff...
1324        SetVariable MaximumIntensity,pos={8,230},size={300,22},title="Sample Maximum Intensity =", frame=0, disable=2
1325        SetVariable MaximumIntensity,limits={0,Inf,0},variable= root:Packages:Indra3:MaximumIntensity
1326        SetVariable PeakWidth,pos={8,250},size={300,22},title="Sample Peak Width [deg]=", frame=0, disable=2
1327        SetVariable PeakWidth,limits={0,Inf,0},variable= root:Packages:Indra3:PeakWidth
1328        SetVariable PeakWidthArcSec,pos={8,270},size={300,22},title="Sample Peak Width [arc sec]=", frame=0, disable=2
1329        SetVariable PeakWidthArcSec,limits={0,Inf,0},variable= root:Packages:Indra3:PeakWidthArcSec
1330
1331        SetVariable BlankMaximum,pos={8,300},size={300,22},title="Blank Maximum Intensity =  ", frame=1
1332        SetVariable BlankMaximum ,proc=IN3_ParametersChanged
1333        SetVariable BlankMaximum,limits={0,Inf,0},variable= root:Packages:Indra3:BlankMaximum
1334        SetVariable BlankWidth,pos={8,320},size={300,22},title="Blank Peak Width [deg] =    ", frame=1
1335        SetVariable BlankWidth ,proc=IN3_ParametersChanged
1336        SetVariable BlankWidth,limits={0,Inf,0},variable= root:Packages:Indra3:BlankFWHM
1337        SetVariable BlankWidthArcSec,pos={8,340},size={300,22},title="Blank Peak Width [arc sec]=", frame=1
1338        SetVariable BlankWidthArcSec ,proc=IN3_ParametersChanged
1339        SetVariable BlankWidthArcSec,limits={0,Inf,0},variable= root:Packages:Indra3:BlankWidth
1340
1341        Button RecoverDefaultBlnkVals,pos={200,370},size={80,20} ,proc=IN3_InputPanelButtonProc,title="Spec values", help={"Reload original value from spec record"}
1342
1343        CheckBox CalibrateUseSampleFWHM,pos={8,440},size={300,14},proc=IN3_MainPanelCheckBox,title="Use Sample FWHM for calibration?"
1344        CheckBox CalibrateUseSampleFWHM,variable= root:Packages:Indra3:CalibrateUseSampleFWHM, help={"Check, if you want to use FWHM for absolute intensity calibration"}
1345       
1346
1347//MSAXS stuff
1348        CheckBox UseMSAXSCorrection,pos={8,230},size={300,14},proc=IN3_MainPanelCheckBox,title="MSAXS correctinon absolute intensity?"
1349        CheckBox UseMSAXSCorrection,variable= root:Packages:Indra3:UseMSAXSCorrection, help={"Check, if you want to use MSAXS correction"}
1350
1351        SetVariable MSAXSCorrection,pos={8,250},size={300,22},title="MSAXS Correction =", frame=0, disable=2
1352        SetVariable MSAXSCorrection,limits={0,Inf,0},variable= root:Packages:Indra3:MSAXSCorrection
1353        SetVariable MSAXSStartPoint,pos={8,270},size={300,22},title="MSAXS start point =", frame=0, disable=2
1354        SetVariable MSAXSStartPoint,limits={0,Inf,0},variable= root:Packages:Indra3:MSAXSStartPoint
1355        SetVariable MSAXSEndPoint,pos={8,290},size={300,22},title="MSAXS end point =", frame=0, disable=2
1356        SetVariable MSAXSEndPoint,limits={0,Inf,0},variable= root:Packages:Indra3:MSAXSEndPoint
1357        setDataFolder OldDf
1358        NI3_TabPanelControl("",0)
1359
1360        CheckBox RemoveDropouts,pos={8,525},size={150,14},title="Remove Flyscan dropouts?", proc=IN3_MainPanelCheckBox
1361        CheckBox RemoveDropouts,variable= root:Packages:Indra3:RemoveDropouts, help={"Check, if you want to remove flyscan dropouts"}
1362        SetVariable RemoveDropoutsAvePnts,pos={8,545},size={150,22},title="Intg. pnts (~50) =", frame=1
1363        SetVariable RemoveDropoutsAvePnts,limits={10,100,10},variable= root:Packages:Indra3:RemoveDropoutsAvePnts, proc=IN3_ParametersChanged
1364
1365        SetVariable RemoveDropoutsTime,pos={200,525},size={180,22},title="Drpt. Time [s] =", frame=1
1366        SetVariable RemoveDropoutsTime,limits={0.01,5,0.1},variable= root:Packages:Indra3:RemoveDropoutsTime, proc=IN3_ParametersChanged
1367        SetVariable RemoveDropoutsFraction,pos={200,545},size={180,22},title="Drp Int. fract. (0.1-0.7) =", frame=1
1368        SetVariable RemoveDropoutsFraction,limits={0,1,0.1},variable= root:Packages:Indra3:RemoveDropoutsFraction, proc=IN3_ParametersChanged
1369
1370        CheckBox FindMinQForData,pos={10,610},size={150,14},title="Find MinQ automatically?", noproc
1371        CheckBox FindMinQForData,variable= root:Packages:Indra3:FindMinQForData, help={"Check, if you want to locate min-q for data start"}
1372        SetVariable MinQMinFindRatio,pos={200,610},size={150,22},title="I_S/I_Bl ratio =", frame=1
1373        SetVariable MinQMinFindRatio,limits={1,10,0.1},variable= root:Packages:Indra3:MinQMinFindRatio, noproc
1374
1375       
1376        Button Recalculate,pos={50,635},size={120,20},proc=IN3_InputPanelButtonProc,title="Recalculate", help={"Recalculate the data"}
1377        Button RemovePoint,pos={200,635},size={170,20},proc=IN3_InputPanelButtonProc,title="Remove point with csr A", help={"Remove point with cursor A"}
1378end
1379
1380
1381//*****************************************************************************************************************
1382//*****************************************************************************************************************
1383//*****************************************************************************************************************
1384//*****************************************************************************************************************
1385//*****************************************************************************************************************
1386
1387//*****************************************************************************************************************
1388//*****************************************************************************************************************
1389//*****************************************************************************************************************
1390//*****************************************************************************************************************
1391
1392Function IN3_GenerateReadMe()
1393        Dowindow USAXSQuickManual
1394        if (V_flag)
1395                Dowindow/F USAXSQuickManual
1396                abort
1397        endif
1398        String nb = "USAXSQuickManual"
1399        NewNotebook/N=$nb/F=1/V=1/K=3/W=(464,45,1152,768) as "Read Me"
1400        Notebook $nb defaultTab=36, magnification=150
1401        Notebook $nb showRuler=1, rulerUnits=2, updating={1, 3600}
1402        Notebook $nb newRuler=Normal, justification=0, margins={0,0,468}, spacing={0,0,0}, tabs={}, rulerDefaults={"Arial",9,0,(0,0,0)}
1403        Notebook $nb newRuler=Header, justification=0, margins={0,0,468}, spacing={0,0,0}, tabs={}, rulerDefaults={"Arial",14,0,(0,0,0)}
1404        Notebook $nb ruler=Header, text="Quick Manual for Indra 2 version of USAXS macros\r"
1405        Notebook $nb ruler=Normal, text="This is version 1.90 of Indra macros, date: 2/20/2017\r"
1406        Notebook $nb text="\r"
1407        Notebook $nb text="Data reduction summary:\r"
1408        Notebook $nb ruler=Normal; Notebook $nb  margins={0,35,468}
1409        Notebook $nb text="1.\tImport data: menu \"USAXS\" - \"Import and Reduce USAXS data\". ", fStyle=1
1410        Notebook $nb text="ONLY if you have Flyscan Nexus files as input", fStyle=-1, text=". ", fStyle=4, text="Most common"
1411        Notebook $nb fStyle=-1
1412        Notebook $nb text=". Opens GUI which can import data and process them at the same time. Follow procedure in step 3. \r"
1413        Notebook $nb text="2.\tAlternative: \r"
1414        Notebook $nb text="\ta.\tmenu \"USAXS\" - \"Other input methods\" - \"Import USAXS .... data\" - imports either Flyscan Nexus data,"
1415        Notebook $nb text=" Step scan data from spec file or Osmic-Rigaku data. Opens separate GUI to import appropriate data type."
1416        Notebook $nb text=" \r"
1417        Notebook $nb text="\tb. \tmenu \"USAXS\" - \"Other input methods\" - \"Reduce data \"    This will open GUI panel which is used to "
1418        Notebook $nb text="reduce data imported in step 2a. Follow procedure in step 3. \r"
1419        Notebook $nb text="3.\tProcess data - FIRST you need instrumental curve  (\"Process as Blank\"). Save processed instrumental c"
1420        Notebook $nb text="urve (Blank). With ", fStyle=1, text="correct", fStyle=-1, text=" Blank you can process samples. \r"
1421        Notebook $nb text="\tIf you want absolute intensities, you will need to know the sample thickness at this time.  If you don'"
1422        Notebook $nb text="t have that \tnow, you will need to repeat this procedure from this step. [NOTE: not exactly true, you ca"
1423        Notebook $nb text="n calculate it, if you \tknow linear absorption coefficient]\r"
1424        Notebook $nb text="\tIf we measured USAXS transmission (most likely) using pinDiode, it will be used automatically ("
1425        Notebook $nb fStyle=4, text="MSAXS correction is not needed", fStyle=-1
1426        Notebook $nb text=") If we did not measure pinDIode, may be you need to use MSAXS correction - but only if data are contami"
1427        Notebook $nb text="nated by mulitple scattering in the main tool. Check with staff. \r"
1428        Notebook $nb text="\tIf you use FlyScan, you may need to select FlyScan rebin to number of points...\r"
1429        Notebook $nb text="\tFor regular samples - 200 - 300 points\r"
1430        Notebook $nb text="\tFor Samples with monodispersed systems/diff peaks: more (up to 1000-2000) may be necessary\r"
1431        Notebook $nb text="\tDo NOT produce needlesly too many points - data will take much more time to analyze.  \r"
1432        Notebook $nb ruler=Normal, text="4.\tOther possible useful tools:\r"
1433        Notebook $nb text="\tTo Desmear data you will need Irena package which contains the desmearing routine in \"Other tools\"\r"
1434        Notebook $nb text="\t\"USAXS->USAXS Plotting tools\" - preferably use Irena \"Plotting tool I\"\r"
1435        Notebook $nb text="\t\t\"Standard ....\"\t standard USAXS type plots (Int-Q, Porod plot, Guinier plot)\r"
1436        Notebook $nb text="\t\t\"Basic ....\"\toffers wave variables most likely to be used in USAXS plots\r"
1437        Notebook $nb text="\t\t\"Generic ....\"\tallows user to plot any available wave variables (only one for non-USAXS data)\r"
1438        Notebook $nb ruler=Normal; Notebook $nb  margins={0,34,468}
1439        Notebook $nb text="5.\tTo export data use Irena, data export tool. But if you need to export ASCII data, they should be desm"
1440        Notebook $nb text="eared first, very likely... Keep that in mind. \r"
1441        Notebook $nb ruler=Normal, text="\t\r"
1442        Notebook $nb text="Suggestions: \r"
1443        Notebook $nb text="a.\tSave Igor experiment once in a while.\r"
1444        Notebook $nb text="b.\tDo not work with Igor files over an NFS network connection, first copy those files to a local disk.\r"
1445        Notebook $nb text="c.\tUse automatic logging functions -  \r"
1446        Notebook $nb text="\tmenu \"USAXS\" - \"Log in Notebook\" - \"Create logbook\" and \"Create Summary Notebook\". \r"
1447        Notebook $nb text="\r"
1448        Notebook $nb text="Make notes of any bugs and forward them to me. Make notes of any suggestions on changes in the wording o"
1449        Notebook $nb text="f dialogs - I am opened to any reasonable changes....\r"
1450end
1451
Note: See TracBrowser for help on using the repository browser.