Ignore:
Timestamp:
Feb 17, 2012 12:04:13 PM (11 years ago)
Author:
srkline
Message:

changes to FFT routines to clean things up for a beta release at the next startup. No functionality changes, just cleaning up the operation, interface, and menu items.

Some important changes to the polarization routines. New equations for calculating the coefficient matrix. Now appears to be correct. Also, proper proportions are used when adding multiple files together to the matrix.

Change to the Model Docs is an updated reference.

WorkFileUtils? was broken when I changed to use linear_data exclusively. This has now been fixed and it operates as expected.

PackageLoader? now has menu items (under Macros) for the Polarization routines. These may later be moved to the SANS menu.

Location:
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/RawWindowHook.ipf

    r829 r836  
    112112                //show the "next" buttons 
    113113                //these buttons should only be available in RAW data type 
    114                 Button backOne size={20,20},pos={350,23},proc=BackOneFileButtonProc,title="<" 
     114                Button backOne win=SANS_Data,size={20,20},pos={350,23},proc=BackOneFileButtonProc,title="<" 
    115115                Button backOne help={"Display the previous RAW data file run number"} 
    116                 Button forwardOne size={20,20},pos={375,23},proc=ForwardOneFileButtonProc,title=">" 
     116                Button forwardOne win=SANS_Data,size={20,20},pos={375,23},proc=ForwardOneFileButtonProc,title=">" 
    117117                Button forwardOne help={"Display the next RAW data file run number"} 
    118118                // 
    119119        else 
    120120                //kill them 
    121                 KillControl backOne 
    122                 KillControl forwardOne 
     121                KillControl/W=SANS_Data backOne 
     122                KillControl/W=SANS_Data forwardOne 
    123123        Endif 
    124124         
    125125        //reset the slider values to 0,1 
    126         Slider loSlide,value=0 
    127         Slider hiSlide,value=1 
     126        Slider loSlide win=SANS_Data,value=0 
     127        Slider hiSlide win=SANS_Data,value=1 
    128128         
    129129        //remove old data and add new data to it 
     
    132132        WAVE data = $(curPath + ":data") 
    133133        WAVE NIHColors = $"root:myGlobals:NIHColors" 
    134         AppendImage data 
     134        AppendImage/W=SANS_Data data 
    135135   WaveStats/Q $(curPath + ":data") 
    136136   if(cmpstr(cur_folder,"MSK")==0) 
    137                 ModifyImage data ctab={0,1,BlueRedGreen,0} 
     137                ModifyImage/W=SANS_Data data ctab={0,1,BlueRedGreen,0} 
    138138   else 
    139139        //Call the procedure that would normally be called if the sliders were moved 
     
    144144        endif 
    145145        //make the pixels square, color the backgrounds 
    146         ModifyGraph width={plan,1,bottom,left},mirror=0 
    147         ModifyGraph axisenab(bottom)={0,0.7} 
    148         ModifyGraph axOffset(left)=-3 
    149         ModifyGraph standoff=0 
    150         ModifyGraph wbRGB=(65535,54611,49151),gbRGB=(65535,54611,49151),cbRGB=(1,52428,52428) 
     146        ModifyGraph/W=SANS_Data width={plan,1,bottom,left},mirror=0 
     147        ModifyGraph/W=SANS_Data axisenab(bottom)={0,0.7} 
     148        ModifyGraph/W=SANS_Data axOffset(left)=-3 
     149        ModifyGraph/W=SANS_Data standoff=0 
     150        ModifyGraph/W=SANS_Data wbRGB=(65535,54611,49151),gbRGB=(65535,54611,49151),cbRGB=(1,52428,52428) 
    151151         
    152152        //add the qx and qy axes 
     
    155155        Set_Q_Axes(q_x_axis,q_y_axis,curPath) 
    156156        RemoveFromGraph/Z q_x_axis,q_y_axis 
    157         AppendToGraph/T q_x_axis 
    158         AppendToGraph/R=Right_Q q_y_axis                                //plot on a free axis, crossing at x=127 (pixelsX) 
    159         ModifyGraph freePos(Right_q)={pixelsX-1,bottom} 
    160         ModifyGraph minor(top)=1,minor(Right_Q)=1,lowTrip(top)=1e-05,lowTrip(Right_Q)=1e-05 
    161         ModifyGraph mode(q_x_axis)=2,mode(q_y_axis)=2           //dots 
    162         ModifyGraph axisEnab(top)={0,0.7} 
     157        AppendToGraph/W=SANS_Data/T q_x_axis 
     158        AppendToGraph/W=SANS_Data/R=Right_Q q_y_axis                            //plot on a free axis, crossing at x=127 (pixelsX) 
     159        ModifyGraph/W=SANS_Data freePos(Right_q)={pixelsX-1,bottom} 
     160        ModifyGraph/W=SANS_Data minor(top)=1,minor(Right_Q)=1,lowTrip(top)=1e-05,lowTrip(Right_Q)=1e-05 
     161        ModifyGraph/W=SANS_Data mode(q_x_axis)=2,mode(q_y_axis)=2               //dots 
     162        ModifyGraph/W=SANS_Data axisEnab(top)={0,0.7} 
    163163 
    164164        //add the color bar 
    165         ColorScale/N=colBar/A=RT/X=-3/Y=-1.5/Z=1 image=data, heightPct=100, widthPct=4,notation=1 
    166         ColorScale/C/N=colBar/B=(65535,60076,49151) 
     165        ColorScale/W=SANS_Data/N=colBar/A=RT/X=-3/Y=-1.5/Z=1 image=data, heightPct=100, widthPct=4,notation=1 
     166        ColorScale/W=SANS_Data/C/N=colBar/B=(65535,60076,49151) 
    167167         
    168168        //update the displayed filename, using FileList in the current data folder 
     
    176176        //always set to linear 
    177177        //re-draw the data on the graph to make sure "data" from the current folder is being used 
    178         ControlInfo bisLog 
     178        ControlInfo/W=SANS_Data bisLog 
    179179        if(V_flag ==1)  //if bisLog exists, this will return true 
    180                 Button bisLog,title="isLin",rename=bisLin 
     180                Button bisLog,win=SANS_Data,title="isLin",rename=bisLin 
    181181        endif 
    182182        //now that button state and data are sure to match (both are linear) 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/WorkFileUtils.ipf

    r824 r836  
    12171217        NVAR pixelsY = root:myGlobals:gNPixelsY 
    12181218         
    1219         WAVE/Z data1=$("root:Packages:NIST:"+workMathStr+"File_1:data") 
     1219        WAVE/Z data1=$("root:Packages:NIST:"+workMathStr+"File_1:linear_data") 
    12201220        WAVE/Z err1=$("root:Packages:NIST:"+workMathStr+"File_1:linear_data_error") 
    12211221         
     
    12301230                //Load set #2 
    12311231                Load_NamedASC_File(pathStr+str2,workMathStr+"File_2") 
    1232                 WAVE/Z data2=$("root:Packages:NIST:"+workMathStr+"File_2:data") 
     1232                WAVE/Z data2=$("root:Packages:NIST:"+workMathStr+"File_2:linear_data") 
    12331233                WAVE/Z err2=$("root:Packages:NIST:"+workMathStr+"File_2:linear_data_error") 
    12341234        Endif 
     
    12371237         
    12381238        //now that we know that data exists, convert each of the operands to linear scale 
    1239         ConvertFolderToLinearScale(workMathStr+"File_1") 
    1240         If(cmpstr(str2,"UNIT MATRIX")!=0) 
    1241                 ConvertFolderToLinearScale(workMathStr+"File_2")                //don't need to convert unit matrix to linear 
    1242         endif 
     1239//      ConvertFolderToLinearScale(workMathStr+"File_1") 
     1240//      If(cmpstr(str2,"UNIT MATRIX")!=0) 
     1241//              ConvertFolderToLinearScale(workMathStr+"File_2")                //don't need to convert unit matrix to linear 
     1242//      endif 
     1243 
    12431244        //copy contents of str1 folder to dest and create the wave ref (it will exist) 
    12441245        CopyWorkContents(workMathStr+"File_1",workMathStr+dest) 
    1245         WAVE/Z destData=$("root:Packages:NIST:"+workMathStr+dest+":data") 
     1246        WAVE/Z destData=$("root:Packages:NIST:"+workMathStr+dest+":linear_data") 
     1247        WAVE/Z destData_log=$("root:Packages:NIST:"+workMathStr+dest+":data") 
    12461248        WAVE/Z destErr=$("root:Packages:NIST:"+workMathStr+dest+":linear_data_error") 
    12471249         
     
    12701272        endswitch 
    12711273         
     1274        destData_log = log(destData)            //for display 
    12721275        //show the result 
    12731276        WorkMath_Display_PopMenuProc("",0,"Result") 
     1277         
     1278        PopupMenu popup4 win=WorkFileMath,mode=3                //3rd item selected == Result 
    12741279End 
    12751280 
     
    13381343        // if file1 or file2, load in the data and display 
    13391344        if(cmpstr(popStr,"File_1")==0) 
    1340                 ControlInfo popup0 
     1345                ControlInfo/W=WorkFileMath popup0 
    13411346                str1 = S_Value 
    13421347        Endif 
    13431348        if(cmpstr(popStr,"File_2")==0) 
    1344                 ControlInfo popup1 
     1349                ControlInfo/W=WorkFileMath popup1 
    13451350                str1 = S_Value 
    13461351        Endif 
Note: See TracChangeset for help on using the changeset viewer.