- Timestamp:
- Jun 6, 2011 5:01:07 PM (12 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction/Polarization
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/Polarization/PolarizationCorrection.ipf
r802 r803 61 61 62 62 63 Macrocalc_muP(mu, runT_he, runT_out, runT_bk)63 Proc calc_muP(mu, runT_he, runT_out, runT_bk) 64 64 Variable mu=3.108, runT_he, runT_out, runT_bk 65 65 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/Polarization/PolarizationPanels.ipf
r802 r803 15 15 // TODO: 16 16 // Need a way to output the results - like in a report format 17 // cell 17 // cell (panel 1) 18 18 // static params 19 19 // fit gamma params 20 20 // graph 21 21 // 22 // and also a separate report 22 // and also a separate report (panel 2) 23 23 // flipper/sm @ conditions 24 24 // --- the report could be as simple as a screen snapshot of the panel? … … 282 282 // TODO: 283 283 // - parsing routines 284 // - write the res tlts to a waveNote284 // - write the results to a waveNote 285 285 // --- where to store the intermediate results of trans values? 286 286 // make a wave behind the scenes to … … 341 341 PauseUpdate; Silent 1 // building window... 342 342 NewPanel /W=(759,44,1572,713)/N=DecayPanel/K=1 as "Cell Decay Parameters" 343 ModifyPanel cbRGB=( 51152,65535,60441)344 Button button_3,pos={505,16},size={35,20},proc=DecayHelpParButtonProc,title="?"343 ModifyPanel cbRGB=(32768,54615,65535) 344 // Button button_3,pos={505,16},size={35,20},proc=DecayHelpParButtonProc,title="?" 345 345 PopupMenu popup_0,pos={32,18},size={49,20},title="Cell",proc=DecayPanelPopMenuProc 346 346 PopupMenu popup_0,mode=1,value= #"D_CellNameList()" … … 350 350 GroupBox group_0,pos={550,399},size={230,149},title="FIT RESULTS",fSize=10 351 351 GroupBox group_0,fStyle=1 352 SetVariable valdisp_3,pos={560,428},size={200,13},title="muPo of 3He"353 SetVariable valdisp_3,fStyle=1,limits={0,0,0},barmisc={0,1000}354 SetVariable valdisp_3,value= root:Packages:NIST:Polarization:Cells:gMuPo355 SetVariable valdisp_1,pos={560,460},size={200,13},title="Po of 3He"356 SetVariable valdisp_1,fStyle=1,limits={0,0,0},barmisc={0,1000}357 SetVariable valdisp_1,value= root:Packages:NIST:Polarization:Cells:gPo358 SetVariable valdisp_2,pos={560,518},size={200,13},title="Gamma (h)",fStyle=1359 SetVariable valdisp_2,limits={0,0,0},barmisc={0,1000}360 SetVariable valdisp_2,value= root:Packages:NIST:Polarization:Cells:gGamma361 SetVariable setvar_ 0,pos={560,488},size={200,15},title="T0",fStyle=1362 SetVariable setvar_ 0,limits={0,0,0},value= root:Packages:NIST:Polarization:Cells:gT0352 SetVariable setvar_0,pos={560,428},size={200,13},title="muPo of 3He" 353 SetVariable setvar_0,fStyle=1,limits={0,0,0},barmisc={0,1000} 354 SetVariable setvar_0,value= root:Packages:NIST:Polarization:Cells:gMuPo 355 SetVariable setvar_1,pos={560,460},size={200,13},title="Po of 3He" 356 SetVariable setvar_1,fStyle=1,limits={0,0,0},barmisc={0,1000} 357 SetVariable setvar_1,value= root:Packages:NIST:Polarization:Cells:gPo 358 SetVariable setvar_2,pos={560,518},size={200,13},title="Gamma (h)",fStyle=1 359 SetVariable setvar_2,limits={0,0,0},barmisc={0,1000} 360 SetVariable setvar_2,value= root:Packages:NIST:Polarization:Cells:gGamma 361 SetVariable setvar_3,pos={560,488},size={200,15},title="T0",fStyle=1 362 SetVariable setvar_3,limits={0,0,0},value= root:Packages:NIST:Polarization:Cells:gT0 363 363 364 364 … … 415 415 // if not, make it, and the space for the results of the calculation 416 416 MakeDecayResultWaves(popStr) 417 WAVE decay = $(" Decay_"+popStr)417 WAVE decay = $("root:Packages:NIST:Polarization:Cells:Decay_"+popStr) 418 418 endif 419 419 // append matrix, clearing the old one first … … 682 682 // calculate PCell and its error 683 683 // 684 // error calculation is not done yet, returns zero684 // 685 685 Function Calc_PCell(muPo,err_muPo,err_PCell) 686 686 Variable muPo,err_muPo,&err_PCell … … 746 746 // the error is a big mess to calculate, since it's messy argument inside acosh 747 747 arg = (cr1 - cr3)/(cr2 - cr3) * (1/(Te*exp(-mu))) 748 tmp2 = (1/sqrt(arg+1)/sqrt(arg-1))^2 // derivative of acosh(arg) (squared) 749 748 750 // calculate the error of the argument first, then the error of acosh(arg) 749 751 // there are 5 partial derivatives 750 arg_err = ( arg/(cr1 - cr3) * err_cr1 )^2 //CR in 751 arg_err += ( arg/(cr2 - cr3) * err_cr2 )^2 //CR out 752 arg_err += ((-arg/(cr1 - cr3) + arg/(cr2 - cr3) )* err_cr3 )^2//CR bkg 753 arg_err += ( -arg/Te * err_Te )^2 //Te 754 arg_err += ( arg * err_mu )^2 //mu (probably the dominant relative error) 755 756 arg_err = sqrt(arg_err) 757 758 // then the acosh term 759 err_muPo = ( 1/sqrt(arg+1)/sqrt(arg-1) * arg_err )^2 760 err_muPo = sqrt(err_muPo) 752 arg_err = tmp2 * ( arg/(cr1 - cr3) * err_cr1 )^2 //CR in 753 arg_err += tmp2 * ( arg/(cr2 - cr3) * err_cr2 )^2 //CR out 754 arg_err += tmp2 * ((-arg/(cr1 - cr3) + arg/(cr2 - cr3) )* err_cr3 )^2//CR bkg 755 arg_err += tmp2 * ( -arg/Te * err_Te )^2 //Te 756 arg_err += tmp2 * ( arg * err_mu )^2 //mu (probably the dominant relative error) 757 758 err_muPo = sqrt(arg_err) 761 759 762 760 … … 1193 1191 1194 1192 if( (sdd1 != sdd2) || (sdd2 != sdd3) || (sdd1 != sdd3) ) 1195 DoAlert 0,"Files are not all at the same detector distance"1193 DoAlert 0,"Files in row "+num2str(selRow)+" are not all at the same detector distance" 1196 1194 err = 1 1197 1195 endif 1198 1196 1199 1197 if( (atten1 != atten2) || (atten2 != atten3) || (atten1 != atten3) ) 1200 DoAlert 0,"Files are not all collected with the same attenuation. Just so you know."1198 DoAlert 0,"Files in row "+num2str(selRow)+" are not all collected with the same attenuation. Just so you know." 1201 1199 err = 0 1202 1200 endif
Note: See TracChangeset
for help on using the changeset viewer.