Changeset 1041
- Timestamp:
- May 25, 2017 1:29:50 PM (6 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VSANS_Includes.ipf
r1040 r1041 95 95 96 96 #include "V_MultipleReduce" 97 97 #include "V_VSANS_Event_Testing" -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_BeamCenter.ipf
r1034 r1041 11 11 // -- add method to be able to write the values to the local folder / or better, to file on disk 12 12 // -- graphically show the beam center / radius of where it is in relation to the panel 13 // 14 // x- error checking, if data is selected from a folder that does not exist (like VCALC). Otherwise 15 // the user is caught in a long loop of open file dialogs looking for something... 13 16 // 14 17 // -- move everything into it's own folder, rather than root: … … 186 189 folder = S_Value 187 190 191 // error checking -- if the VCALC folder is the target & does not exist, exit now 192 if( cmpstr(folder,"VCALC") == 0 && DataFolderExists("root:Packages:NIST:VSANS:VCALC") == 0) 193 return(0) 194 endif 195 196 // error checking -- if the RAW folder is the target & does not exist, exit now 197 if( cmpstr(folder,"RAW") == 0 && DataFolderExists("root:Packages:NIST:VSANS:RAW:entry") == 0) 198 return(0) 199 endif 200 201 // error checking -- if the SAM folder is the target & does not exist, exit now 202 if( cmpstr(folder,"SAM") == 0 && DataFolderExists("root:Packages:NIST:VSANS:SAM:entry") == 0) 203 return(0) 204 endif 205 188 206 // TODO -- fix all of this mess 189 207 if(cmpstr(folder,"VCALC") == 0) -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_BroadPeak_Pix_2D.ipf
r1024 r1041 69 69 End 70 70 71 72 // 73 // this sets the x and y waves of the triplet to be the pixel numbers 74 // 75 // TODO: 76 // -- this will need to be changed if I want to fit based on real-space mm 77 // 71 78 Function V_FillPixTriplet(xwave_PeakPix2D, ywave_PeakPix2D,zwave_PeakPix2D,xDim,yDim) 72 79 Wave xwave_PeakPix2D, ywave_PeakPix2D,zwave_PeakPix2D -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DetectorCorrections.ipf
r1027 r1041 676 676 // TODO: 677 677 // correctly apply the correction to the error wave (assume a perfect value?) 678 //w_err /= solid_angle //is this correct??678 w_err /= solid_angle //is this correct?? 679 679 680 680 // TODO -- clean up after I'm satisfied computations are correct … … 793 793 794 794 // pass in the transmission error, and the error in the correction is returned as the last parameter 795 lat_corr = V_LargeAngleTransmissionCorr(trans,dtdist,xd,yd,trans_err,lat_err) //moved from 1D avg SRK 11/2007 795 796 // lat_corr = V_LargeAngleTransmissionCorr(trans,dtdist,xd,yd,trans_err,lat_err) //moved from 1D avg SRK 11/2007 797 796 798 data[ii][jj] /= lat_corr //divide by the correction factor 797 799 // … … 822 824 823 825 824 826 // 825 827 // DIVIDE the intensity by this correction to get the right answer 826 828 // TODO: … … 828 830 // 829 831 // 830 Function V_LargeAngleTransmissionCorr(trans,dtdist,xd,yd,trans_err,err) 831 Variable trans,dtdist,xd,yd,trans_err,&err 832 833 DoAlert 0,"This has not yet been updated for VSANS" 834 835 //angle dependent transmission correction 836 Variable uval,arg,cos_th,correction,theta 837 838 ////this section is the trans_correct() VAX routine 839 // if(trans<0.1) 840 // Print "***transmission is less than 0.1*** and is a significant correction" 841 // endif 842 // if(trans==0) 843 // Print "***transmission is ZERO*** and has been reset to 1.0 for the averaging calculation" 844 // trans = 1 845 // endif 846 847 theta = atan( (sqrt(xd^2 + yd^2))/dtdist ) //theta at the input pixel 832 833 // Apply the large angle transmssion correction as the data is converted to WORK 834 // so that whether the data is saved as 2D or 1D, the correction has properly been done. 835 // 836 // This is, however, a SAMPLE dependent calculation, not purely instrument geometry. 837 // 838 Function V_LargeAngleTransmissionCorr(w,w_err,fname,detStr,destPath) 839 Wave w,w_err 840 String fname,detStr,destPath 841 842 Variable sdd,xCtr,yCtr,trans,trans_err,uval 843 844 // get all of the geometry information 845 // orientation = V_getDet_tubeOrientation(fname,detStr) 846 sdd = V_getDet_ActualDistance(fname,detStr) 847 sdd/=100 // sdd in cm, pass in m 848 849 // this is ctr in mm 850 xCtr = V_getDet_beam_center_x_mm(fname,detStr) 851 yCtr = V_getDet_beam_center_y_mm(fname,detStr) 852 trans = V_getSampleTransmission(fname) 853 trans_err = V_getSampleTransError(fname) 854 855 SetDataFolder $(destPath + ":entry:instrument:detector_"+detStr) 856 857 Wave data_realDistX = data_realDistX 858 Wave data_realDistY = data_realDistY 859 860 Duplicate/O w lat_corr,tmp_theta,tmp_dist,lat_err,tmp_err //in the current df 861 862 //// calculate the scattering angle 863 // dx = (distX - xctr) //delta x in mm 864 // dy = (distY - yctr) //delta y in mm 865 tmp_dist = sqrt((data_realDistX - xctr)^2 + (data_realDistY - yctr)^2) 866 867 tmp_dist /= 10 // convert mm to cm 868 sdd *=100 //convert to cm 869 870 tmp_theta = atan(tmp_dist/sdd) //this is two_theta, the scattering angle 871 872 Variable ii,jj,numx,numy,dx,dy,cos_th,arg,tmp 873 numx = DimSize(tmp_theta,0) 874 numy = DimSize(tmp_theta,1) 875 848 876 849 877 //optical thickness 850 878 uval = -ln(trans) //use natural logarithm 851 cos_th = cos(theta) 852 arg = (1-cos_th)/cos_th 853 854 // a Taylor series around uval*arg=0 only needs about 4 terms for very good accuracy 855 // correction= 1 - 0.5*uval*arg + (uval*arg)^2/6 - (uval*arg)^3/24 + (uval*arg)^4/120 856 // OR 857 if((uval<0.01) || (cos_th>0.99)) 858 //small arg, approx correction 859 correction= 1-0.5*uval*arg 860 else 861 //large arg, exact correction 862 correction = (1-exp(-uval*arg))/(uval*arg) 863 endif 864 865 Variable tmp 866 867 if(trans == 1) 868 err = 0 //no correction, no error 869 else 870 //sigT, calculated from the Taylor expansion 871 tmp = (1/trans)*(arg/2-arg^2/3*uval+arg^3/8*uval^2-arg^4/30*uval^3) 872 tmp *= tmp 873 tmp *= trans_err^2 874 tmp = sqrt(tmp) //sigT 875 876 err = tmp 877 endif 878 879 // Printf "trans error = %g\r",trans_err 880 // Printf "correction = %g +/- %g\r", correction, err 881 882 //end of transmission/pathlength correction 883 884 return(correction) 879 880 for(ii=0 ;ii<numx;ii+=1) 881 for(jj=0;jj<numy;jj+=1) 882 883 cos_th = cos(tmp_theta[ii][jj]) 884 arg = (1-cos_th)/cos_th 885 886 // a Taylor series around uval*arg=0 only needs about 4 terms for very good accuracy 887 // correction= 1 - 0.5*uval*arg + (uval*arg)^2/6 - (uval*arg)^3/24 + (uval*arg)^4/120 888 // OR 889 if((uval<0.01) || (cos_th>0.99)) 890 //small arg, approx correction 891 lat_corr[ii][jj] = 1-0.5*uval*arg 892 else 893 //large arg, exact correction 894 lat_corr[ii][jj] = (1-exp(-uval*arg))/(uval*arg) 895 endif 896 897 // TODO 898 // -- properly calculate and apply the 2D error propagation 899 if(trans == 1) 900 lat_err[ii][jj] = 0 //no correction, no error 901 else 902 //sigT, calculated from the Taylor expansion 903 tmp = (1/trans)*(arg/2-arg^2/3*uval+arg^3/8*uval^2-arg^4/30*uval^3) 904 tmp *= tmp 905 tmp *= trans_err^2 906 tmp = sqrt(tmp) //sigT 907 908 lat_err[ii][jj] = tmp 909 endif 910 911 912 endfor 913 endfor 914 915 916 917 // Here it is! Apply the correction to the intensity (divide -- to get the proper correction) 918 w /= lat_corr 919 920 // relative errors add in quadrature to the current 2D error 921 tmp_err = (w_err/lat_corr)^2 + (lat_err/lat_corr)^2*w*w/lat_corr^2 922 tmp_err = sqrt(tmp_err) 923 924 w_err = tmp_err 925 926 // TODO: 927 // correctly apply the correction to the error wave (assume a perfect value?) 928 // w_err /= tmp //is this correct?? 929 930 // TODO -- clean up after I'm satisfied computations are correct 931 KillWaves/Z tmp_theta,tmp_dist,tmp_err,lat_err 932 933 return(0) 885 934 end 886 935 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_Write.ipf
r1040 r1041 6373 6373 // TODO -- needs to be a Text WAVE, and of the proper size and type!!! 6374 6374 // -- this is a test where I write a wave to a field that does not exist... 6375 Function V_write _ProtocolWave(fname,inTW)6375 Function V_writeReductionProtocolWave(fname,inTW) 6376 6376 String fname 6377 6377 Wave/T inTW -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_MainPanel.ipf
r1040 r1041 79 79 End 80 80 81 Proc Patch_XY_MainButtonProc(ctrlName) : ButtonControl 82 String ctrlName 83 84 V_PatchDet_xyCenters_Panel() 85 End 86 87 Proc Patch_DeadTime_MainButtonProc(ctrlName) : ButtonControl 88 String ctrlName 89 90 V_PatchDetectorDeadtimePanel() 91 End 92 93 Proc Patch_Calib_MainButtonProc(ctrlName) : ButtonControl 94 String ctrlName 95 96 V_PatchDetectorCalibrationPanel() 97 End 98 99 81 100 Proc TransMainButtonProc(ctrlName) : ButtonControl 82 101 String ctrlName … … 114 133 115 134 // ShowNSORTPanel() 135 136 End 137 138 Proc Combine1D_MainButtonProc(ctrlName) : ButtonControl 139 String ctrlName 140 141 // ShowCombinePanel() 116 142 V_CombineDataGraph() 117 End118 119 Proc Combine1D_MainButtonProc(ctrlName) : ButtonControl120 String ctrlName121 122 ShowCombinePanel()123 143 End 124 144 … … 360 380 Button MainButton_0e,pos={15,210},size={130,20},proc=CatSort_MainButtonProc,title="Sort Catalog" 361 381 Button MainButton_0e,help={"Sort the Data Catalog, courtesy of ANSTO"} 362 Button MainButton_0f,pos={ 170,90},size={90,20},proc=DataTree_MainButtonProc,title="Data Tree"382 Button MainButton_0f,pos={300,90},size={90,20},proc=DataTree_MainButtonProc,title="Data Tree" 363 383 Button MainButton_0f,help={"Show the header and data tree"} 364 384 Button MainButton_0g,pos={170,180},size={110,20},proc=RTReduce_MainButtonProc,title="RT Reduction" 365 385 Button MainButton_0g,help={"Reduce live (incomplete) data files during acquisition"} 366 386 Button MainButton_0h,pos={170,90},size={90,20},proc=Patch_XY_MainButtonProc,title="Patch XY" 387 Button MainButton_0h,help={"Patch will update incorrect information in raw data headers"} 388 Button MainButton_0i,pos={170,120},size={110,20},proc=Patch_DeadTime_MainButtonProc,title="Patch DeadTime" 389 Button MainButton_0i,help={"Patch will update incorrect information in raw data headers"} 390 Button MainButton_0j,pos={170,150},size={90,20},proc=Patch_Calib_MainButtonProc,title="Patch Calib" 391 Button MainButton_0j,help={"Patch will update incorrect information in raw data headers"} 367 392 368 393 //on tab(1) - Reduction … … 383 408 Button MainButton_2a,pos={15,90},size={60,20},proc=Plot1D_MainButtonProc,title="Plot" 384 409 Button MainButton_2a,help={"Loads and plots a 1-D dataset in the format expected by \"FIT\""} 385 Button MainButton_2b,pos={15,120},size={60,20},proc=Sort1D_MainButtonProc,title="Sort"386 Button MainButton_2b,help={"Sorts and combines 2 or 3 separate 1-D datasets into a single file. Use \"Plot\" button to import 1-D data files"}410 // Button MainButton_2b,pos={15,120},size={60,20},proc=Sort1D_MainButtonProc,title="Sort" 411 // Button MainButton_2b,help={"Sorts and combines 2 or 3 separate 1-D datasets into a single file. Use \"Plot\" button to import 1-D data files"} 387 412 Button MainButton_2c,pos={15,150},size={60,20},proc=Fit1D_MainButtonProc,title="FIT" 388 413 Button MainButton_2c,help={"Shows panel for performing a variety of linearized fits to 1-D data files. Use \"Plot\" button to import 1-D data files"} … … 396 421 Button MainButton_2f,help={"Shows panel for batch combination of 1D data files. Use after you're comfortable with NSORT"} 397 422 Button MainButton_2a,disable=1 398 Button MainButton_2b,disable=1423 // Button MainButton_2b,disable=1 399 424 Button MainButton_2c,disable=1 400 425 // Button MainButton_2d,disable=1 … … 411 436 Button MainButton_3c,pos={15,150},size={90,20},proc=ReadMask_MainButtonProc,title="Read Mask" 412 437 Button MainButton_3c,help={"Reads a mask file into the proper work folder, and displays a small image of the mask. Yellow areas will be excluded from the data"} 413 Button MainButton_3d,pos={15,180},size={100,20},title="Tile RAW 2D",proc=ShowTilePanel_MainButtonProc414 Button MainButton_3d,help={"Adds selected RAW data files to a layout."}438 // Button MainButton_3d,pos={15,180},size={100,20},title="Tile RAW 2D",proc=ShowTilePanel_MainButtonProc 439 // Button MainButton_3d,help={"Adds selected RAW data files to a layout."} 415 440 Button MainButton_3e,pos={150,90},size={100,20},title="Copy Work",proc=CopyWork_MainButtonProc 416 441 Button MainButton_3e,help={"Copies WORK data from specified folder to destination folder."} 417 Button MainButton_3f,pos={150,120},size={110,20},title="WorkFile Math",proc=WorkMath_MainButtonProc418 Button MainButton_3f,help={"Perfom simple math operations on workfile data"}442 // Button MainButton_3f,pos={150,120},size={110,20},title="WorkFile Math",proc=WorkMath_MainButtonProc 443 // Button MainButton_3f,help={"Perfom simple math operations on workfile data"} 419 444 Button MainButton_3g,pos={150,180},size={100,20},title="Event Data",proc=Event_MainButtonProc 420 445 Button MainButton_3g,help={"Manipulate TISANE Timeslice data"} … … 423 448 Button MainButton_3b,disable=1 424 449 Button MainButton_3c,disable=1 425 Button MainButton_3d,disable=1450 // Button MainButton_3d,disable=1 426 451 Button MainButton_3e,disable=1 427 Button MainButton_3f,disable=1452 // Button MainButton_3f,disable=1 428 453 Button MainButton_3g,disable=1 429 454 … … 431 456 Button MainButton_4a,pos={15,90},size={80,20},proc=Draw3D_MainButtonProc,title="3D Display" 432 457 Button MainButton_4a,help={"Plots a 3-D surface of the selected file type"} 433 Button MainButton_4b,pos={15,120},size={120,20},proc=ShowSchematic_MainButtonProc,title="Show Schematic"434 Button MainButton_4b,help={"Use this to show a schematic of the data reduction process for a selected sample file and reduction protocol"}435 Button MainButton_4c,pos={15,150},size={80,20},proc=ShowAvePanel_MainButtonProc,title="Average"436 Button MainButton_4c,help={"Shows a panel for interactive selection of the 1-D averaging step"}458 // Button MainButton_4b,pos={15,120},size={120,20},proc=ShowSchematic_MainButtonProc,title="Show Schematic" 459 // Button MainButton_4b,help={"Use this to show a schematic of the data reduction process for a selected sample file and reduction protocol"} 460 // Button MainButton_4c,pos={15,150},size={80,20},proc=ShowAvePanel_MainButtonProc,title="Average" 461 // Button MainButton_4c,help={"Shows a panel for interactive selection of the 1-D averaging step"} 437 462 // Button MainButton_4d,pos={15,180},size={110,20},proc=CatShort_MainButtonProc,title="CAT/Notebook" 438 463 // Button MainButton_4d,help={"This will generate a CATalog notebook of all files in a specified local folder"} … … 441 466 Button MainButton_4f,pos={180,120},size={130,20},proc=PRODIV_MainButtonProc,title="Make DIV file" 442 467 Button MainButton_4f,help={"Merges two stored workfiles (CORrected) into a DIV file, and saves the result"} 443 Button MainButton_4g,pos={180,150},size={130,20},proc=Raw2ASCII_MainButtonProc,title="RAW ASCII Export"444 Button MainButton_4g,help={"Exports selected RAW (2D) data file(s) as ASCII, either as pixel values or I(Qx,Qy)"}468 // Button MainButton_4g,pos={180,150},size={130,20},proc=Raw2ASCII_MainButtonProc,title="RAW ASCII Export" 469 // Button MainButton_4g,help={"Exports selected RAW (2D) data file(s) as ASCII, either as pixel values or I(Qx,Qy)"} 445 470 Button MainButton_4h,pos={180,180},size={130,20},proc=Preferences_MainButtonProc,title="Preferences" 446 471 Button MainButton_4h,help={"Sets user preferences for selected parameters"} 447 472 448 473 Button MainButton_4a,disable=1 449 Button MainButton_4b,disable=1450 Button MainButton_4c,disable=1474 // Button MainButton_4b,disable=1 475 // Button MainButton_4c,disable=1 451 476 // Button MainButton_4d,disable=1 452 477 // Button MainButton_4e,disable=1 453 478 Button MainButton_4f,disable=1 454 Button MainButton_4g,disable=1479 // Button MainButton_4g,disable=1 455 480 Button MainButton_4h,disable=1 456 481 // -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Marquee_Operations.ipf
r1034 r1041 56 56 // this function will modify the x and y values (passed by reference) as needed to keep on the panel 57 57 V_KeepSelectionInBounds(x1,x2,y1,y2,detStr,gCurDispType) 58 Print 58 Printf "%d;%d;%d;%d;\r",x1,x2,y1,y2 59 59 60 60 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Protocol_Reduction.ipf
r1040 r1041 2787 2787 endif 2788 2788 2789 V_write _ProtocolWave(fileName,$("root:Packages:NIST:VSANS:Globals:Protocols:"+Protocol) )2789 V_writeReductionProtocolWave(fileName,$("root:Packages:NIST:VSANS:Globals:Protocols:"+Protocol) ) 2790 2790 2791 2791 setDataFolder root: -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Test_RAW_Panel.ipf
r1039 r1041 170 170 TitleBox title_status,pos={606,240},size={200,200},variable= root:Packages:NIST:VSANS:Globals:gStatusText 171 171 172 Button button_tagFile,pos={603,412},size={70,20},proc=V_TagFileButtonProc,title="Tag File"173 Button button_tagFile,disable=2174 Button button_saveIQ,pos={ 720,412},size={70,20},proc=V_SaveIQ_ButtonProc,title="Save I(Q)"172 // Button button_tagFile,pos={720,412},size={70,20},proc=V_TagFileButtonProc,title="Tag File" 173 // Button button_tagFile,disable=2 174 Button button_saveIQ,pos={603,412},size={70,20},proc=V_SaveIQ_ButtonProc,title="Save I(Q)" 175 175 Button button_BeamCtr,pos={603,450},size={70,20},proc=V_BeamCtrButtonProc,title="Beam Ctr" 176 176 Button button_SpreadPanels,pos={603,488},size={100,20},proc=V_SpreadPanelButtonProc,title="Spread Panels" -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Transmission.ipf
r1036 r1041 6 6 // TODO 7 7 //-- initialization 8 // -- link to main panel8 // x- link to main panel 9 9 // 10 10 // ?? redesign the panel based on the CATALOG? … … 23 23 Window V_TransmissionPanel() : Panel 24 24 PauseUpdate; Silent 1 // building window... 25 NewPanel /W=( 823,45,1301,669)25 NewPanel /W=(1286,328,1764,952) 26 26 ModifyPanel cbRGB=(32896,16448,0,19621) 27 27 DoWindow/C V_TransmissionPanel … … 29 29 // ShowTools/A 30 30 PopupMenu popup_0,pos={19.00,55.00},size={86.00,23.00},proc=V_TSamFilePopMenuProc,title="Sample" 31 PopupMenu popup_0,mode=1,value= V_getFileIntentList("SAMPLE",0) 32 PopupMenu popup_1,pos={ 98.00,166.00},size={72.00,23.00},proc=V_TTransmFilePopMenuProc,title="Transmission"31 PopupMenu popup_0,mode=1,value= V_getFileIntentList("SAMPLE",0)+V_getFileIntentList("EMPTY CELL",0) 32 PopupMenu popup_1,pos={102,248},size={72.00,23.00},proc=V_TTransmFilePopMenuProc,title="Transmission" 33 33 PopupMenu popup_1,mode=1,value= V_getFileIntentList("TRANSMISSION",0) 34 PopupMenu popup_2,pos={16 0.00,271.00},size={72.00,23.00},proc=V_TEmpBeamPopMenuProc,title="Empty Beam"34 PopupMenu popup_2,pos={164,353},size={72.00,23.00},proc=V_TEmpBeamPopMenuProc,title="Empty Beam" 35 35 PopupMenu popup_2,mode=1,value= V_getFileIntentList("EMPTY BEAM",0) 36 Button button_0,pos={ 22.00,397.00},size={100.00,20.00},proc=V_CalcTransmButtonProc,title="Calculate"36 Button button_0,pos={37,193},size={100.00,20.00},proc=V_CalcTransmButtonProc,title="Calculate" 37 37 // Button button_1,pos={23.00,491.00},size={100.00,20.00},proc=V_WriteTransmButtonProc,title="Write" 38 38 Button button_2,pos={349.00,13.00},size={30.00,20.00},proc=V_HelpTransmButtonProc,title="?" … … 42 42 SetVariable setvar_1,pos={21.00,113.00},size={300.00,14.00},title="Group ID:" 43 43 SetVariable setvar_1,limits={-inf,inf,0},value= VSANS_RED_VERSION 44 SetVariable setvar_2,pos={10 1.00,194.00},size={300.00,14.00},title="Label:"44 SetVariable setvar_2,pos={105,276.00},size={300.00,14.00},title="Label:" 45 45 SetVariable setvar_2,limits={-inf,inf,0},value= _STR:"file label" 46 SetVariable setvar_3,pos={10 0.00,220.00},size={300.00,14.00},title="Group ID:"46 SetVariable setvar_3,pos={104,302},size={300.00,14.00},title="Group ID:" 47 47 SetVariable setvar_3,limits={-inf,inf,0},value= VSANS_RED_VERSION 48 SetVariable setvar_4,pos={16 1.00,300.00},size={300.00,14.00},title="Label:"48 SetVariable setvar_4,pos={165,382},size={300.00,14.00},title="Label:" 49 49 SetVariable setvar_4,limits={-inf,inf,0},value= _STR:"file label" 50 SetVariable setvar_5,pos={16 1.00,324.00},size={300.00,14.00},title="XY Box:"50 SetVariable setvar_5,pos={165,406},size={300.00,14.00},title="XY Box:" 51 51 SetVariable setvar_5,limits={-inf,inf,0},value= _STR:"dummy" 52 SetVariable setvar_6,pos={1 59.00,349.00},size={300.00,14.00},title="Panel:"52 SetVariable setvar_6,pos={165,431},size={300.00,14.00},title="Panel:" 53 53 SetVariable setvar_6,limits={-inf,inf,0},value= _STR:"dummy" 54 SetVariable setvar_7,pos={2 4.00,426.00},size={300.00,14.00},title="Transmission:"54 SetVariable setvar_7,pos={21,138},size={300.00,14.00},title="Transmission:" 55 55 SetVariable setvar_7,limits={-inf,inf,0},value= VSANS_RED_VERSION 56 SetVariable setvar_8,pos={2 5.00,448.00},size={300.00,14.00},title="Error:"56 SetVariable setvar_8,pos={21,163},size={300.00,14.00},title="Error:" 57 57 SetVariable setvar_8,limits={-inf,inf,0},value= VSANS_RED_VERSION 58 58 EndMacro … … 115 115 116 116 // now loop back through to find the empty beam file 117 // TODO x- fill in the XY box 118 // -- Panel field is hard wired... 117 // TODO 118 // x- fill in the XY box 119 // -- Detector Panel field is hard-wired for "B" 119 120 // 120 121 WAVE/T intentW = root:Packages:NIST:VSANS:CatVSHeaderInfo:Intent … … 195 196 // TODO 196 197 // -- figure out which detector corrections are necessary to do on loading 197 // data for calcu altion. Then set/reset preferences accordingly198 // data for calculation. Then set/reset preferences accordingly 198 199 // (see V_isoCorrectButtonProc() for example of how to do this) 199 200 // … … 202 203 // -- solid angle (turn off ?) 203 204 // -- dead time (keep on?) 205 // 206 // -- once calculated, update the Transmission panel 207 // -- update the data file 208 // -- update the CATALOG (and/or delete the RawVSANS to force a re-read) 204 209 // 205 210 Function V_CalcTransmButtonProc(ba) : ButtonControl … … 233 238 trans = V_getSampleTransmission(fileName) 234 239 trans_err = V_getSampleTransError(fileName) 235 // TODO 236 // -- this criteria is rather crude. think it through better 237 if(trans != 0 && trans < 1 && trans_err != 0) 238 Printf "Sample transmission, error = %g +/- %g already exists, nothing calculated\r",trans,trans_err 239 break 240 endif 240 // // TODO 241 // // -- this criteria is rather crude. think it through better 242 // // -- or should I simply let it overwrite? What is the harm in that? 243 // if(trans != 0 && trans < 1 && trans_err != 0) 244 // Printf "Sample transmission, error = %g +/- %g already exists, nothing calculated\r",trans,trans_err 245 // break 246 // endif 241 247 242 248 // for empty beam … … 258 264 // -- this criteria is rather crude. think it through better 259 265 if(emptyCts > 1 && empty_ct_err != 0) 260 Printf "Empty beam box counts, error = %g +/- %g already exists, nothingcalculated\r",emptyCts,empty_ct_err266 Printf "Empty beam box counts, error = %g +/- %g already exists, box counts not re-calculated\r",emptyCts,empty_ct_err 261 267 262 268 else … … 351 357 352 358 // TODO 353 // (update the value displayed in the table?) 354 // (update the local value?) 359 // -- update the value displayed in the panel 360 // -- update the local value in the file catalog 361 // -- delete the file from RawVSANS to force a re-read? 362 // SetVariable setvar_7,value= trans 363 // SetVariable setvar_8,value= trans_err 364 // DoUpdate/W=V_TransmissionPanel 355 365 356 366 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_WorkFolderUtils.ipf
r1031 r1041 538 538 // (6) angle dependent transmission correction 539 539 // TODO: 540 // -- this still needs to be filled in540 // x- this still needs to be filled in 541 541 // -- still some debate of when/where in the corrections that this is best applied 542 542 // - do it here, and it's done whether the output is 1D or 2D 543 543 // - do it later (where SAMPLE information is used) since this section is ONLY instrument-specific 544 // -- verify that the calculation is correct 545 // -- verify that the error propagation (in 2D) is correct 546 // 544 547 NVAR gDoTrans = root:Packages:NIST:VSANS:Globals:gDoTransmissionCor 545 548 if (gDoTrans == 1) 546 Print " (stub)Doing Large-angle transmission correction -- INCOMPLETE FUNCTION"// for "+ detStr549 Print "Doing Large-angle transmission correction"// for "+ detStr 547 550 for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 548 551 detStr = StringFromList(ii, ksDetectorListAll, ";") … … 550 553 Wave w_err = V_getDetectorDataErrW(fname,detStr) 551 554 552 // V_TransmissionCorrection(fill this in)555 V_LargeAngleTransmissionCorr(w,w_err,fname,detStr,destPath) 553 556 554 557 endfor
Note: See TracChangeset
for help on using the changeset viewer.