Changeset 1079 for sans/Dev/trunk


Ignore:
Timestamp:
Jan 9, 2018 10:02:45 AM (5 years ago)
Author:
srkline
Message:

cleanup of TODO items in code, no noteworthy changes

prepare a test release package for the January startup of VSANS, not a general release (since no changes to SANS or USANS)

Location:
sans/Dev/trunk/NCNR_User_Procedures
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Common/Packages/PlotManager/PlotUtilsMacro_v40.ipf

    r1078 r1079  
    363363//TODO: be sure that this works correctly and can be included in either 
    364364// a VSANS reduction experiment, or a standalone analysis package 
    365 #if (exists("NCNR_VSANS")==6)                   //defined in the main #includes file. 
    366                                 DoAlert 0,"**Treating data as VSANS data**" 
    367                                 Duplicate/O $w3,$(baseStr+"_dQv")                       //save a copy for VSANS 
    368                                 $(baseStr+"_dQv") = -$(baseStr+"_dQv") 
    369                                 V_USANS_CalcWeights(baseStr,dQv) 
    370 #else 
    371                                 DoAlert 0,"Treating data as USANS (normal slit-smeared data)" 
    372                                 USANS_CalcWeights(baseStr,dQv) 
    373 #endif                           
     365// -- since this is a Proc, not a function, #conditional compile does not work, 
     366// but, since it's a Proc, it is not compiled, so missing functions aren't flagged as a compile error 
     367                                if (exists("NCNR_VSANS")==6)                    //defined in the main  VSANS #includes file. 
     368                                                                DoAlert 0,"**Treating data as VSANS data**" 
     369                                                                Duplicate/O $w3,$(baseStr+"_dQv")                       //save a copy for VSANS 
     370                                                                $(baseStr+"_dQv") = -$(baseStr+"_dQv") 
     371                                                                V_USANS_CalcWeights(baseStr,dQv) 
     372                                else 
     373                                                                DoAlert 0,"Treating data as USANS (normal slit-smeared data)" 
     374                                                                USANS_CalcWeights(baseStr,dQv) 
     375                                endif                            
    374376 
    375377                                 
     
    13441346        list = RemoveFromList("DoAnnulusGraph;DoArcGraph;",list,";") 
    13451347         
     1348// from 2017-2018 VSANS reduction 
     1349        list = RemoveFromList("V_BroadPeak_Pix2D;V_BroadPeak_Pix2D_noThread;V_CleanupTimes;V_I_BroadPeak_Pix2D;V_IndexForHistogram;V_MakeFibonacciWave;V_UpdatePix2Mat;xJointHistogram;",list,";") 
    13461350                         
    13471351        list = SortList(list) 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_BroadPeak_Pix_2D.ipf

    r1043 r1079  
    7373// this sets the x and y waves of the triplet to be the pixel numbers 
    7474// 
    75 // TODO: 
     75// 
    7676// -- this will need to be changed if I want to fit based on real-space mm 
    7777// 
     
    223223 
    224224// ASSUMPTION 
    225 // TODO (change this) 
     225// 
    226226// base the scaling on the xSize  
    227227 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Combine_1D.ipf

    r1074 r1079  
    461461        endif 
    462462        if(strlen(detListStr)==0) 
     463                DoAlert 0,"error in V_SaveTrimmed_Button" 
    463464                return(0) 
    464465        endif 
     
    696697 
    697698 
    698  
    699  
    700  
    701  
    702  
    703  
    704  
    705  
    706  
    707  
    708  
    709  
    710  
    711  
    712  
    713  
    714  
    715  
    716  
    717 //////////////// Below is unused -- it was started, but seems like the wrong approach, 
    718 //////////////// so I have abandoned it for now 
    719 // 
    720 // 
    721 // ((this approach using USANS ideas has temporarily been abandoned...)) 
    722 // 
    723 // Preliminary routines for adjusting, masking, and combining 1D VSANS data sets. 
    724 // 
    725 // ideas taken from USANS to mask data sets 
    726 // avoiding duplication of NSORT, since autoscale is not in favor, and there may be anywhere 
    727 //   from 3 to 9 data sets to combine 
    728 // 
    729 // masking waves are saved in the "Combine_1D" folder, BUT the masking may eventually be part 
    730 //  of the data reduction protocol - and anything in work folders will be lost 
    731 // 
    732  
    733  
    734 //////////////// 
    735 // TODO: 
    736 // x- add a popup to the load tab to set the work folder 
    737 // x- add this file to the Includes list and to the SVN folder 
    738 // -- add button (mask tab) to save mask 
    739 // -- add button (mask tab) to recall mask 
    740 // -- think of ways to run through the files batchwise (instead of adding this to the protocol) 
    741 // -- link the main entry procedure to the main panel 
    742 // 
    743 // -- when do I concatenate the data sets? 
    744 // ---- do I add a concatenate button to the Load tab, then this single set is the  
    745 //    starting point for the MASK tab 
    746 // ---- the Load Data button could then be a loader for a single file, which is then the "concatenated" 
    747 //     starting point... 
    748 // 
    749 // x- make the graph larger for easier viewing of the data 
    750 // -- increase the size of the tab control, rearrange the other controls 
    751 // 
    752 // -- how do I incorporate the rescaling? 
    753 // 
    754 // -- error bars on the graph 
    755 // x- legend on the graph 
    756 // 
    757 // x- define a new folder for all of this -- NOT the protocol folder 
    758 // x- define a string constant with this path 
    759 // 
    760 // -- button to mask based on relative error threshold for each data point. may be a good startng point for 
    761 //    masking 
    762 // 
    763 // -- remove the mask by relative error button - this is not really a good idea. 
    764 // 
    765 // 
    766 // 
    767 // 
    768 //StrConstant ksCombine1DFolder = "root:Packages:NIST:VSANS:Globals:Combine_1D" 
    769 // 
    770 //// main entry routine 
    771 //Proc V_Combine_1D() 
    772 // 
    773 //      //check for the correct folder, initialize if necessary 
    774 //      // 
    775 //      if(DataFolderExists(ksCombine1DFolder) == 0) 
    776 //              Execute "V_Init_Combine_1D()" 
    777 //      endif 
    778 //       
    779 //      SetDataFolder root: 
    780 //       
    781 //      DoWindow/F V_Combine_1D_Graph 
    782 //      if(V_flag==0) 
    783 //              Execute "V_Combine_1D_Graph()" 
    784 //      endif 
    785 //End 
    786 // 
    787 //Proc V_Init_Combine_1D() 
    788 // 
    789 //      //set up the folder(s) needed 
    790 //      NewDataFolder/O $(ksCombine1DFolder) 
    791 //       
    792 //      SetDataFolder $(ksCombine1DFolder) 
    793 //       
    794 //      String/G gCurFile="" 
    795 //      String/G gStr1="" 
    796 //      Variable/G gFreshMask=1 
    797 //      Variable/G gNq=0 
    798 //       
    799 //      SetDataFolder root: 
    800 //End 
    801 // 
    802 // 
    803 ////// 
    804 //// 
    805 //// 
    806 //Proc V_Combine_1D_Graph()  
    807 // 
    808 //      PauseUpdate; Silent 1           // building window... 
    809 //      Display /W=(699,45,1328,779) /K=1 
    810 //      ModifyGraph cbRGB=(51664,44236,58982) 
    811 //      ModifyGraph tickUnit=1 
    812 //      DoWindow/C V_Combine_1D_Graph 
    813 //      ControlBar 160 
    814 //      // break into tabs 
    815 //      TabControl C1D_Tab,pos={5,3},size={392,128},proc=C1D_TabProc 
    816 //      TabControl C1D_Tab,labelBack=(49151,49152,65535),tabLabel(0)="Load" 
    817 //      TabControl C1D_Tab,tabLabel(1)="Mask",tabLabel(2)="Rescale",value=0 
    818 //       
    819 //      //always visible - revert and save 
    820 //      //maybe the wrong place here? 
    821 //      Button C1DControlA,pos={225,135},size={80,20},proc=C1D_RevertButtonProc,title="Revert" 
    822 //      Button C1DControlA,help={"Revert the data to its original state and start over"} 
    823 //      Button C1DControlB,pos={325,135},size={50,20},proc=C1D_SaveButtonProc,title="Save" 
    824 //      Button C1DControlB,help={"Save the masked and scaled data set"} 
    825 //      Button C1DControlC,pos={25,135},size={50,20},proc=C1D_HelpButtonProc,title="Help" 
    826 //      Button C1DControlC,help={"Show the help file for combining VSANS data sets"} 
    827 //       
    828 //      // add the controls to each tab ---- all names start with "C1DControl_" 
    829 // 
    830 //      //tab(0) Load - initially visible 
    831 //      Button C1DControl_0a,pos={23,39},size={80,20},proc=C1D_LoadButtonProc,title="Load Data" 
    832 //      Button C1DControl_0a,help={"Load slit-smeared USANS data = \".cor\" files"} 
    833 //      CheckBox C1DControl_0b,pos={26,74},size={80,14},proc=C1D_LoadCheckProc,title="Log Axes?" 
    834 //      CheckBox C1DControl_0b,help={"Toggle Log/Lin Q display"},value= 1 
    835 //      TitleBox C1DControl_0c,pos={120,37},size={104,19},font="Courier",fSize=10 
    836 //      TitleBox C1DControl_0c,variable= $(ksCombine1DFolder+":gStr1") 
    837 //      PopupMenu C1DControl_0d,pos={120,75},size={71,20},title="Bin Type" 
    838 //      PopupMenu C1DControl_0d,help={"This popup selects how the y-axis will be linearized based on the chosen data"} 
    839 //      PopupMenu C1DControl_0d,value= ksBinTypeStr 
    840 //      PopupMenu C1DControl_0d,mode=1,proc=V_CombineModePopup 
    841 //      PopupMenu C1DControl_0e,pos={120,100},size={109,20},title="Data Source" 
    842 //      PopupMenu C1DControl_0e,mode=1,popvalue="RAW",value= #"\"RAW;SAM;EMP;BGD;COR;ABS;\""             
    843 //      Button C1DControl_0f,pos={200,39},size={120,20},proc=C1D_ConcatButtonProc,title="Concatenate" 
    844 //      Button C1DControl_0f,help={"Load slit-smeared USANS data = \".cor\" files"} 
    845 // 
    846 //       
    847 //      //tab(1) Mask 
    848 //      Button C1DControl_1a,pos={20,35},size={90,20},proc=C1D_MyMaskProc,title="Mask Point"            //bMask 
    849 //      Button C1DControl_1a,help={"Toggles the masking of the selected data point"} 
    850 //      Button C1DControl_1a,disable=1 
    851 //      Button C1DControl_1b,pos={20,65},size={140,20},proc=C1D_MaskGTCursor,title="Mask Q >= Cursor"           //bMask 
    852 //      Button C1DControl_1b,help={"Toggles the masking of all q-values GREATER than the current cursor location"} 
    853 //      Button C1DControl_1b,disable=1 
    854 //      Button C1DControl_1c,pos={20,95},size={140,20},proc=C1D_MaskLTCursor,title="Mask Q <= Cursor"           //bMask 
    855 //      Button C1DControl_1c,help={"Toggles the masking of all q-values LESS than the current cursor location"} 
    856 //      Button C1DControl_1c,disable=1 
    857 //      Button C1DControl_1d,pos={180,35},size={90,20},proc=C1D_ClearMaskProc,title="Clear Mask"                //bMask 
    858 //      Button C1DControl_1d,help={"Clears all mask points"} 
    859 //      Button C1DControl_1d,disable=1 
    860 //      Button C1DControl_1e,pos={180,65},size={90,20},proc=C1D_MaskPercent,title="Percent Mask"                //bMask 
    861 //      Button C1DControl_1e,help={"Clears all mask points"} 
    862 //      Button C1DControl_1e,disable=1 
    863 //       
    864 //       
    865 ////    Button C1DControl_1b,pos={144,66},size={110,20},proc=C1D_MaskDoneButton,title="Done Masking" 
    866 ////    Button C1DControl_1b,disable=1 
    867 //       
    868 ////    //tab(2) Rescale 
    869 //      Button C1DControl_2a,pos={31,42},size={90,20},proc=C1D_ExtrapolateButtonProc,title="Extrapolate" 
    870 //      Button C1DControl_2a,help={"Extrapolate the high-q region with a power-law"} 
    871 //      Button C1DControl_2a,disable=1 
    872 //      SetVariable C1DControl_2b,pos={31,70},size={100,15},title="# of points" 
    873 //      SetVariable C1DControl_2b,help={"Set the number of points for the power-law extrapolation"} 
    874 //      SetVariable C1DControl_2b,limits={5,100,1},value=_NUM:123 
    875 //      SetVariable C1DControl_2b,disable=1 
    876 //      CheckBox C1DControl_2c,pos={157,45},size={105,14},proc=C1D_ExtrapolationCheckProc,title="Show Extrapolation" 
    877 //      CheckBox C1DControl_2c,help={"Show or hide the high q extrapolation"},value= 1 
    878 //      CheckBox C1DControl_2c,disable=1 
    879 //      SetVariable C1DControl_2d,pos={31,96},size={150,15},title="Power Law Exponent" 
    880 //      SetVariable C1DControl_2d,help={"Power Law exponent from the fit = the DESMEARED slope - override as needed"} 
    881 //      SetVariable C1DControl_2d format="%5.2f" 
    882 //      SetVariable C1DControl_2d,limits={-inf,inf,0},value=_NUM:123 
    883 //      SetVariable C1DControl_2d,disable=1 
    884 //       
    885 //      Legend/C/N=text0/J/X=72.00/Y=60.00 
    886 // 
    887 //       
    888 //      SetDataFolder root: 
    889 //EndMacro 
    890 // 
    891 //// 
    892 //// recalculate the I(q) binning. no need to adjust model function or views 
    893 //// just rebin 
    894 //// 
    895 //// see V_BinningModePopup() in V_DataPlotting.ipf for a duplicate verison of this function 
    896 //Function V_CombineModePopup(ctrlName,popNum,popStr) : PopupMenuControl 
    897 //      String ctrlName 
    898 //      Variable popNum // which item is currently selected (1-based) 
    899 //      String popStr           // contents of current popup item as string 
    900 // 
    901 //// TODO 
    902 //// x- replace the type with selection from the panel - don't use the current display type 
    903 //      ControlInfo C1DControl_0e 
    904 //      String type = S_Value 
    905 // 
    906 //      SVAR gStr1 = $(ksCombine1DFolder+":gStr1") 
    907 //      gStr1 = type 
    908 //       
    909 //       
    910 //      V_QBinAllPanels(type,popNum) 
    911 // 
    912 // 
    913 //      String str,winStr="V_Combine_1D_Graph" 
    914 //      sprintf str,"(\"%s\",%d,\"%s\")",type,popNum,winStr 
    915 // 
    916 //// TODO: 
    917 //// x- replace these calls -- they work with the 1d plot, not this panel. I want them to do basically the same 
    918 ////    exact things, but with a different target window 
    919 ////  *** these calls now take the target window as a parameter - so that there is only one version 
    920 //      Execute ("V_Back_IQ_Graph"+str) 
    921 //      Execute ("V_Middle_IQ_Graph"+str) 
    922 //      Execute ("V_Front_IQ_Graph"+str) 
    923 //               
    924 //       
    925 //      return(0)        
    926 //End 
    927 // 
    928 // 
    929 //// function to control the drawing of buttons in the TabControl on the main panel 
    930 //// Naming scheme for the buttons MUST be strictly adhered to... else buttons will  
    931 //// appear in odd places... 
    932 //// all buttons are named C1DControl_NA where N is the tab number and A is the letter denoting 
    933 //// the button's position on that particular tab. 
    934 //// in this way, buttons will always be drawn correctly :-) 
    935 //// 
    936 //Function C1D_TabProc(ctrlName,tab) //: TabControl 
    937 //      String ctrlName 
    938 //      Variable tab 
    939 // 
    940 //      String ctrlList = ControlNameList("",";"),item="",nameStr="" 
    941 //      Variable num = ItemsinList(ctrlList,";"),ii,onTab 
    942 //      for(ii=0;ii<num;ii+=1) 
    943 //              //items all start w/"C1DControl_"               //11 characters 
    944 //              item=StringFromList(ii, ctrlList ,";") 
    945 //              nameStr=item[0,10] 
    946 //              if(cmpstr(nameStr,"C1DControl_")==0) 
    947 //                      onTab = str2num(item[11])                       //12th is a number 
    948 //                      ControlInfo $item 
    949 //                      switch(abs(V_flag))      
    950 //                              case 1: 
    951 //                                      Button $item,disable=(tab!=onTab) 
    952 //                                      break 
    953 //                              case 2:  
    954 //                                      CheckBox $item,disable=(tab!=onTab) 
    955 //                                      break 
    956 //                              case 5:  
    957 //                                      SetVariable $item,disable=(tab!=onTab) 
    958 //                                      break 
    959 //                              case 10:         
    960 //                                      TitleBox $item,disable=(tab!=onTab) 
    961 //                                      break 
    962 //                              case 4: 
    963 //                                      ValDisplay $item,disable=(tab!=onTab) 
    964 //                                      break 
    965 //                              case 3: 
    966 //                                      PopupMenu $item,disable=(tab!=onTab) 
    967 //                                      break 
    968 //                              // add more items to the switch if different control types are used 
    969 //                      endswitch 
    970 //                       
    971 //              endif 
    972 //      endfor  
    973 //       
    974 //      // remove the mask if I go back to the data? 
    975 //      if(tab==0) 
    976 //              RemoveMask() 
    977 ////            RemoveConcatenated() 
    978 //      endif 
    979 //       
    980 //      // masking 
    981 //      if(tab==1) 
    982 //              C1D_ClearMaskProc("")           //starts with a blank mask 
    983 //              C1D_MyMaskProc("")              //start masking if you click on the tab 
    984 //      else 
    985 //              C1D_MaskDoneButton("")          //masking is done if you click off the tab 
    986 //      endif 
    987 //       
    988 //      // rescaling 
    989 //      if(tab == 2) 
    990 //      // TODO 
    991 //      // -- fill this in 
    992 //      // -- this is still in the thought process at this point 
    993 //       
    994 //// do rescaling of the different sections of the data set 
    995 //               
    996 //      endif 
    997 //       
    998 //      return 0 
    999 //End 
    1000 // 
    1001 // 
    1002 //Proc AppendConcatenated() 
    1003 // 
    1004 //      if( strsearch(TraceNameList("V_Combine_1D_Graph", "", 1),"I_exp_orig",0,2) == -1)                       //Igor 5 
    1005 //              SetDataFolder $(ksCombine1DFolder) 
    1006 //              AppendToGraph/W=V_Combine_1D_Graph I_exp_orig vs Q_exp_orig 
    1007 //              ModifyGraph mode(I_exp_orig)=3,marker(I_exp_orig)=19,msize(I_exp_orig)=2,opaque(I_exp_orig)=1 
    1008 //              ModifyGraph rgb(I_exp_orig)=(0,0,0) 
    1009 //               
    1010 //              ModifyGraph tickUnit=1,log=1 
    1011 //              Modifygraph grid=1,mirror=2 
    1012 // 
    1013 //              ErrorBars/T=0 I_exp_orig Y,wave=(S_exp_orig,S_exp_orig) 
    1014 //               
    1015 //              setdatafolder root:  
    1016 //      endif 
    1017 //end 
    1018 // 
    1019 //Function RemoveConcatenated() 
    1020 // 
    1021 //      SetDataFolder $(ksCombine1DFolder) 
    1022 //      RemoveFromGraph/W=V_Combine_1D_Graph/Z I_exp_orig 
    1023 //      setdatafolder root: 
    1024 //end 
    1025 // 
    1026 //Proc AppendMask() 
    1027 // 
    1028 //      if( strsearch(TraceNameList("V_Combine_1D_Graph", "", 1),"MaskData",0,2) == -1)                 //Igor 5 
    1029 //              SetDataFolder $(ksCombine1DFolder) 
    1030 //              AppendToGraph/W=V_Combine_1D_Graph MaskData vs Q_exp_orig 
    1031 //              ModifyGraph mode(MaskData)=3,marker(MaskData)=8,msize(MaskData)=2.5,opaque(MaskData)=1 
    1032 //              ModifyGraph rgb(MaskData)=(65535,16385,16385) 
    1033 //               
    1034 //              setdatafolder root:  
    1035 //      endif 
    1036 //end 
    1037 // 
    1038 // 
    1039 // 
    1040 //Function RemoveMask() 
    1041 // 
    1042 //      SetDataFolder $(ksCombine1DFolder) 
    1043 //      RemoveFromGraph/W=V_Combine_1D_Graph/Z MaskData 
    1044 //      setdatafolder root: 
    1045 //end 
    1046 // 
    1047 // 
    1048 //// concatenate the data, and replace the multiple data sets with the concatenated set 
    1049 //// - then you can proceed to the mask tab 
    1050 //// 
    1051 //Function C1D_ConcatButtonProc(ctrlName) : ButtonControl 
    1052 //      String ctrlName 
    1053 // 
    1054 // 
    1055 //      ControlInfo C1DControl_0e 
    1056 //      String folderStr = S_Value 
    1057 // 
    1058 //      SVAR gStr1 = $(ksCombine1DFolder+":gStr1") 
    1059 //      gStr1 = folderStr 
    1060 // 
    1061 // 
    1062 //      ControlInfo C1DControl_0d 
    1063 //      Variable binType = V_BinTypeStr2Num(S_Value) 
    1064 //       
    1065 //      V_1DConcatenate("root:Packages:NIST:VSANS:",folderStr,"",binType) 
    1066 // 
    1067 //// sort the data set 
    1068 //      V_TmpSort1D("root:Packages:NIST:VSANS:",folderStr) 
    1069 //       
    1070 //// now copy the concatenated data over to the combine folder   
    1071 //      Duplicate/O $("root:Packages:NIST:VSANS:"+folderStr+":tmp_q") $(ksCombine1DFolder+":Q_exp")              
    1072 //      Duplicate/O $("root:Packages:NIST:VSANS:"+folderStr+":tmp_i") $(ksCombine1DFolder+":I_exp")              
    1073 //      Duplicate/O $("root:Packages:NIST:VSANS:"+folderStr+":tmp_s") $(ksCombine1DFolder+":S_exp")      
    1074 //      wave Q_exp = $(ksCombine1DFolder+":Q_exp") 
    1075 //      Wave I_exp = $(ksCombine1DFolder+":I_exp") 
    1076 //      Wave S_exp = $(ksCombine1DFolder+":S_exp") 
    1077 //       
    1078 // 
    1079 ////     
    1080 //      Duplicate/O $(ksCombine1DFolder+":Q_exp") $(ksCombine1DFolder+":Q_exp_orig") 
    1081 //      Duplicate/O $(ksCombine1DFolder+":I_exp") $(ksCombine1DFolder+":I_exp_orig") 
    1082 //      Duplicate/O $(ksCombine1DFolder+":S_exp") $(ksCombine1DFolder+":S_exp_orig") 
    1083 //      wave I_exp_orig = $(ksCombine1DFolder+":I_exp_orig") 
    1084 //       
    1085 //      Variable nq = numpnts($(ksCombine1DFolder+":Q_exp")) 
    1086 ////     
    1087 // 
    1088 ////    // append the (blank) wave note to the intensity wave 
    1089 ////    Note I_exp,"BOX=0;SPLINE=0;" 
    1090 ////    Note I_exp_orig,"BOX=0;SPLINE=0;" 
    1091 ////     
    1092 ////    //add data to the graph 
    1093 //      Execute "AppendConcatenated()"   
    1094 //       
    1095 //      // TODO: 
    1096 //      // -- do I clear off the old data here, or somewhere else? 
    1097 //      // clear off the old data from the individual panels 
    1098 //      // use ClearAllIQIfDisplayed() 
    1099 //      ClearIQIfDisplayed_AllBin(folderStr,"V_Combine_1D_Graph") 
    1100 // 
    1101 //      RemoveMask() 
    1102 //       
    1103 //      return(0) 
    1104 //End 
    1105 // 
    1106 //// step (1) - get the data from a WORK folder, and plot it 
    1107 //// clear out all of the "old" waves, remove them from the graph first 
    1108 //// 
    1109 //// ??produces Q_exp, I_exp, S_exp waves (and originals "_orig") 
    1110 //// add a dummy wave note that can be changed on later steps 
    1111 //// 
    1112 //Function C1D_LoadButtonProc(ctrlName) : ButtonControl 
    1113 //      String ctrlName 
    1114 // 
    1115 // 
    1116 //      String qStr,iStr,sStr,sqStr 
    1117 //      Variable nq,dqv,numBad,val 
    1118 //       
    1119 //      // remove any of the old traces on the graph and delete the waves and reset the global strings 
    1120 //      CleanUpJunk() 
    1121 //       
    1122 //      SetDataFolder root: 
    1123 //       
    1124 //      // go get the new data 
    1125 //      Execute "A_LoadOneDDataWithName(\"\",0)" 
    1126 // 
    1127 //// TODO:       
    1128 //      // x-Missing something here from the loader - go back to the LakeDesmearing ipf 
    1129 //      SVAR fname = root:Packages:NIST:gLastFileName           //this is the 1D file loaded 
    1130 // 
    1131 ////     
    1132 //      qStr = CleanupName((fName + "_q"),0)            //the q-wave 
    1133 //      iStr = CleanupName((fName + "_i"),0)            //the i-wave 
    1134 //      sStr = CleanupName((fName + "_s"),0)            //the s-wave 
    1135 ////    sqStr = CleanupName((fName + "sq"),0)           //the sq-wave 
    1136 //// 
    1137 //      String DFStr= CleanupName(fname,0) 
    1138 ////     
    1139 //      Duplicate/O $("root:"+DFStr+":"+qStr) $(ksCombine1DFolder+":Q_exp")              
    1140 //      Duplicate/O $("root:"+DFStr+":"+iStr) $(ksCombine1DFolder+":I_exp")              
    1141 //      Duplicate/O $("root:"+DFStr+":"+sStr) $(ksCombine1DFolder+":S_exp")      
    1142 //      wave Q_exp = $(ksCombine1DFolder+":Q_exp") 
    1143 //      Wave I_exp = $(ksCombine1DFolder+":I_exp") 
    1144 //      Wave S_exp = $(ksCombine1DFolder+":S_exp") 
    1145 //       
    1146 // 
    1147 ////     
    1148 //      Duplicate/O $(ksCombine1DFolder+":Q_exp") $(ksCombine1DFolder+":Q_exp_orig") 
    1149 //      Duplicate/O $(ksCombine1DFolder+":I_exp") $(ksCombine1DFolder+":I_exp_orig") 
    1150 //      Duplicate/O $(ksCombine1DFolder+":S_exp") $(ksCombine1DFolder+":S_exp_orig") 
    1151 //      wave I_exp_orig = $(ksCombine1DFolder+":I_exp_orig") 
    1152 //       
    1153 //      nq = numpnts($(ksCombine1DFolder+":Q_exp")) 
    1154 ////     
    1155 // 
    1156 ////    // append the (blank) wave note to the intensity wave 
    1157 ////    Note I_exp,"BOX=0;SPLINE=0;" 
    1158 ////    Note I_exp_orig,"BOX=0;SPLINE=0;" 
    1159 ////     
    1160 ////    //add data to the graph 
    1161 //      Execute "AppendConcatenated()" 
    1162 //       
    1163 //      SetDataFolder root: 
    1164 //End 
    1165 // 
    1166 //// remove any q-values <= val 
    1167 //Function RemoveBadQPoints(qw,iw,sw,val) 
    1168 //      Wave qw,iw,sw 
    1169 //      Variable val 
    1170 //       
    1171 //      Variable ii,num,numBad,qval 
    1172 //      num = numpnts(qw) 
    1173 //       
    1174 //      ii=0 
    1175 //      numBad=0 
    1176 //      do 
    1177 //              qval = qw[ii] 
    1178 //              if(qval <= val) 
    1179 //                      numBad += 1 
    1180 //              else            //keep the points 
    1181 //                      qw[ii-numBad] = qval 
    1182 //                      iw[ii-numBad] = iw[ii] 
    1183 //                      sw[ii-numBad] = sw[ii] 
    1184 //              endif 
    1185 //              ii += 1 
    1186 //      while(ii<num) 
    1187 //      //trim the end of the waves 
    1188 //      DeletePoints num-numBad, numBad, qw,iw,sw 
    1189 //      return(numBad) 
    1190 //end 
    1191 // 
    1192 //// if mw = Nan, keep the point, if a numerical value, delete it 
    1193 //Function RemoveMaskedPoints(mw,qw,iw,sw) 
    1194 //      Wave mw,qw,iw,sw 
    1195 //       
    1196 //      Variable ii,num,numBad,mask 
    1197 //      num = numpnts(qw) 
    1198 //       
    1199 //      ii=0 
    1200 //      numBad=0 
    1201 //      do 
    1202 //              mask = mw[ii] 
    1203 //              if(numtype(mask) != 2)          //if not NaN 
    1204 //                      numBad += 1 
    1205 //              else            //keep the points that are NaN 
    1206 //                      qw[ii-numBad] = qw[ii] 
    1207 //                      iw[ii-numBad] = iw[ii] 
    1208 //                      sw[ii-numBad] = sw[ii] 
    1209 //              endif 
    1210 //              ii += 1 
    1211 //      while(ii<num) 
    1212 //      //trim the end of the waves 
    1213 //      DeletePoints num-numBad, numBad, qw,iw,sw 
    1214 //      return(numBad) 
    1215 //end 
    1216 // 
    1217 //// produces the _msk waves that have the new number of data points 
    1218 //// 
    1219 //Function C1D_MaskDoneButton(ctrlName) : ButtonControl 
    1220 //      String ctrlName 
    1221 // 
    1222 // 
    1223 //      Variable aExists= strlen(CsrInfo(A)) > 0                        //Igor 5 
    1224 //      if(!aExists) 
    1225 //              return(1)               //possibly reverted data, no cursor, no Mask wave 
    1226 //      endif 
    1227 //       
    1228 //      Duplicate/O $(ksCombine1DFolder+":Q_exp_orig"),$(ksCombine1DFolder+":Q_msk") 
    1229 //      Duplicate/O $(ksCombine1DFolder+":I_exp_orig"),$(ksCombine1DFolder+":I_msk") 
    1230 //      Duplicate/O $(ksCombine1DFolder+":S_exp_orig"),$(ksCombine1DFolder+":S_msk") 
    1231 //      Wave Q_msk=$(ksCombine1DFolder+":Q_msk") 
    1232 //      Wave I_msk=$(ksCombine1DFolder+":I_msk") 
    1233 //      Wave S_msk=$(ksCombine1DFolder+":S_msk") 
    1234 //       
    1235 //      //finish up - trim the data sets and reassign the working set 
    1236 //      Wave MaskData=$(ksCombine1DFolder+":MaskData") 
    1237 //       
    1238 //      RemoveMaskedPoints(MaskData,Q_msk,I_msk,S_msk) 
    1239 // 
    1240 //      //reset the number of points 
    1241 //      NVAR gNq = $(ksCombine1DFolder+":gNq") 
    1242 //      gNq = numpnts(Q_msk) 
    1243 //       
    1244 //      Cursor/K A 
    1245 //      HideInfo 
    1246 //       
    1247 //      return(0) 
    1248 //End 
    1249 // 
    1250 // 
    1251 //// not quite the same as revert 
    1252 //Function C1D_ClearMaskProc(ctrlName) : ButtonControl 
    1253 //      String ctrlName 
    1254 //       
    1255 //      SetDataFolder $ksCombine1DFolder 
    1256 //       
    1257 //      Wave Q_exp_orig 
    1258 //      Duplicate/O Q_exp_orig MaskData 
    1259 //      MaskData = NaN          //use all data 
    1260 //                       
    1261 //      SetDataFolder root: 
    1262 // 
    1263 //      return(0) 
    1264 //end 
    1265 // 
    1266 //// when the mask tab is selected, A must be on the graph 
    1267 //// Displays MaskData wave on the graph 
    1268 //// 
    1269 //Function C1D_MyMaskProc(ctrlName) : ButtonControl 
    1270 //      String ctrlName 
    1271 //       
    1272 //       
    1273 //      Wave data=$(ksCombine1DFolder+":I_exp_orig") 
    1274 //       
    1275 //      SetDataFolder $ksCombine1DFolder 
    1276 //       
    1277 //      Variable aExists= strlen(CsrInfo(A)) > 0                        //Igor 5 
    1278 //               
    1279 //      if(aExists)             //mask the selected point 
    1280 //              // toggle NaN (keep) or Data value (= masked) 
    1281 //              Wave MaskData 
    1282 //              MaskData[pcsr(A)] = (numType(MaskData[pcsr(A)])==0) ? NaN : data[pcsr(A)]               //if NaN, doesn't plot  
    1283 //      else 
    1284 //              Wave I_exp_orig,Q_exp_orig 
    1285 //              Cursor /A=1/H=1/L=1/P/W=V_Combine_1D_Graph A I_exp_orig leftx(I_exp_orig) 
    1286 //              ShowInfo 
    1287 //              //if the mask wave does not exist, make one 
    1288 //              if(exists("MaskData") != 1) 
    1289 //                      Duplicate/O Q_exp_orig MaskData 
    1290 //                      MaskData = NaN          //use all data 
    1291 //              endif 
    1292 //              Execute "AppendMask()"   
    1293 //      endif 
    1294 // 
    1295 //      SetDataFolder root: 
    1296 // 
    1297 //      return(0) 
    1298 //End 
    1299 // 
    1300 //// when the mask button is pressed, A must be on the graph 
    1301 //// Displays MaskData wave on the graph 
    1302 //// 
    1303 //Function C1D_MaskLTCursor(ctrlName) : ButtonControl 
    1304 //      String ctrlName 
    1305 // 
    1306 //               
    1307 //      Variable aExists= strlen(CsrInfo(A)) > 0                        //Igor 5 
    1308 //       
    1309 //      if(!aExists) 
    1310 //              return(1) 
    1311 //      endif 
    1312 //// need to get rid of old smoothed data if data is re-masked 
    1313 ////    Execute "RemoveSmoothed()" 
    1314 ////    SetDataFolder $(ksCombine1DFolder) 
    1315 ////    Killwaves/Z I_smth,Q_smth,S_smth 
    1316 // 
    1317 //      SetDataFolder $(ksCombine1DFolder) 
    1318 // 
    1319 //      Wave data=I_exp_orig 
    1320 // 
    1321 //      Variable pt,ii 
    1322 //      pt = pcsr(A) 
    1323 //      for(ii=pt;ii>=0;ii-=1) 
    1324 //              // toggle NaN (keep) or Data value (= masked) 
    1325 //              Wave MaskData 
    1326 //              MaskData[ii] = (numType(MaskData[ii])==0) ? NaN : data[ii]              //if NaN, doesn't plot  
    1327 //      endfor 
    1328 // 
    1329 //      SetDataFolder root: 
    1330 //      return(0) 
    1331 //End 
    1332 // 
    1333 //// when the mask button is pressed, A must be on the graph 
    1334 //// Displays MaskData wave on the graph 
    1335 //// 
    1336 //Function C1D_MaskGTCursor(ctrlName) : ButtonControl 
    1337 //      String ctrlName 
    1338 //       
    1339 //      Variable aExists= strlen(CsrInfo(A)) > 0                        //Igor 5 
    1340 //       
    1341 //      if(!aExists) 
    1342 //              return(1) 
    1343 //      endif 
    1344 //// need to get rid of old smoothed data if data is re-masked 
    1345 ////    Execute "RemoveSmoothed()" 
    1346 ////    SetDataFolder $(ksCombine1DFolder) 
    1347 ////    Killwaves/Z I_smth,Q_smth,S_smth 
    1348 // 
    1349 //      SetDataFolder $(ksCombine1DFolder) 
    1350 // 
    1351 //      Wave data=I_exp_orig 
    1352 //       
    1353 //      Wave MaskData 
    1354 // 
    1355 //      Variable pt,ii,endPt 
    1356 //      endPt=numpnts(MaskData) 
    1357 //      pt = pcsr(A) 
    1358 //      for(ii=pt;ii<endPt;ii+=1) 
    1359 //              // toggle NaN (keep) or Data value (= masked) 
    1360 //              Wave MaskData 
    1361 //              MaskData[ii] = (numType(MaskData[ii])==0) ? NaN : data[ii]              //if NaN, doesn't plot  
    1362 //      endfor 
    1363 // 
    1364 //      SetDataFolder root: 
    1365 // 
    1366 //      return(0) 
    1367 //End 
    1368 // 
    1369 //// when the mask button is pressed, A must be on the graph 
    1370 //// Displays MaskData wave on the graph 
    1371 //// 
    1372 //Function C1D_MaskPercent(ctrlName) : ButtonControl 
    1373 //      String ctrlName 
    1374 //       
    1375 //      Variable aExists= strlen(CsrInfo(A)) > 0                        //Igor 5 
    1376 //       
    1377 //      if(!aExists) 
    1378 //              return(1) 
    1379 //      endif 
    1380 // 
    1381 // 
    1382 //      SetDataFolder $(ksCombine1DFolder) 
    1383 // 
    1384 //      Wave data=I_exp_orig 
    1385 //      Wave s_orig = S_exp_orig 
    1386 //      Wave MaskData 
    1387 // 
    1388 // 
    1389 //      Variable pct,ii,endPt 
    1390 //      endPt=numpnts(MaskData) 
    1391 // 
    1392 //      pct = 0.05 
    1393 //       
    1394 //      for(ii=0;ii<endPt;ii+=1) 
    1395 //              // toggle NaN (keep) or Data value (= masked) 
    1396 // 
    1397 //              MaskData[ii] = (abs(s_orig[ii]/data[ii]) < pct) ? NaN : data[ii]                //if NaN, doesn't plot  
    1398 //      endfor 
    1399 // 
    1400 // 
    1401 //      SetDataFolder root: 
    1402 // 
    1403 //      return(0) 
    1404 //End 
    1405 // 
    1406 // 
    1407 // 
    1408 // 
    1409 //Function CleanUpJunk() 
    1410 // 
    1411 //      // clean up the old junk on the graph, /Z for no error 
    1412 //      // TODO: 
    1413 //      // -- activate both of these functions to clean old data off of the graph 
    1414 ////    Execute "RemoveOldData()" 
    1415 //      Execute "RemoveMask()" 
    1416 //       
    1417 //      //remove the cursor 
    1418 //      Cursor/K A 
    1419 //       
    1420 //      //always re-initialize these 
    1421 //      String/G $(ksCombine1DFolder+":gStr1") = "" 
    1422 // 
    1423 //      // clean up the old waves from smoothing and desmearing steps 
    1424 //      SetDataFolder $(ksCombine1DFolder) 
    1425 //      Killwaves/Z MaskData,Q_msk,I_msk,S_msk 
    1426 //      SetDataFolder root: 
    1427 //End 
    1428 // 
    1429 // 
    1430 // 
    1431 //// I_dsm is the desmeared data 
    1432 //// 
    1433 //// step (7) - desmearing is done, write out the result 
    1434 //// 
    1435 //Function C1D_SaveButtonProc(ctrlName) : ButtonControl 
    1436 //      String ctrlName 
    1437 // 
    1438 // 
    1439 //      String saveStr 
    1440 //      SVAR curFile = $(ksCombine1DFolder+":gCurFile") 
    1441 //      saveStr = CleanupName((curFile),0)              //the output filename 
    1442 //      // 
    1443 // 
    1444 //      V_Write_VSANSMasked1D(saveStr,0,0,1)                    //use the full set (lo=hi=0) and present a dialog 
    1445 //       
    1446 //      SetDataFolder root: 
    1447 //      return(0) 
    1448 //End 
    1449 // 
    1450 //Function C1D_HelpButtonProc(ctrlName) : ButtonControl 
    1451 //      String ctrlName 
    1452 // 
    1453 //      DisplayHelpTopic/Z/K=1 "Combining VSANS Data" 
    1454 //      if(V_flag !=0) 
    1455 //              DoAlert 0,"The Combining VSANS Data Help file could not be found" 
    1456 //      endif 
    1457 //      return(0) 
    1458 //End 
    1459 // 
    1460 // 
    1461 ////toggles the log/lin display of the loaded data set 
    1462 //Function C1D_LoadCheckProc(ctrlName,checked) : CheckBoxControl 
    1463 //      String ctrlName 
    1464 //      Variable checked 
    1465 // 
    1466 //      ModifyGraph log=(checked) 
    1467 //      return(0) 
    1468 //End 
    1469 // 
    1470 // 
    1471 // 
    1472 // 
    1473 // 
    1474 //// TODO: 
    1475 //// -- either update this to be correct for VSANS, or dispatch to some other data writer. 
    1476 //// 
    1477 //Function V_Write_VSANSMasked1D(fullpath,lo,hi,dialog) 
    1478 //      String fullpath 
    1479 //      Variable lo,hi,dialog           //=1 will present dialog for name 
    1480 //       
    1481 //       
    1482 //      String termStr="\r\n" 
    1483 //      String destStr = ksCombine1DFolder 
    1484 //      String formatStr = "%15.6g %15.6g %15.6g %15.6g %15.6g %15.6g"+termStr 
    1485 //       
    1486 //      Variable refNum,integer,realval 
    1487 //       
    1488 //      //*****these waves MUST EXIST, or IGOR Pro will crash, with a type 2 error**** 
    1489 //      WAVE Q_msk=$(destStr + ":Q_msk") 
    1490 //      WAVE I_msk=$(destStr + ":I_msk") 
    1491 //      WAVE S_msk=$(destStr + ":S_msk") 
    1492 //       
    1493 //      //check each wave 
    1494 //      If(!(WaveExists(Q_msk))) 
    1495 //              Abort "Q_msk DNExist in WriteUSANSDesmeared()" 
    1496 //      Endif 
    1497 //      If(!(WaveExists(I_msk))) 
    1498 //              Abort "I_msk DNExist in WriteUSANSDesmeared()" 
    1499 //      Endif 
    1500 //      If(!(WaveExists(S_msk))) 
    1501 //              Abort "S_msk DNExist in WriteUSANSDesmeared()" 
    1502 //      Endif 
    1503 //       
    1504 //      // TODO: 
    1505 //      // -- this remnant from desmearing creates fake resolution waves!!! 
    1506 //      // -- correctly handle the input resolution waves 
    1507 //      // make dummy waves to hold the "fake" resolution, and write it as the last 3 columns 
    1508 //      // 
    1509 //      Duplicate/O Q_msk,res1,res2,res3 
    1510 //      res3 = 1                // "fake" beamstop shadowing 
    1511 //      res1 /= 100             //make the sigmaQ so small that there is no smearing 
    1512 //       
    1513 //      if(dialog) 
    1514 //              Open/D refnum as fullpath+".cmb"                //won't actually open the file 
    1515 //              If(cmpstr(S_filename,"")==0) 
    1516 //                      //user cancel, don't write out a file 
    1517 //                      Close/A 
    1518 //                      Abort "no data file was written" 
    1519 //              Endif 
    1520 //              fullpath = S_filename 
    1521 //      Endif 
    1522 //       
    1523 //      //write out partial set? 
    1524 //      Duplicate/O Q_msk,tq,ti,te 
    1525 //      ti=I_msk 
    1526 //      te=S_msk 
    1527 //      if( (lo!=hi) && (lo<hi)) 
    1528 //              redimension/N=(hi-lo+1) tq,ti,te,res1,res2,res3         //lo to hi, inclusive 
    1529 //              tq=Q_msk[p+lo] 
    1530 //              ti=I_msk[p+lo] 
    1531 //              te=S_msk[p+lo] 
    1532 //      endif 
    1533 //       
    1534 //      //tailor the output given the type of data written out... 
    1535 //      String samStr="",dateStr="",str1,str2 
    1536 // 
    1537 //       
    1538 //      samStr = fullpath 
    1539 //      dateStr="CREATED: "+date()+" at  "+time() 
    1540 // 
    1541 // 
    1542 //       
    1543 //      //actually open the file 
    1544 //      Open refNum as fullpath 
    1545 //       
    1546 //      fprintf refnum,"%s"+termStr,samStr 
    1547 ////    fprintf refnum,"%s"+termStr,str1 
    1548 ////    fprintf refnum,"%s"+termStr,str2 
    1549 //      fprintf refnum,"%s"+termStr,dateStr 
    1550 //       
    1551 //      wfprintf refnum, formatStr, tq,ti,te,res1,res2,res3 
    1552 //       
    1553 //      Close refnum 
    1554 //       
    1555 //      Killwaves/Z ti,tq,te,res1,res2,res3 
    1556 //       
    1557 //      Return(0) 
    1558 //End 
    1559 // 
    1560 // 
    1561 // 
    1562 // 
    1563 //Function V_GetScalingInOverlap(num2,wave1q,wave1i,wave2q,wave2i) 
    1564 //      Variable num2           //largest point number of wave2 in overlap region 
    1565 //      Wave wave1q,wave1i,wave2q,wave2i                //1 = first dataset, 2= second dataset 
    1566 // 
    1567 //      Variable ii,ival1,newi,ratio 
    1568 //      ratio=0 
    1569 //      ii=0 
    1570 //      do 
    1571 //              //get scaling factor at each point of wave 2 in the overlap region 
    1572 //              newi = interp(wave2q[ii],wave1q,wave1i)         //get the intensity of wave1 at an overlap point 
    1573 //              ratio += newi/wave2i[ii]                                        //get the scale factor 
    1574 //              //Print "ratio = ",ratio 
    1575 //              ii+=1 
    1576 //      while(ii<=num2) 
    1577 //      Variable val 
    1578 //      val = ratio/(num2+1)            // +1 counts for point zero 
    1579 //      //Print "val = ",val 
    1580 // 
    1581 //      Variable tol=1.05                       //5% is the preferred number (for Andrew and Lionel, at least) 
    1582 // 
    1583 ////    ControlInfo/W=NSORT_Panel WarningCheck 
    1584 ////    if(( V_Value==1 ) && ( (val > tol) || (val < 1/tol) ) ) 
    1585 ////            String str="" 
    1586 ////            sprintf str,"The scaling factor is more than a factor of %g from 1. Proceed with caution.\r",tol 
    1587 ////            DoAlert 0,str 
    1588 ////    endif 
    1589 //       
    1590 //      Return val 
    1591 //End 
    1592  
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DIVUtils.ipf

    r1078 r1079  
    33// 
    44// ******** 
    5 // TODO -- this is an incomplete DIV file. need to identify how to generate a real DIV file 
    6 //     for the different detectors, and how to fill it into a file.  
     5// TODO -- this file is preliminary. It has not yet been tested on enough real data 
     6//    to generate a DIV file. 
    77//    Not sure how it will be measured in practice on VSANS. 
    88// 
    9 //   JAN 2017 
     9//   JAN 2018 
    1010// 
    1111// TODO: 
    12 // -- complete the description of the steps needed... 
     12// x- complete the description of the steps needed... 
    1313// Data needs to be reduced to the "COR" level - that means that the  
    1414// PLEX data has been added to work files, and the empty and blocked beam have been 
     
    3535 
    3636 
    37 /// TODO: 
    38 // -- need a way to view the DIV data (each panel) and see the stats on the values 
     37/// DONE: 
     38// x- need a way to view the DIV data (each panel) and see the stats on the values 
    3939//  (maybe a simple panel viewer, one-at-a-time, or all 4 as individuals, not on the same scale) 
    4040 
     
    4848// x- then I need to be able to read the error in (done) 
    4949 
    50  
    51  
    52 // Basic function: 
    53 // -- Setup_VSANS_DIV_Struct() 
    54 // 
    55 // -- Clear the DIV data folder: V_KillWavesInFolder("DIV") 
    56 // 
    57 // -- reduce the data (to the COR level?) 
    58  
    59 // -- V_NormalizeDIV() (one panel at a time, using the mask) 
    60 // -- V_CopyDIVToSave() -or- V_CopyDIVToSave_OnePanel() 
    61  
    62 // -- Save_VSANS_DIV_Nexus()  
    63 // 
    6450 
    6551 
     
    192178// type is the work folder where the (? corrected) data is currently 
    193179// 
    194 // TODO 
     180// DONE 
    195181// x- data should be copied to some alternate work folder before this step 
    196182// x- for T/B detectors, this may not work as intended if the whole detector is not illuminated. 
     
    257243// type is the work folder where the (? corrected) data is currently 
    258244// 
    259 // TODO 
     245// NOTE (Currently unused. use V_NormalizeDIV_onePanel() instead) 
     246// 
    260247// -- data should be copied to some alternate work folder before this step 
    261248// -- for T/B detectors, this may not work as intended if the whole detector is not illuminated. 
     
    339326 
    340327 
    341 // TODO 
     328 
    342329// currently, there are no dummy fill values or attributes for the fake DIV file 
    343330// 
     
    381368End 
    382369 
    383 ////////////// fake DIV file tests 
     370////////////// DIV file tests 
    384371// 
    385372// 
     
    389376// file header. nothing more is needed (possibly) 
    390377// 
    391 // TODO -- I want to re-visit the propagation of errors in the DIV file. No errors are ever calculated/saved  
    392 //   during the generation of the file, but there's no reason it couldn't. the idea is that the plex 
    393 //   is counted so long that the errors are insignificant compared to the data errors, but that may not 
    394 //   always be the case. A bit of math may prove this. or not. Plus, the situation for VSANS may be different. 
    395 // 
    396 // 
    397 // TODO -- make the number of pixels GLOBAL 
     378// 
     379// 
     380// TODO -- correct the number of pixels for the BACK detector 
    398381// 
    399382Proc H_Setup_VSANS_DIV_Structure() 
     
    500483// x- any manipulations, stats ? 
    501484// x- add an "update" button (to update the status of the data - this may be automatic with an operation) 
    502 // -- add a "load DIV" button 
    503 // -- add a "copy" button 
     485// -- add a "load DIV" button (to make it easy) 
     486// -- add a "copy" button (to fill move data to STO and SUB) 
    504487// x- add a "ratio" button 
    505488// x- add a "difference" button 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DetectorCorrections.ipf

    r1078 r1079  
    397397// both beam considitions (+/- 0.0 mm). FTB was +/- 0.8 mm, MTB +/- 2 mm 
    398398        if(cmpstr(detStr,"FL") == 0 || cmpstr(detStr,"FR") == 0) 
    399                 gap = 16.8              //mm 
     399                gap = 3.8               //mm 
    400400        endif 
    401401        if(cmpstr(detStr,"FT") == 0 || cmpstr(detStr,"FB") == 0) 
    402                 gap = 20                //mm 
     402                gap = 5         //mm 
    403403        endif 
    404404        if(cmpstr(detStr,"ML") == 0 || cmpstr(detStr,"MR") == 0) 
    405                 gap = 14.6              //mm 
     405                gap = 5.9               //mm 
    406406        endif 
    407407        if(cmpstr(detStr,"MT") == 0 || cmpstr(detStr,"MB") == 0) 
    408                 gap = 15                //mm 
     408                gap = 5         //mm 
    409409        endif 
    410410// TODO: this is the line to keep, to replace the hard-wired values 
     
    875875        w_err /= solid_angle            // 
    876876 
    877 // TODO -- clean up after I'm satisfied computations are correct                 
    878 //      KillWaves/Z tmp_theta,tmp_dist 
     877// DONE x- clean up after I'm satisfied computations are correct                 
     878        KillWaves/Z tmp_theta,tmp_dist 
    879879         
    880880        return(0) 
     
    11251125         
    11261126 
    1127         // TODO -- clean up after I'm satisfied computations are correct                 
     1127        // DONE x- clean up after I'm satisfied computations are correct                 
    11281128        KillWaves/Z tmp_theta,tmp_dist,tmp_err,lat_err 
    11291129         
     
    11321132 
    11331133 
    1134 // 
    1135 // TODO: 
    1136 //   --         DoAlert 0,"This has not yet been updated for VSANS" 
     1134 
    11371135// 
    11381136//test procedure, not called anymore 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_PatchFiles.ipf

    r1070 r1079  
    1818 
    1919// TODO 
    20 // -- not all of the functions here have been prefixed with "V_", especially the action procedures from the panel 
     20// x- not all of the functions here have been prefixed with "V_", especially the action procedures from the panel 
    2121//   so this cannot be opened with the SANS Reduction, or there will be clashes 
    2222// -- same file load/reload issue as with other operations that read a field from the file. ANY read requires 
     
    10121012//*****this function actually writes the data to disk***** 
    10131013// 
    1014 // TODO - re-write a series of these function to mirror the "fill" functions 
     1014// DONE x- re-write a series of these function to mirror the "fill" functions 
    10151015//   specific to each tab 
    10161016// 
    1017 // TODO x- clear out the old data and force a re-load from disk, or the old data 
     1017// DONE x- clear out the old data and force a re-load from disk, or the old data 
    10181018//    will be read in from the RawVSANS folder, and it will look like nothing was written 
    10191019//                      (done in the calling function) 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Protocol_Reduction.ipf

    r1073 r1079  
    19331933 
    19341934// 
    1935 // TODO: 
     1935// DONE: 
    19361936// x- this is no longer done after the COR step, and CAL is not produced as output of DIV        
    19371937// x- needs to be aware of the file name passed in 
     
    22572257 
    22582258// 
    2259 // TODO 
     2259// DONE 
    22602260//              x- fill in the "ask" step 
    2261 //  -- none is OK, except if the kill fails for any reason 
     2261//  x- none is OK, except if the kill fails for any reason 
    22622262// x- the regular case of the file name specified by the protocol works correctly 
    22632263// x- don't create a null mask if not used, it will handle the error and print out that the mask is missing 
     
    23952395        endswitch 
    23962396 
    2397 // TODO 
     2397// DONE 
    23982398// x- this call will bin the active type, then the next call bins the active type 
    23992399// x- then later, I dispatch to bin the active type...   
     
    25502550 
    25512551// 
    2552 // TODO 
    2553 // -- fill in all of the functionality for calculation from direct beam 
     2552// DONE 
     2553// x- fill in all of the functionality for calculation from direct beam 
    25542554//  and verify that the calculations are numerically correct 
    25552555// 
     
    25892589                //empty beam flux file selected, prompt for file, and use this to calculate KAPPA 
    25902590 
    2591                 // TODO 
     2591                // DONE 
    25922592                // x- need an empty beam file name 
    25932593                // 
     
    25982598                endif 
    25992599 
    2600                 // TODO 
     2600                // DONE 
    26012601                // x- need panel 
    26022602                // 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_RAW_Data_Panel.ipf

    r1075 r1079  
    1717// 
    1818// -- have the status automatically fill in when a new file is loaded, rather than needing a click of the "status" button 
    19 // -- need a place somewhere to show the currently displayed folder 
    20 // -- checkboxes for "active" corrections? 
    21 // -- display of Q, counts, QxQy, X and Y 
    22 // -- do I need a color bar? or is this not used at all? I like it to be there, or the colors are a waste of information 
     19// x- need a place somewhere to show the currently displayed folder 
     20// x- checkboxes for "active" corrections? 
     21// x- display of Q, counts, QxQy, X and Y 
     22// x- do I need a color bar? or is this not used at all? I like it to be there, or the colors are a waste of information 
    2323//              (then... where do I put the color bar?) 
    24 // -- define the "hook" function, and attach it to the panel (or the main detector subwindow?) 
     24// x- define the "hook" function, and attach it to the panel (or the main detector subwindow?) 
    2525// 
    2626 
     
    400400                                        // now figure out q 
    401401                                        // calculate the q-values, will be different depending on which panel is up (pixel size, geometry, etc.) 
    402                                         // TODO: !!!! get rid of the hard-wired values 
    403                                         // TODO: be sure that the units from HDF are what I expect 
    404                                         // TODO: beam center XY are pixels in the file, expected in the function, but are better suited for mm or cm 
    405                                         // TODO: units of xy pixel size are likely wrong 
     402                                        // DONE: !!!! get rid of the hard-wired values 
     403                                        // DONE: be sure that the units from HDF are what I expect 
     404                                        // DONE: beam center XY are pixels in the file, expected in the function, but are better suited for mm or cm 
     405                                        // DONE: units of xy pixel size are likely wrong 
    406406//                                      xctr = V_getDet_beam_center_x(gCurDispType,detStr)              //written in pixels 
    407407//                                      yctr = V_getDet_beam_center_y(gCurDispType,detStr) 
     
    419419                                        Wave data_realDistY = $(destPath + ":entry:instrument:detector_"+detStr+":data_realDistY")       
    420420                                         
    421 // TODO: figure out what coordinates I need to pass -- xloc, yloc, textX, testY, (+1 on any?)                            
     421// DONE: figure out what coordinates I need to pass -- xloc, yloc, textX, testY, (+1 on any?)                            
    422422                                        //gQQ = VC_CalcQval(testX,testY,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 
    423423                                        //gQX = VC_CalcQX(testX,testY,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 
     
    718718End 
    719719 
    720 // TODO 
     720//  
    721721// 
    722722// move one file number back 
     
    738738End 
    739739 
    740 // TODO 
     740//  
    741741// 
    742742// move one file number forward 
     
    817817// if the data display is RAW, convert to the specified WORK data type 
    818818// 
    819 // TODO 
    820 // -- better error checking 
    821 // -- if the data type is not RAW, can I Copy Folder instead? 
     819// DONE 
     820// x- better error checking 
     821// x- if the data type is not RAW, can I Copy Folder instead? 
    822822// 
    823823Function V_ToWorkFileButtonProc(ba) : ButtonControl 
     
    827827                case 2: // mouse up 
    828828                        // click code here 
    829                         //Convert_to_Workfile(newtype, doadd) // a proc 
     829                         
    830830                        Execute "V_Convert_to_Workfile()" 
    831831 
     
    890890End 
    891891 
    892 // TODO 
     892//  
    893893// 
    894894// gets the status of the currently displayed file and dumps it to the panel (not the cmd window) 
     
    11221122End 
    11231123 
    1124 //TODO 
     1124// 
    11251125// 
    11261126// this "spreads" the display of panels to a nominal separation for easier viewing 
     
    11421142End 
    11431143 
    1144 //TODO 
     1144// 
    11451145// 
    11461146// this "restores" the display of panels to their actual position based on the apparent beam center 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_TubeAdjustments.ipf

    r1051 r1079  
    11011101//////////////////////////////////// 
    11021102// 
    1103 // TODO  
    1104 // -- document the "simple" save of the detector panels for import and subsequent fitting. 
     1103// DONE  
     1104// x- document the "simple" save of the detector panels for import and subsequent fitting. 
     1105//   Documentation is done in the "main" VSANS documentation, and is largely not needed, since Phil 
     1106//   is doing the nonlinear calibration calculations, not me. 
     1107// 
    11051108// 
    11061109// takes the data from RAW, by default. This is OK, since even though whatever is in the calibration data 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_USANS_SlitSmearing_v40.ipf

    r1078 r1079  
    22#pragma version=3.00 
    33#pragma IgorVersion=6.1 
     4 
     5 
     6/////// 
     7// JAN 2018 
     8// 
     9// 
     10// This is a first approximation to model slit smeared VSANS data 
     11// - the dQv value is now a "per-Q" quantity, rather than a single global value 
     12//  -- this still needs to be verified mathematically that this is valid 
     13// - the wavelength smearing is not accounted for at all. 
     14//  -- this is significant issue for White Beam conditions 
     15// 
     16// To use this, include BOTH the VSANS reduction macros, and the Analysis Macros. 
     17// (otherwise, slit smeared data will be interpreted as USANS) 
     18// 
     19 
     20 
     21 
     22 
    423 
    524//Functions for doing USANS Slit smearing by method of weight matrix 
     
    1837//// July 2008 SRK 
    1938// 
    20 // For fitting withe cursors, the matrix must be recalculated for the exact range of the data 
     39// For fitting with cursors, the matrix must be recalculated for the exact range of the data 
    2140// - but the inital dependency of the model (any number of them) was (were) set up to use the full matrix 
    2241// -- so: 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Utilities_General.ipf

    r1073 r1079  
    430430 
    431431// TODO 
     432// -- getting the file_name from the root: global is a poor choice.  
     433//     Need a better, more reliable solution than this 
     434// 
     435// DONE 
    432436// x- load in the proper file 
    433437// x- re-click the I(q) button 
    434438// x- be sure that the globals are updated w/ filename 
    435 // -- getting the file_name from the root: global is a poor choice.  
    436 //     Need a better, more reliable solution than this 
    437 // -- make a copy of "oldName" that is local and not the SVAR, as the SVAR changes 
     439// x- make a copy of "oldName" that is local and not the SVAR, as the SVAR changes 
    438440//    when the next file is loaded in (if it's not in RawVSANS), resulting in a "skipped" file number 
    439441// 
     
    788790// local function 
    789791// 
    790 // TODO -- is this really necessary anymore for the NON-VAX files of VSANS. 
    791 // -- can this be made a pass-through, or will there be another function that is needed for VSANS? 
     792// DONE  
     793// x- this is essentially a pass-through, since there are no version numbers for VSANS data files 
     794//    it is kept in case there are conditions in the future. 
    792795// 
    793796Function/S V_ValidFileString(partialName) 
Note: See TracChangeset for help on using the changeset viewer.