Changeset 1026
- Timestamp:
- Mar 7, 2017 3:01:16 PM (6 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_PatchFiles.ipf
r1022 r1026 1588 1588 Button button0_1,pos={20,220},size={50.00,20.00},proc=V_WriteDTButtonProc,title="Write" 1589 1589 Button button0_2,pos={18.00,336.00},size={140.00,20.00},proc=V_GeneratePerfDTButton,title="Perfect Dead Time" 1590 Button button0_3,pos={18.00,370.00},size={140.00,20.00},proc=V_LoadCSVDTButton,title="Load Dead Time CSV" 1591 Button button0_4,pos={18.00,400.00},size={140.00,20.00},proc=V_WriteCSVDTButton,title="Write Dead Time CSV" 1590 1592 1591 1593 SetVariable setvar0,pos={20,141},size={100.00,14.00},title="first" … … 1605 1607 EndMacro 1606 1608 1609 1610 Function V_LoadCSVDTButton(ba) : ButtonControl 1611 STRUCT WMButtonAction &ba 1612 1613 switch( ba.eventCode ) 1614 case 2: // mouse up 1615 // click code here 1616 1617 LoadWave/J/A/D/O/W/E=1/K=0 //will prompt for the file, auto name 1618 1619 break 1620 case -1: // control being killed 1621 break 1622 endswitch 1623 1624 return 0 1625 End 1626 1627 //TODO 1628 // -- currently this skips detector "B", since its dead time is not like the tubes 1629 // -- fails miserably if the deadtime_** waves don't exist 1630 // -- the writing may take a long time. Warn the user. 1631 // -- if the data files are not "cleaned up", re-reading will pick up the rawVSANS copy and it 1632 // will look like nothing was written 1633 // 1634 // writes the entire content of the CSV file (all 8 panels) to each detector entry in each data file 1635 // as specified by the run number range 1636 // 1637 Function V_WriteCSVDTButton(ba) : ButtonControl 1638 STRUCT WMButtonAction &ba 1639 1640 Variable ii 1641 String detStr 1642 1643 switch( ba.eventCode ) 1644 case 2: // mouse up 1645 // click code here 1646 1647 // ControlInfo popup_0 1648 // String detStr = S_Value 1649 ControlInfo setvar0 1650 Variable lo=V_Value 1651 ControlInfo setvar1 1652 Variable hi=V_Value 1653 Wave deadTimeW = root:Packages:NIST:VSANS:Globals:Patch:deadTimeWave 1654 1655 for(ii=0;ii<ItemsInList(ksDetectorListNoB);ii+=1) 1656 detStr = StringFromList(ii, ksDetectorListNoB, ";") 1657 Wave tmpW = $("root:deadtime_"+detStr) 1658 deadTimeW = tmpW 1659 V_fPatchDetectorDeadtime(lo,hi,detStr,deadtimeW) 1660 endfor 1661 1662 break 1663 case -1: // control being killed 1664 break 1665 endswitch 1666 1667 // TODO 1668 // -- clear out the data folders (from lo to hi?) 1669 // 1670 // root:Packages:NIST:VSANS:RawVSANS:sans1301: 1671 for(ii=lo;ii<=hi;ii+=1) 1672 KillDataFolder/Z $("root:Packages:NIST:VSANS:RawVSANS:sans"+num2str(ii)) 1673 endfor 1674 return 0 1675 End 1607 1676 1608 1677 … … 1822 1891 Button button0_1,pos={20,220},size={50.00,20.00},proc=V_WriteCalibButtonProc,title="Write" 1823 1892 Button button0_2,pos={18.00,336.00},size={140.00,20.00},proc=V_GeneratePerfCalibButton,title="Perfect Calibration" 1893 Button button0_3,pos={18.00,370.00},size={140.00,20.00},proc=V_LoadCSVCalibButton,title="Load Calibration CSV" 1894 Button button0_4,pos={18.00,400.00},size={140.00,20.00},proc=V_WriteCSVCalibButton,title="Write Calibration CSV" 1824 1895 1825 1896 SetVariable setvar0,pos={20,141},size={100.00,14.00},title="first" … … 1840 1911 1841 1912 EndMacro 1913 1914 1915 Function V_LoadCSVCalibButton(ba) : ButtonControl 1916 STRUCT WMButtonAction &ba 1917 1918 switch( ba.eventCode ) 1919 case 2: // mouse up 1920 // click code here 1921 1922 LoadWave/J/A/D/O/W/E=1/K=0 //will prompt for the file, auto name 1923 1924 break 1925 case -1: // control being killed 1926 break 1927 endswitch 1928 1929 return 0 1930 End 1931 1932 //TODO 1933 // -- currently this skips detector "B", since its calibration is not like the tubes 1934 // -- fails miserably if the a,b,c_** waves don't exist 1935 // -- the writing may take a long time. Warn the user. 1936 // -- if the data files are not "cleaned up", re-reading will pick up the rawVSANS copy and it 1937 // will look like nothing was written 1938 // 1939 // writes the entire content of the CSV file (all 8 panels) to each detector entry in each data file 1940 // as specified by the run number range 1941 // 1942 Function V_WriteCSVCalibButton(ba) : ButtonControl 1943 STRUCT WMButtonAction &ba 1944 1945 Variable ii 1946 String detStr 1947 1948 switch( ba.eventCode ) 1949 case 2: // mouse up 1950 // click code here 1951 1952 // ControlInfo popup_0 1953 // String detStr = S_Value 1954 ControlInfo setvar0 1955 Variable lo=V_Value 1956 ControlInfo setvar1 1957 Variable hi=V_Value 1958 WAVE calibrationWave = root:Packages:NIST:VSANS:Globals:Patch:calibrationWave 1959 1960 for(ii=0;ii<ItemsInList(ksDetectorListNoB);ii+=1) 1961 detStr = StringFromList(ii, ksDetectorListNoB, ";") 1962 Wave tmp_a = $("root:a_"+detStr) 1963 Wave tmp_b = $("root:b_"+detStr) 1964 Wave tmp_c = $("root:c_"+detStr) 1965 calibrationWave[0][] = tmp_a[q] 1966 calibrationWave[1][] = tmp_b[q] 1967 calibrationWave[2][] = tmp_c[q] 1968 V_fPatchDetectorCalibration(lo,hi,detStr,calibrationWave) 1969 endfor 1970 1971 break 1972 case -1: // control being killed 1973 break 1974 endswitch 1975 1976 // TODO 1977 // -- clear out the data folders (from lo to hi?) 1978 // 1979 // root:Packages:NIST:VSANS:RawVSANS:sans1301: 1980 for(ii=lo;ii<=hi;ii+=1) 1981 KillDataFolder/Z $("root:Packages:NIST:VSANS:RawVSANS:sans"+num2str(ii)) 1982 endfor 1983 return 0 1984 End 1842 1985 1843 1986 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Test_RAW_Panel.ipf
r1025 r1026 329 329 endif 330 330 331 331 332 // which images are here? 332 333 String detStr="",imStr,carriageStr … … 349 350 // which, if any image is the mouse xy location on? 350 351 // use a multidemensional equivalent to x2pnt: (ScaledDimPos - DimOffset(waveName, dim))/DimDelta(waveName,dim) 351 testX = trunc( (xloc - DimOffset(w,0))/DimDelta(w,0) ) 352 testY = trunc( (yloc - DimOffset(w,1))/DimDelta(w,1) ) 352 353 354 testX = ScaleToIndex(w,xloc,0) 355 testY = ScaleToIndex(w,yloc,1) 353 356 354 357 if( (testX > 0 && testX < DimSize(w,0)) && (testY > 0 && testY < DimSize(w,1)) ) … … 390 393 391 394 sdd = V_getDet_ActualDistance(gCurDispType,detStr) / 100 //written in cm, pass in meters 392 lam = V_get VSWavelength(gCurDispType) //A395 lam = V_getWavelength(gCurDispType) //A 393 396 // pixSizeX = V_getDet_x_pixel_size(gCurDispType,detStr) // written mm? need mm 394 397 // pixSizeY = V_getDet_y_pixel_size(gCurDispType,detStr) // written mm? need mm … … 409 412 410 413 ii = -1 //look no further, set ii to bad value to exit the for loop 414 415 // TODO 416 // -- remove this - it sets the globals to display to the pixel values, unscaled 417 // xloc = testX 418 // yloc = testY 419 411 420 endif //end if(mouse is over a detector panel) 412 421 endfor // end loop over list of displayed images -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Utilities_General.ipf
r1025 r1026 117 117 // TODO: 118 118 // x- this still does not quite work. If there are no sub folders present in the RawVSANS folder 119 // it still thinks there are(1) item there.119 // it still thinks there is (1) item there. 120 120 // -- if I replace the semicolon with a comma, it thinks there are two folders present and appears 121 121 // to delete the RawVSANS folder itself! seems very dangerous...this is because DataFolderDir returns … … 222 222 // TODO: 223 223 // x- this still does not quite work. If there are no sub folders present in the RawVSANS folder 224 // it still thinks there are(1) item there.224 // it still thinks there is (1) item there. 225 225 // -- if I replace the semicolon with a comma, it thinks there are two folders present and appears 226 226 // to delete the RawVSANS folder itself! seems very dangerous...this is because DataFolderDir returns
Note: See TracChangeset
for help on using the changeset viewer.