 Timestamp:
 Feb 2, 2017 9:52:47 AM (6 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DataPlotting.ipf
r999 r1022 13 13 // simple entry procedure 14 14 // 15 Function V_PlotData_Panel()16 DoWindow V_1D_Data17 if(V_flag==0)18 Execute "V_DrawPlotPanel()"19 else20 SVAR type = root:Packages:NIST:VSANS:Globals:gCurDispType21 22 V_QBinAllPanels(type)23 24 // TODO:25 // x "B" detector is currently skipped  Q is not yet calculated26 Execute ("V_Back_IQ_Graph(\""+type+"\")")27 Execute ("V_Middle_IQ_Graph(\""+type+"\")")28 Execute ("V_Front_IQ_Graph(\""+type+"\")")29 endif30 End31 32 33 15 // graph with the 1D representation of the VSANS detectors 34 16 // … … 42 24 //  see Middle_IQ_Graph() and similar for how VCALC does this plot 43 25 // 44 Proc V_DrawPlotPanel() 45 46 String type = root:Packages:NIST:VSANS:Globals:gCurDispType 47 48 PauseUpdate; Silent 1 // building window... 49 Display /W=(277,526,748,938)/N=V_1D_Data 26 //  when/if I want to add phiaveraging to this, go gack to AvgGraphics.ipf for the pink panel 27 // and to the function Draw_Plot1D() for the drawing of the plot 28 // 29 Function V_PlotData_Panel() 30 31 32 DoWindow V_1D_Data 33 if(V_flag==0) 34 35 Display /W=(277,526,748,938)/N=V_1D_Data/K=1 36 // Display /W=(476,96,850,429)/N=V_1D_Data/K=1 37 ControlBar 70 38 39 PopupMenu popup0,pos={16,5},size={71,20},title="Bin Type" 40 PopupMenu popup0,help={"This popup selects how the yaxis will be linearized based on the chosen data"} 41 PopupMenu popup0,value= "One;Two;Four;Slit Mode;" 42 PopupMenu popup0,mode=1,proc=V_BinningModePopup 43 // PopupMenu ymodel,pos={16,5},size={71,20},title="yaxis" 44 // PopupMenu ymodel,help={"This popup selects how the yaxis will be linearized based on the chosen data"} 45 // PopupMenu ymodel,value= #"\"I;log(I);ln(I);1/I;I^a;Iq^a;I^a q^b;1/sqrt(I);ln(Iq);ln(Iq^2)\"" 46 // PopupMenu ymodel,mode=NumVarOrDefault("root:myGlobals:Plot_1d:gYMode", 1 ),proc=YMode_PopMenuProc 47 // PopupMenu xmodel,pos={150,5},size={74,20},title="xaxis" 48 // PopupMenu xmodel,help={"This popup selects how the xaxis will be linearized given the chosen data"} 49 // PopupMenu xmodel,value= #"\"q;log(q);q^2;q^c\"" 50 // PopupMenu xmodel,mode=NumVarOrDefault("root:myGlobals:Plot_1d:gXMode", 1 ),proc=XMode_PopMenuProc 51 // Button Rescale,pos={281,4},size={70,20},proc=Rescale_Plot_1D_ButtonProc,title="Rescale" 52 // Button Rescale,help={"Rescale the x and yaxes of the data"},disable=1 53 54 // SetVariable expa,pos={28,28},size={80,15},title="pow \"a\"" 55 // SetVariable expa,help={"This sets the exponent \"a\" for some yaxis formats. The value is ignored if the model does not use an adjustable exponent"} 56 // SetVariable expa,limits={2,10,0},value= root:myGlobals:Plot_1d:gExpA 57 // SetVariable expb,pos={27,46},size={80,15},title="pow \"b\"" 58 // SetVariable expb,help={"This sets the exponent \"b\" for some xaxis formats. The value is ignored if the model does not use an adjustable exponent"} 59 // SetVariable expb,limits={0,10,0},value= root:myGlobals:Plot_1d:gExpB 60 // 61 // SetVariable expc,pos={167,28},size={80,15},title="pow \"c\"" 62 // SetVariable expc,help={"This sets the exponent \"c\" for some xaxis formats. The value is ignored if the model does not use \"c\" as an adjustable exponent"} 63 // SetVariable expc,limits={10,10,0},value= root:myGlobals:Plot_1d:gExpC 64 65 Button AllQ,pos={281,28},size={70,20},proc=V_AllQ_Plot_1D_ButtonProc,title="All Q" 66 Button AllQ,help={"Show the full qrange of the dataset"} 67 68 endif 69 70 71 SVAR type = root:Packages:NIST:VSANS:Globals:gCurDispType 50 72 51 73 V_QBinAllPanels(type) 52 74 53 // TODO 75 // TODO: 54 76 // x "B" detector is currently skipped  Q is not yet calculated 55 V_Back_IQ_Graph(type) 56 V_Middle_IQ_Graph(type) 57 V_Front_IQ_Graph(type) 58 59 End 60 61 77 Execute ("V_Back_IQ_Graph(\""+type+"\")") 78 Execute ("V_Middle_IQ_Graph(\""+type+"\")") 79 Execute ("V_Front_IQ_Graph(\""+type+"\")") 80 81 82 End 83 84 //function to restore the graph axes to full scale, undoing any zooming 85 Function V_AllQ_Plot_1D_ButtonProc(ctrlName) : ButtonControl 86 String ctrlName 87 88 // DoWindow/F V_1D_Data 89 SetAxis/A 90 End 91 92 93 // 94 // recalculate the I(q) binning. no need to adjust model function or views 95 // just rebin 96 // 97 Function V_BinningModePopup(ctrlName,popNum,popStr) : PopupMenuControl 98 String ctrlName 99 Variable popNum // which item is currently selected (1based) 100 String popStr // contents of current popup item as string 101 102 SVAR type = root:Packages:NIST:VSANS:Globals:gCurDispType 103 104 V_QBinAllPanels(type) 105 106 Execute ("V_Back_IQ_Graph(\""+type+"\")") 107 Execute ("V_Middle_IQ_Graph(\""+type+"\")") 108 Execute ("V_Front_IQ_Graph(\""+type+"\")") 109 110 return(0) 111 End 112 113 Function V_GetBinningPopMode() 114 115 Variable binType 116 ControlInfo/W=V_1D_Data popup0 117 strswitch(S_Value) // string switch 118 case "One": 119 binType = 1 120 break // exit from switch 121 case "Two": 122 binType = 2 123 break // exit from switch 124 case "Four": 125 binType = 3 126 break // exit from switch 127 case "Slit Mode": 128 binType = 4 129 break // exit from switch 130 131 default: // optional default expression executed 132 binType = 0 133 Abort "Binning mode not found in V_QBinAllPanels() "// when no case matches 134 endswitch 135 136 return(binType) 137 end 62 138 63 139 // … … 68 144 // 69 145 // TODO 70 //  need to set binType 71 //  currently hardwired == 1 72 // 146 // x need to set binType 147 // x currently hardwired == 1 148 // 149 // input "type" is the data type and defines the folder 73 150 // 74 151 Proc V_Middle_IQ_Graph(type) … … 76 153 77 154 Variable binType 78 79 // ControlInfo/W=VCALC popup_b 80 // binType = V_Value // V_value counts menu items from 1, so 1=1, 2=2, 3=4 81 82 binType = 1 155 156 binType = V_GetBinningPopMode() 83 157 SetDataFolder $("root:Packages:NIST:VSANS:"+type) 84 158 85 159 // clear EVERYTHING 160 // ClearAllIQIfDisplayed("MLRTB") 161 // ClearAllIQIfDisplayed("MLR") 162 // ClearAllIQIfDisplayed("MTB") //this returns to root: 163 // ClearAllIQIfDisplayed("MT") 164 // ClearAllIQIfDisplayed("ML") 165 // ClearAllIQIfDisplayed("MR") 166 // ClearAllIQIfDisplayed("MB") 167 168 if(binType==1) 86 169 ClearAllIQIfDisplayed("MLRTB") 87 170 ClearAllIQIfDisplayed("MLR") … … 90 173 ClearAllIQIfDisplayed("ML") 91 174 ClearAllIQIfDisplayed("MR") 92 ClearAllIQIfDisplayed("MB") 93 94 if(binType==1) 95 // ClearAllIQIfDisplayed("MLRTB") 96 // ClearAllIQIfDisplayed("MLR") 97 // ClearAllIQIfDisplayed("MTB") //this returns to root: 98 // ClearAllIQIfDisplayed("MT") 99 // ClearAllIQIfDisplayed("ML") 100 // ClearAllIQIfDisplayed("MR") 101 // ClearAllIQIfDisplayed("MB") 175 ClearAllIQIfDisplayed("MB") 102 176 SetDataFolder $("root:Packages:NIST:VSANS:"+type) 103 177 CheckDisplayed/W=V_1D_Data iBin_qxqy_ML … … 120 194 121 195 if(binType==2) 122 //ClearAllIQIfDisplayed("MLRTB")123 //ClearAllIQIfDisplayed("MT")124 //ClearAllIQIfDisplayed("ML")125 //ClearAllIQIfDisplayed("MR")126 //ClearAllIQIfDisplayed("MB")196 ClearAllIQIfDisplayed("MLRTB") 197 ClearAllIQIfDisplayed("MT") 198 ClearAllIQIfDisplayed("ML") 199 ClearAllIQIfDisplayed("MR") 200 ClearAllIQIfDisplayed("MB") 127 201 128 202 … … 148 222 149 223 if(binType==3) 150 //ClearAllIQIfDisplayed("MLR")151 //ClearAllIQIfDisplayed("MTB")152 //ClearAllIQIfDisplayed("MT")153 //ClearAllIQIfDisplayed("ML")154 //ClearAllIQIfDisplayed("MR")155 //ClearAllIQIfDisplayed("MB")224 ClearAllIQIfDisplayed("MLR") 225 ClearAllIQIfDisplayed("MTB") 226 ClearAllIQIfDisplayed("MT") 227 ClearAllIQIfDisplayed("ML") 228 ClearAllIQIfDisplayed("MR") 229 ClearAllIQIfDisplayed("MB") 156 230 157 231 SetDataFolder $("root:Packages:NIST:VSANS:"+type) … … 173 247 endif 174 248 175 if(binType==4) // slit aperture binning  M t, ML, MR, MB are averaged176 //ClearAllIQIfDisplayed("MLRTB")177 //ClearAllIQIfDisplayed("MLR")178 //ClearAllIQIfDisplayed("MTB")179 180 // SetDataFolder root:Packages:NIST:VSANS:VCALC 249 if(binType==4) // slit aperture binning  MT, ML, MR, MB are averaged 250 ClearAllIQIfDisplayed("MLRTB") 251 ClearAllIQIfDisplayed("MLR") 252 ClearAllIQIfDisplayed("MTB") 253 254 SetDataFolder $("root:Packages:NIST:VSANS:"+type) 181 255 CheckDisplayed/W=V_1D_Data iBin_qxqy_ML 182 256 183 257 if(V_flag==0) 184 Append toGraph/W=V_1D_Data iBin_qxqy_ML vs qBin_qxqy_ML258 AppendToGraph/W=V_1D_Data iBin_qxqy_ML vs qBin_qxqy_ML 185 259 AppendToGraph/W=V_1D_Data iBin_qxqy_MR vs qBin_qxqy_MR 186 260 AppendToGraph/W=V_1D_Data iBin_qxqy_MT vs qBin_qxqy_MT … … 208 282 // 209 283 // TODO 210 //  need to set binType211 //  currently hardwired == 1284 // x need to set binType 285 // x currently hardwired == 1 212 286 // 213 287 // … … 216 290 217 291 Variable binType 218 219 // ControlInfo/W=VCALC popup_b 220 // binType = V_Value // V_value counts menu items from 1, so 1=1, 2=2, 3=4 221 222 binType = 1 292 293 294 binType = V_GetBinningPopMode() 223 295 SetDataFolder $("root:Packages:NIST:VSANS:"+type) 224 296 225 297 // clear EVERYTHING 298 // ClearAllIQIfDisplayed("FLRTB") 299 // 300 // ClearAllIQIfDisplayed("FLR") 301 // ClearAllIQIfDisplayed("FTB") 302 // 303 // ClearAllIQIfDisplayed("FT") 304 // ClearAllIQIfDisplayed("FL") 305 // ClearAllIQIfDisplayed("FR") 306 // ClearAllIQIfDisplayed("FB") 307 308 if(binType==1) 226 309 ClearAllIQIfDisplayed("FLRTB") 227 310 … … 233 316 ClearAllIQIfDisplayed("FR") 234 317 ClearAllIQIfDisplayed("FB") 235 236 if(binType==1)237 // ClearAllIQIfDisplayed("FLRTB")238 //239 // ClearAllIQIfDisplayed("FLR")240 // ClearAllIQIfDisplayed("FTB")241 //242 // ClearAllIQIfDisplayed("FT")243 // ClearAllIQIfDisplayed("FL")244 // ClearAllIQIfDisplayed("FR")245 // ClearAllIQIfDisplayed("FB")246 318 247 319 SetDataFolder $("root:Packages:NIST:VSANS:"+type) … … 265 337 266 338 if(binType==2) 267 // ClearAllIQIfDisplayed("FLRTB") 268 // ClearAllIQIfDisplayed("FT") 269 // ClearAllIQIfDisplayed("FL") 270 // ClearAllIQIfDisplayed("FR") 271 // ClearAllIQIfDisplayed("FB") 272 // 339 ClearAllIQIfDisplayed("FLRTB") 340 ClearAllIQIfDisplayed("FT") 341 ClearAllIQIfDisplayed("FL") 342 ClearAllIQIfDisplayed("FR") 343 ClearAllIQIfDisplayed("FB") 273 344 274 345 SetDataFolder $("root:Packages:NIST:VSANS:"+type) … … 293 364 294 365 if(binType==3) 295 //ClearAllIQIfDisplayed("FLR")296 //ClearAllIQIfDisplayed("FTB")297 //ClearAllIQIfDisplayed("FT")298 //ClearAllIQIfDisplayed("FL")299 //ClearAllIQIfDisplayed("FR")300 //ClearAllIQIfDisplayed("FB")366 ClearAllIQIfDisplayed("FLR") 367 ClearAllIQIfDisplayed("FTB") 368 ClearAllIQIfDisplayed("FT") 369 ClearAllIQIfDisplayed("FL") 370 ClearAllIQIfDisplayed("FR") 371 ClearAllIQIfDisplayed("FB") 301 372 302 373 SetDataFolder $("root:Packages:NIST:VSANS:"+type) … … 318 389 endif 319 390 320 if(binType==4) // slit aperture binning  M t, ML, MR, MB are averaged321 //ClearAllIQIfDisplayed("FLRTB")322 //ClearAllIQIfDisplayed("FLR")323 //ClearAllIQIfDisplayed("FTB")324 325 // SetDataFolder root:Packages:NIST:VSANS:VCALC 391 if(binType==4) // slit aperture binning  MT, ML, MR, MB are averaged 392 ClearAllIQIfDisplayed("FLRTB") 393 ClearAllIQIfDisplayed("FLR") 394 ClearAllIQIfDisplayed("FTB") 395 396 SetDataFolder $("root:Packages:NIST:VSANS:"+type) 326 397 CheckDisplayed/W=V_1D_Data iBin_qxqy_FL 327 398 … … 348 419 349 420 // TODO 350 //  need to set binType351 //  currently hardwired == 1421 // x need to set binType 422 // x currently hardwired == 1 352 423 // 353 424 ////////////to plot the back panel I(q) … … 358 429 359 430 Variable binType 360 361 // ControlInfo/W=VCALC popup_b 362 // binType = V_Value // V_value counts menu items from 1, so 1=1, 2=2, 3=4 363 364 bintype = 1 365 366 SetDataFolder $("root:Packages:NIST:VSANS:"+type) 431 432 binType = V_GetBinningPopMode() 433 434 SetDataFolder $("root:Packages:NIST:VSANS:"+type) 367 435 368 436 if(binType==1  binType==2  binType==3)
Note: See TracChangeset
for help on using the changeset viewer.