- Timestamp:
- Aug 23, 2017 10:03:41 AM (6 years ago)
- Location:
- sans/Dev/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_Igor_Procedures/NCNR_Package_Loader.ipf
r1017 r1061 51 51 "Load Simulation Run Builder",SimSANSRunListLoader() 52 52 "Automated SANS Reduction - Beta",AutomateSANSLoader() 53 "-" 54 "Load VSANS Procedures",VSANSLoader() 53 55 54 56 // "-" … … 750 752 return(0) 751 753 End 754 755 756 // loads the VSANS package and initializes 757 Function VSANSLoader() 758 759 Execute/P "INSERTINCLUDE \"VSANS_Includes\"" 760 Execute/P "COMPILEPROCEDURES " 761 Execute/P "Initialize_VSANS()" 762 763 BuildMenu "Macros" 764 765 return(0) 766 End 767 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DIVUtils.ipf
r1043 r1061 28 28 // the normalization will be way off -- and the "active" area will end up much larger 29 29 // than it should be - since the wings of the detector are mostly zero... 30 // ? Can I apply a mask, or will the detectors be set in a different configuration? 30 31 // 31 32 // … … 38 39 // -- expand this to do a basic renormalization of all 9 panels, and move the data into the 39 40 // appropriate locations for saving as a DIV file. 40 // 41 // x- (YES, done) what about error propogation? Can I store the error in the data file? 42 // Makes a difference if the DIV is not collected for long "enough". 43 // x- then I need to be able to read the error in (done) 41 44 // 42 45 … … 46 49 // -- next, V_NormalizeDIV() 47 50 // -- then Setup_VSANS_DIV_Struct() 48 // -- next, V_CopyDIVToSave() 51 // -- next, V_CopyDIVToSave() -or- V_CopyDIVToSave_OnePanel() 49 52 // -- last, Save_VSANS_DIV_Nexus() 50 53 // 51 54 52 55 … … 60 63 // TODO 61 64 // -- data should be copied to some alternate work folder before this step 65 // -- for T/B detectors, this may not work as intended if the whole detector is not illuminated. 66 // How to handle? A mask? 67 // x- is this the correct calculation of the error? (YES) It should be correct up to this point since the 68 // standard reduction has been used, but now the normalization step is a multiplication 69 // by a constant (w/no error). Be sure this error transformation is correct. (YES - this is correct, and is 70 // what is done in SANS) 62 71 // 63 72 Function V_NormalizeDIV(type) … … 74 83 pixelY = V_getDet_pixel_num_y(type,detStr) 75 84 76 totCts =sum(w,Inf,-Inf) //sum all of the data85 totCts = sum(w,Inf,-Inf) //sum all of the data 77 86 78 87 w /= totCts … … 88 97 89 98 90 99 // copies an entire work folder, all 9 detectors (at COR level) 100 // to the DIV structure to write out 101 // 91 102 Function V_CopyDIVToSave(type) 92 103 String type … … 109 120 End 110 121 122 // 123 // copies only the specified panel from a work folder, (at COR level) 124 // to the DIV structure to write out 125 // 126 // used to replace a single panel, or to fill in carriage by carriage. 127 // 128 Function V_CopyDIVToSave_OnePanel(type,detStr) 129 String type,detStr 130 131 Variable ii,totCts,pixelX,pixelY 132 String topath = "root:VSANS_DIV_file:entry:instrument:detector_" 133 String fromPath = "root:Packages:NIST:VSANS:"+type+":entry:instrument:detector_" 134 135 136 Duplicate/O $(fromPath+detStr+":data") $(toPath+detStr+":data") 137 Duplicate/O $(fromPath+detStr+":linear_data_error") $(toPath+detStr+":linear_data_error") 138 139 return(0) 140 End 111 141 112 142 … … 170 200 // 171 201 // TODO -- make the number of pixels GLOBAL 172 // TODO -- there will be lots of work to do to develop the procedures necessary to actually generate the173 // 9 data sets to become the DIV file contents. More complexity here than for the simple SANS case.174 202 // 175 203 Proc H_Setup_VSANS_DIV_Structure() -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DetectorCorrections.ipf
r1055 r1061 565 565 566 566 sdd = V_getDet_ActualDistance(fname,detStr) //sdd derived, including setback [cm] 567 sdd/=100 // sdd reported in cm, pass in m 567 568 568 // this is the ctr in pixels --xx-- (now it is in cm!) 569 569 // xCtr = V_getDet_beam_center_x(fname,detStr) … … 587 587 588 588 // calculate all of the q-values 589 // sdd is passed in [cm] 589 590 qTot = V_CalcQval(p,q,xCtr,yCtr,sdd,lambda,data_realDistX,data_realDistY) 590 591 qx = V_CalcQX(p,q,xCtr,yCtr,sdd,lambda,data_realDistX,data_realDistY) … … 605 606 // to each pixel 606 607 // 607 //sdd is in meters 608 //sdd is in [cm] 609 // distX and distY are in [mm] 608 610 //wavelength is in Angstroms 609 611 // … … 616 618 Variable dx,dy,qval,two_theta,dist 617 619 618 sdd *=100 //convert to cm 620 619 621 dx = (distX[xaxval][yaxval] - xctr) //delta x in mm 620 622 dy = (distY[xaxval][yaxval] - yctr) //delta y in mm … … 648 650 qval = V_CalcQval(xaxval,yaxval,xctr,yctr,sdd,lam,distX,distY) 649 651 650 sdd *=100 //convert to cm 652 651 653 dx = (distX[xaxval][yaxval] - xctr) //delta x in mm 652 654 dy = (distY[xaxval][yaxval] - yctr) //delta y in mm … … 682 684 qval = V_CalcQval(xaxval,yaxval,xctr,yctr,sdd,lam,distX,distY) 683 685 684 sdd *=100 //convert to cm 686 685 687 dx = (distX[xaxval][yaxval] - xctr) //delta x in mm 686 688 dy = (distY[xaxval][yaxval] - yctr) //delta y in mm … … 717 719 qval = V_CalcQval(xaxval,yaxval,xctr,yctr,sdd,lam,distX,distY) 718 720 719 sdd *=100 //convert to cm 721 720 722 dx = (distX[xaxval][yaxval] - xctr) //delta x in mm 721 723 dy = (distY[xaxval][yaxval] - yctr) //delta y in mm … … 755 757 // orientation = V_getDet_tubeOrientation(fname,detStr) 756 758 sdd = V_getDet_ActualDistance(fname,detStr) 757 sdd/=100 // sdd in cm, pass in m 759 758 760 759 761 // this is ctr in mm … … 775 777 776 778 tmp_dist /= 10 // convert mm to cm 777 sdd *=100 //convert to cm779 // sdd is in [cm] 778 780 779 781 tmp_theta = atan(tmp_dist/sdd) //this is two_theta, the scattering angle … … 988 990 // orientation = V_getDet_tubeOrientation(fname,detStr) 989 991 sdd = V_getDet_ActualDistance(fname,detStr) 990 sdd/=100 // sdd in cm, pass in m991 992 992 993 // this is ctr in mm … … 1009 1010 1010 1011 tmp_dist /= 10 // convert mm to cm 1011 sdd *=100 //convert to cm1012 // sdd is in [cm] 1012 1013 1013 1014 tmp_theta = atan(tmp_dist/sdd) //this is two_theta, the scattering angle … … 1283 1284 // 1284 1285 // TODO: 1285 // -- DoAlert 0,"This has not yet been updated for VSANS" 1286 // -- how is the error propagation handled? 1286 // x- DoAlert 0,"This has not yet been updated for VSANS" 1287 // -- how is the error propagation handled? Be sure it is calculated correctly when DIV is generated 1288 // and is applied correctly here... 1287 1289 // 1288 1290 //function will divide the contents of "workType" folder with the contents of … … 1314 1316 1315 1317 data /= div_data 1316 1318 1319 // TODO: -- correct the error propagation 1317 1320 data_err /= div_data 1318 1321 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_Read.ipf
r1055 r1061 1539 1539 End 1540 1540 1541 // return value in [cm] 1541 1542 Function V_getDet_NominalDistance(fname,detStr) 1542 1543 String fname,detStr … … 1547 1548 1548 1549 //this is a DERIVED distance, since the nominal sdd is for the carriage (=LR panels) 1550 // return value in [cm] 1549 1551 Function V_getDet_ActualDistance(fname,detStr) 1550 1552 String fname,detStr -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_RAW_Data_Panel.ipf
r1059 r1061 401 401 yctr = V_getDet_beam_center_y_mm(gCurDispType,detStr) 402 402 403 sdd = V_getDet_ActualDistance(gCurDispType,detStr) / 100 //written in cm, pass in meters403 sdd = V_getDet_ActualDistance(gCurDispType,detStr) //written in cm, pass in [cm] 404 404 lam = V_getWavelength(gCurDispType) //A 405 405 // pixSizeX = V_getDet_x_pixel_size(gCurDispType,detStr) // written mm? need mm … … 769 769 // now part of every tab click 770 770 //// update the status when the tab is clicked 771 //STRUCT WMButtonAction sa772 //sa.eventCode = 2773 //V_StatusButtonProc(sa)771 STRUCT WMButtonAction sa 772 sa.eventCode = 2 773 V_StatusButtonProc(sa) 774 774 775 775 break … … 900 900 Variable curTab = V_value 901 901 902 // // fake this, since if the tab was clicked, it hasn't been updated yet and we're off by one 903 // if(ba.eventCode == 3) 904 // curTab += 1 905 // if(curTab == 3) 906 // curTab = 0 907 // endif 908 // endif 909 910 // 902 911 str = "Current data is from "+ type + "\r" 903 912 str += "Description = "+V_getSampleDescription(type) + "\r"
Note: See TracChangeset
for help on using the changeset viewer.