Changeset 923


Ignore:
Timestamp:
Sep 19, 2013 2:24:48 PM (10 years ago)
Author:
srkline
Message:

Changes to:
Polarization - to correct naming errors when saving polarization panel states. Names were too long.

Event Mode - improved the re-loading of split oscillatory data sets. Also allows easier editing of the list of split files to re-load for decimation.

FFT/real space - Modified gizmo to automatically color the different SLDs present. Limitied to 5 different SLDs due to a limitation of the voxelgram. If more than 5 SLDs are present (solvent does not count), then the extra ones are not displayed. Also modified KR-3Cyl procedures to be able to save/import a table of coordinates.

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

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_KR_Parser.ipf

    r840 r923  
    392392        Button button_2,pos={178,50},size={150,20},proc=KR_GenerateButtonProc,title="Generate Structure" 
    393393        Button button_4,pos={178,80},size={120,20},proc=KR_DoCalcButtonProc,title="Do Calculation" 
    394         Button button_3,pos={600,50},size={120,20},proc=KR_DeleteRow,title="Delete Row(s)" 
     394        Button button_3,pos={600,60},size={120,20},proc=KR_DeleteRow,title="Delete Row(s)" 
     395        Button button_5,pos={600,10},size={120,20},proc=KR_SaveTable,title="Save Table" 
     396        Button button_6,pos={600,35},size={120,20},proc=KR_ImportTable,title="Import Table" 
    395397        ValDisplay valdisp_0,pos={339,16},size={80,13},title="FFT_T" 
    396398        ValDisplay valdisp_0,limits={0,0,0},barmisc={0,1000},value= #"root:FFT_T" 
     
    462464End 
    463465 
     466Function KR_SaveTable(ba) : ButtonControl 
     467        STRUCT WMButtonAction &ba 
     468 
     469        switch( ba.eventCode ) 
     470                case 2: // mouse up 
     471                         
     472//                      xx,yy,zz,rri,hti,rotx,roty,sld 
     473                        Save/T/P=home/I xx,yy,zz,rri,hti,rotx,roty,sld as "SavedCyl.itx" 
     474                         
     475                        break 
     476        endswitch 
     477 
     478        return 0 
     479End 
     480 
     481Function KR_ImportTable(ba) : ButtonControl 
     482        STRUCT WMButtonAction &ba 
     483 
     484        switch( ba.eventCode ) 
     485                case 2: // mouse up 
     486                         
     487                        LoadWave/T/O/P=home                      
     488                        break 
     489        endswitch 
     490 
     491        return 0 
     492End 
    464493 
    465494//just generates the structure, no calculation 
     
    505534//                      fDoBinned_KR_FFTPanel(npt,qmin,qmax) 
    506535//       
     536 
     537                        //force a redraw (re-coloring) of the gizmo window 
     538                        FFTMakeGizmoButtonProc("") 
    507539                         
    508540                        break 
    509541        endswitch 
    510542 
     543 
     544         
    511545        return 0 
    512546End 
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_Panel.ipf

    r849 r923  
    540540                Execute "Gizmo_VoxelMat()" 
    541541        endif 
     542        ColorizeGizmo() 
    542543End 
    543544 
     
    919920        return(est) 
    920921End 
     922 
     923 
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_VoxelDisplay.ipf

    r840 r923  
    4646End 
    4747 
     48 
     49Function ColorizeGizmo() 
     50 
     51        Wave mat = root:mat 
     52        ParseMatrix3D_rho(mat) 
     53         
     54        Wave rho3D = root:rho3D 
     55        NVAR solventSLD = root:FFT_SolventSLD 
     56 
     57        Variable np,val,ii,ind 
     58        string str 
     59 
     60// how many different SLDs are there? 
     61        //loop through the rho wave, disregarding the solvent 
     62        Duplicate/O rho3D tmpSLD 
     63        Make/O/D/N=0 SLD_id 
     64        SLD_id = 0 
     65        np = 0 
     66 
     67        if(numpnts(rho3D)==0) 
     68                return(0)               //nothing in matrix, get out 
     69        endif 
     70 
     71        do 
     72                val = WaveMin(tmpSLD) 
     73                if(val != solventSLD && val != 1e10) 
     74                        np += 1 
     75                        InsertPoints numpnts(SLD_id),1,SLD_id 
     76                        SLD_id[np-1] = val 
     77                endif 
     78                tmpSLD = (tmpSLD == val) ? 1e10 : tmpSLD                // set the values to 1e10 
     79        while(val != 1e10) 
     80        KillWaves/Z tmpSLD       
     81 
     82        Variable numDiffSLD = numpnts(SLD_id) 
     83        if(numdiffSLD > 5) 
     84                DoAlert 0,"Only 5 different colors can be displayed. Some SLDs will not be displayed." 
     85        endif 
     86//      print SLD_id 
     87 
     88//// now loop through and colorize the different parts 
     89        Make/O/D/N=5 rr,gg,bb,aa 
     90        rr = {0,1,4.57771e-05,0.8,0} 
     91        gg = {0.244434,0,0.6,0.799954,0} 
     92        bb = {1,0,0,0,0} 
     93        aa = 0.2 
     94         
     95        for(ii=0;ii<5;ii+=1) 
     96                ind = ii 
     97//      for(ii=0;ii<numDiffSLD;ii+=1) 
     98//              ind = mod(ii,5)         //loop through the 5 colors 
     99                str = "ModifyGizmo/N=Gizmo_VoxelMat ModifyObject=voxelgram0 property={ valueRGBA," 
     100                str += num2istr(ind)+"," 
     101                str += num2istr(SLD_id[ind])+"," 
     102                str += num2str(rr[ind])+"," 
     103                str += num2str(gg[ind])+"," 
     104                str += num2str(bb[ind])+"," 
     105                str += num2str(aa[ind])+"}" 
     106                         
     107//              ModifyGizmo/N=Gizmo_VoxelMat ModifyObject=voxelgram0 property={ valueRGBA,ii,SLD_id[ii],rr[ii],gg[ii],bb[ii],aa[ii]} 
     108//              print str 
     109                execute str 
     110        endfor 
     111         
     112        return(0) 
     113End 
    48114 
    49115// a simple slice viewer ? where did this come from? 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/Polarization/Pol_FlipperPanel.ipf

    r915 r923  
    12241224        Variable num,ii,refnum 
    12251225         
    1226         fname = "CellDecayPanelSaveState" 
     1226        fname = "CellDecaySaveState" 
    12271227         
    12281228        // get a list of the Decay waves 
     
    13371337        Variable num,ii,refnum 
    13381338         
    1339         fname = "FlipperPanelSaveState" 
     1339        fname = "FlipperSaveState" 
    13401340         
    13411341        // get a list of the "Condition" waves 
     
    13521352        Endif 
    13531353         
    1354         Open/P=home refnum      // as fname             // creates a new file, or overwrites the existing file   
     1354        Open/P=home refnum      as fname                // creates a new file, or overwrites the existing file   
    13551355        fprintf refNum,"IGOR\r" 
    13561356                         
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/Polarization/Pol_PolarizationCorrection.ipf

    r915 r923  
    152152         
    153153         
    154         Open/P=home refnum// as fname           // creates a new file, or overwrites the existing file   
     154        Open/P=home refnum as fname             // creates a new file, or overwrites the existing file   
    155155        fprintf refNum,"IGOR\r" 
    156156                         
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/EventModeProcessing.ipf

    r918 r923  
    247247        Button button14,pos={488,350},size={120,20},proc=Stream_LoadDecim,title="Load Split List" 
    248248        Button button19,pos={619,350},size={120,20},proc=Stream_LoadAdjustedList,title="Load Edited List" 
     249        Button button20,pos={650,376},size={90,20},proc=ShowList_ToLoad,title="Show List" 
    249250        SetVariable setvar3,pos={487,378},size={150,16},title="Decimation factor" 
    250251        SetVariable setvar3,fSize=10 
     
    11081109                 
    11091110        SetDataFolder root:Packages:NIST:Event 
     1111         
     1112        Wave slicedData = slicedData 
     1113        Wave logSlicedData = logSlicedData 
     1114        Wave dispSliceData = dispSliceData 
     1115         
    11101116        if(checked) 
     1117                logslicedData = log(slicedData) 
    11111118                Duplicate/O logslicedData dispsliceData 
    11121119        else 
     
    23712378                         
    23722379                        // load in the waves, saved as Igor text to preserve the data type 
    2373                         LoadWave/T/O 
     2380                        LoadWave/T/O/P=catPathName 
    23742381                        filePathStr = S_fileName 
    23752382                        if(strlen(S_fileName) == 0) 
     
    29832990        SVAR str = root:Packages:NIST:Event:gSplitFileList 
    29842991         
    2985         Make/O/T/N=1 root:Packages:NIST:Event:SplitFileWave 
    2986         WAVE tw = root:Packages:NIST:Event:SplitFileWave 
    2987          
     2992        WAVE/T/Z tw = root:Packages:NIST:Event:SplitFileWave 
     2993        if(waveExists(tw) != 1)  
     2994                Make/O/T/N=1 root:Packages:NIST:Event:SplitFileWave 
     2995                WAVE/T/Z tw = root:Packages:NIST:Event:SplitFileWave 
     2996        endif 
     2997 
    29882998        List2TextWave(str,tw) 
    29892999        Edit tw 
     
    30383048                case 2: 
    30393049                        DoAlert 0,"The accumulated data is now the display data and is ready for display or export." 
    3040                         Duplicate/O accumulatedData slicedData           
     3050                        Duplicate/O accumulatedData slicedData 
     3051                        // do something to "touch" the display to force it to update 
     3052                        NVAR gLog = root:Packages:NIST:Event:gEvent_logint 
     3053                        LogIntEvent_Proc("",gLog) 
    30413054                        break 
    30423055                default:                         
     
    33673380End 
    33683381 
     3382Function ShowList_ToLoad(ctrlName) 
     3383        String ctrlName 
     3384         
     3385        ShowSplitFileTable() 
     3386         
     3387        return(0) 
     3388End 
    33693389 
    33703390 
Note: See TracChangeset for help on using the changeset viewer.