- Timestamp:
- Jul 23, 2010 2:18:28 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Common/DataSetHandling.ipf
r708 r728 6 6 // Function batchXML26ColConvert() 7 7 // 8 8 // Function batchGrasp26ColConvert() 9 // 10 // these both need a real interface, and a way to better define the name of the 11 // converted output file. And some retention of the header would be nice too... 12 // 9 13 10 14 … … 591 595 Checkbox DAPlot_log_cb, title="Log I(q)", pos={20,410},value=0 592 596 Checkbox DAPlot_log_cb, proc=DALogLinIProc 597 Checkbox DAPlot_lin_cb, title="High Q Linear", pos={100,410},value=0 598 Checkbox DAPlot_lin_cb, proc=DAHighQLinProc 593 599 594 600 End … … 1082 1088 1083 1089 ModifyGraph/W=DAPlotPanel#DAPlot log(left)=cba.checked 1084 1085 endswitch 1086 1087 1088 End 1090 ModifyGraph/W=DAPlotPanel#DAPlot log(bottom)=cba.checked 1091 ModifyGraph/W=DAPlotPanel#DAPlot zero(left)=0 1092 SetAxis/A/W=DAPlotPanel#DAPlot 1093 1094 if(cba.checked) 1095 Checkbox DAPlot_lin_cb,value=0 //uncheck lin 1096 endif 1097 endswitch 1098 1099 1100 End 1101 1102 Function DAHighQLinProc(cba) : CheckBoxControl 1103 STRUCT WMCheckBoxAction &cba 1104 1105 switch(cba.eventcode) 1106 case 2: 1107 if(cba.checked) 1108 ModifyGraph/W=DAPlotPanel#DAPlot log=0,zero(left)=1 1109 SetAxis/W=DAPlotPanel#DAPlot left -0.1,0.1 1110 SetAxis/W=DAPlotPanel#DAPlot bottom 0.1,* 1111 SetAxis/W=DAPlotPanel#DAPlot left -0.02,0.02 1112 1113 Checkbox DAPlot_log_cb,value=0 //uncheck the log 1114 endif 1115 endswitch 1116 1117 1118 End 1119 1089 1120 1090 1121 Function DACursorButtonProc(ba) : ButtonControl … … 1555 1586 for(ii=0;ii<num;ii+=1) 1556 1587 item = StringFromList(ii, list ,";") 1588 fReWrite1DData_noPrompt(item,"tab","CR") 1589 endfor 1590 1591 End 1592 1593 ///////// SRK - VERY SIMPLE batch converter 1594 // NO header information is preserved 1595 // file names are partially preserved 1596 // 1597 1598 /// to use this: 1599 // -open the Plot Manager and set the path 1600 // -run this function 1601 // 1602 // it doesn't matter if the XML ouput flag is set - this overrides. 1603 // 1604 // The GRASP output data is 5-column Q-I-errI-sigQ-nCells 1605 // which gets read in as q-i-s-ism-fit_ism (as if it was some wierd USANS data format) 1606 // -- so fake the output... 1607 // 1608 Function batchGrasp26ColConvert() 1609 1610 String list, item,path,fname 1611 Variable num,ii,npt 1612 1613 PathInfo CatPathName 1614 path = S_Path 1615 1616 list = A_ReducedDataFileList("") 1617 num = itemsInList(list) 1618 Print num 1619 for(ii=0;ii<num;ii+=1) 1620 item = StringFromList(ii, list ,";") 1621 fname=path + item 1622 Execute "A_LoadOneDDataWithName(\""+fname+"\",0)" //won't plot 1623 // easier to load all, then write out, since the name will be changed 1624 endfor 1625 1626 1627 list = DM_DataSetPopupList() 1628 1629 num = itemsInList(list) 1630 1631 Print num 1632 for(ii=0;ii<num;ii+=1) 1633 item = StringFromList(ii, list ,";") 1634 1635 // fake the 6-column NIST data structure 1636 WAVE qw = $("root:"+item+":"+item+"_q") 1637 npt = numpnts(qw) 1638 Make/O/D/N=(npt,4) $("root:"+item+":"+item+"_res") 1639 WAVE res = $("root:"+item+":"+item+"_res") 1640 WAVE sigQ = $("root:"+item+":"+item+"_ism") 1641 res[][0] = sigQ[p] // sigQ 1642 res[][1] = qw[p] // qBar ~ q 1643 res[][2] = 1 //shadow 1644 res[][3] = qw[p] // q 1645 1646 1557 1647 fReWrite1DData_noPrompt(item,"tab","CR") 1558 1648 endfor … … 1635 1725 PathInfo/S catPathName 1636 1726 // fullPath = DoSaveFileDialog("Save data as",fname=baseStr+".txt") 1637 fullPath = DoSaveFileDialog("Save data as",fname=baseStr[0,strlen(BaseStr)- 2])1727 fullPath = DoSaveFileDialog("Save data as",fname=baseStr[0,strlen(BaseStr)-1]) 1638 1728 Print fullPath 1639 1729 If(cmpstr(fullPath,"")==0) … … 1645 1735 Endif 1646 1736 PathInfo catPathName 1647 fullPath = S_Path + baseStr[0,strlen(BaseStr)- 2]1737 fullPath = S_Path + baseStr[0,strlen(BaseStr)-1] 1648 1738 1649 1739 Open refnum as fullpath
Note: See TracChangeset
for help on using the changeset viewer.