Changeset 656


Ignore:
Timestamp:
Mar 31, 2010 2:54:41 PM (12 years ago)
Author:
ajj
Message:

Update to CatVSTable to show sample position, TISANE to fix a couple of startup bugs and FuzzySpheres? to add the lorentzian term.

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

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models/NewModels_2009/FuzzySpheres_Sq_v40.ipf

    r570 r656  
    1111// 
    1212// SRK JUL 2009 
     13// 
     14// Use different volume fraction and radius for hard sphere interaction as Stieger et al. 
     15// 
     16// 
     17// AJJ Feb 2010 
     18 
    1319 
    1420// 
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models/NewModels_2009/FuzzySpheres_v40.ipf

    r570 r656  
    1212// 
    1313// SRK JUL 2009 
     14// 
     15// Include lorentzian term for *high* Q component of the scattering. 
     16// 
     17// AJJ Feb 2010 
     18 
     19#include "Lorentz_model_v40" 
    1420 
    1521Proc PlotFuzzySpheres(num,qmin,qmax) 
     
    2127        Make/O/D/N=(num) xwave_fuzz,ywave_fuzz 
    2228        xwave_fuzz = alog( log(qmin) + x*((log(qmax)-log(qmin))/num) ) 
    23         Make/O/D coef_fuzz = {0.01,60,0.2,10,1e-6,3e-6,0.001} 
    24         make/O/T parameters_fuzz = {"Volume Fraction (scale)","mean radius (A)","polydisp (sig/avg)","interface thickness (A)","SLD sphere (A-2)","SLD solvent (A-2)","bkg (cm-1 sr-1)"} 
     29        Make/O/D coef_fuzz = {0.01,60,0.2,10,1e-6,3e-6,1,50,0.001} 
     30        make/O/T parameters_fuzz = {"Volume Fraction (scale)","mean radius (A)","polydisp (sig/avg)","interface thickness (A)","SLD sphere (A-2)","SLD solvent (A-2)","Lorentz Scale","Lorentz length","bkg (cm-1 sr-1)"} 
    2531        Edit parameters_fuzz,coef_fuzz 
    2632         
     
    4955         
    5056        // Setup parameter table for model function 
    51         Make/O/D smear_coef_fuzz = {0.01,60,0.2,10,1e-6,3e-6,0.001}                                      
    52         make/o/t smear_parameters_fuzz = {"Volume Fraction (scale)","mean radius (A)","polydisp (sig/avg)","interface thickness (A)","SLD sphere (A-2)","SLD solvent (A-2)","bkg (cm-1 sr-1)"}   
     57        Make/O/D smear_coef_fuzz = {0.01,60,0.2,10,1e-6,3e-6,1,50,0.001}                                         
     58        make/o/t smear_parameters_fuzz = {"Volume Fraction (scale)","mean radius (A)","polydisp (sig/avg)","interface thickness (A)","SLD sphere (A-2)","SLD solvent (A-2)","Lorentz Scale","Lorentz length","bkg (cm-1 sr-1)"}  
    5359        Edit smear_parameters_fuzz,smear_coef_fuzz                                       
    5460         
     
    9298        variable xx 
    9399         
    94         Variable scale,rad,pd,sig,rho,rhos,bkg,delrho,sig_surf 
     100        Variable scale,rad,pd,sig,rho,rhos,bkg,delrho,sig_surf,lor_sf,lor_len 
    95101         
    96102        //set up the coefficient values 
     
    103109        rhos=w[5] 
    104110        delrho=rho-rhos 
    105         bkg=w[6] 
     111        bkg=w[8] 
    106112 
    107113         
     
    180186         
    181187        inten *= scale 
     188         
     189        //Lorentzian term 
     190        Make/O/N=3 tmp_lor 
     191        tmp_lor[0] = w[6] 
     192        tmp_lor[1] = w[7] 
     193        tmp_lor[2] = 0 
     194         
     195        inten+=fLorentz_model(tmp_lor,xx) 
     196         
    182197        inten+=bkg 
    183198         
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/CatVSTable.ipf

    r647 r656  
    5757        Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:Field" 
    5858        Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:MCR"              //added Mar 2008 
     59        Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:Pos"              //added Mar 2010 
    5960#if (exists("ILL_D22")==6) 
    6061        Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:Reactorpower"       //activate for ILL, June 2008, 
     
    8384        WAVE Field = $"root:myGlobals:CatVSHeaderInfo:Field" 
    8485        WAVE MCR = $"root:myGlobals:CatVSHeaderInfo:MCR"                //added Mar 2008 
     86        WAVE Pos = $"root:myGlobals:CatVSHeaderInfo:Pos" 
    8587         
    8688         
     
    100102                ModifyTable width(:myGlobals:CatVSHeaderInfo:Field)=50 
    101103                ModifyTable width(:myGlobals:CatVSHeaderInfo:MCR)=50 
     104                ModifyTable width(:myGlobals:CatVSHedaerInfo:Pos)=30 
    102105#if (exists("ILL_D22")==6) 
    103106                ModifyTable width(:myGlobals:CatVSHeaderInfo:Reactorpower)=50           //activate for ILL, June 2008 
     
    209212        Wave GField = $"root:myGlobals:CatVSHeaderInfo:Field" 
    210213        Wave GMCR = $"root:myGlobals:CatVSHeaderInfo:MCR"               //added Mar 2008 
    211          
     214        Wave GPos = $"root:myGlobals:CatVSHeaderInfo:Pos" 
    212215#if (exists("ILL_D22")==6) 
    213216        Wave GReactPow = $"root:myGlobals:CatVSHeaderInfo:ReactorPower"         //activate for ILL June 2008 ( and the sort line too) 
    214         Sort GSuffix, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens,GRunNumber,GIsTrans,GRot,GTemp,GField,GMCR,GReactPow 
     217        Sort GSuffix, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens,GRunNumber,GIsTrans,GRot,GTemp,GField,GMCR,GPos,GReactPow 
    215218#endif 
    216219 
     
    219222        Sort GSuffix, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens,GRunNumber,GIsTrans,GRot,GTemp,GField,GMCR,gNumGuides 
    220223#else 
    221         //must be HFIR or ANSTO 
    222         Sort GSuffix, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens,GRunNumber,GIsTrans,GRot,GTemp,GField,GMCR 
     224//      Sort GSuffix, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens,GRunNumber,GIsTrans,GRot,GTemp,GField,GMCR 
     225        Sort GSuffix, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens,GRunNumber,GIsTrans,GRot,GTemp,GField,GMCR,GPos,gNumGuides 
    223226#endif 
    224227 
     
    248251        Wave Field= $"root:myGlobals:CatVSHeaderInfo:Field" 
    249252        Wave MCR = $"root:myGlobals:CatVSHeaderInfo:MCR"                //added Mar 2008 
     253        Wave Pos = $"root:myGlobals:CatVSHeaderInfo:Pos" 
    250254#if (exists("ILL_D22")==6) 
    251255// for ILL 
    252256        Wave ReactorPower = $"root:myGlobals:CatVSHeaderInfo:reactorpower"       //activate for ILL, June 08 (+ edit line) 
    253         Edit Filenames, Labels, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens, RotAngle, Temperature, Field, MCR, ReactorPower as "Data File Catalog" 
     257        Edit Filenames, Labels, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens, RotAngle, Temperature, Field, MCR, Pos, ReactorPower as "Data File Catalog" 
    254258#endif 
    255259 
     
    258262//      Edit Filenames, Labels, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens, RotAngle, Temperature, Field, MCR as "Data File Catalog" 
    259263// with numGuides 
    260         Edit Filenames, Labels, DateAndTime, SDD, Lambda, numGuides, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens, RotAngle, Temperature, Field, MCR as "Data File Catalog" 
     264        Edit Filenames, Labels, DateAndTime, SDD, Lambda, numGuides, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens, RotAngle, Temperature, Field, MCR, Pos as "Data File Catalog" 
    261265// alternate ordering, put the magnetic information first 
    262266//      Edit Filenames, Labels, RotAngle, Temperature, Field, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens as "Data File Catalog" 
     
    304308        Wave GField = $"root:myGlobals:CatVSHeaderInfo:Field" 
    305309        Wave GMCR = $"root:myGlobals:CatVSHeaderInfo:MCR" 
     310        Wave GPos = $"root:myGlobals:CatVSHeaderInfo:Pos" 
    306311#if (exists("ILL_D22")==6) 
    307312        Wave GReactpow = $"root:myGlobals:CatVSHeaderInfo:reactorpower"         //activate for ILL, Jne 2008, (+ last insert @ end of function)  
     
    393398        InsertPoints lastPoint,1,GMCR 
    394399        GMCR[lastPoint]  = getMonitorCount(fname)/ctime         //total monitor count / total count time 
     400 
     401        //Sample Position 
     402        InsertPoints lastPoint,1,GPos 
     403        GPos[lastPoint] = getSamplePosition(fname) 
    395404 
    396405#if (exists("ILL_D22")==6) 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_DataReadWrite.ipf

    r641 r656  
    15141514         
    15151515        return(getRealValueFromHeader(fname,170)) 
     1516end 
     1517 
     1518//Sample position in changer 
     1519Function getSamplePosition(fname) 
     1520        String fname 
     1521         
     1522        return(getRealValueFromHeader(fname,166)) 
    15161523end 
    15171524 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/TISANE.ipf

    r609 r656  
    2626 
    2727Function Init_TISANE() 
    28         String/G root:MyGlobals:gTISANE_logfile 
    29         Variable/G      root:MyGlobals:AIMTYPE_XY=0 // XY Event 
    30         Variable/G      root:MyGlobals:AIMTYPE_XYM=2 // XY Minor event 
    31         Variable/G      root:MyGlobals:AIMTYPE_MIR=1 // Minor rollover event 
    32         Variable/G      root:MyGlobals:AIMTYPE_MAR=3 // Major rollover event 
    33  
    34         Variable/G root:MyGlobals:gTISANE_time_msw = 0 
    35         Variable/G root:MyGlobals:gTISANE_time_lsw = 0 
    36         Variable/G root:MyGlobals:gTISANE_t_longest = 0 
    37  
    38         Variable/G root:MyGlobals:gTISANE_tsdisp //Displayed slice 
    39         Variable/G root:MyGlobals:gTISANE_nslices = 10  //Number of time slices 
    40         Variable/G root:MyGlobals:gTISANE_slicewidth  = 1000 //Slicewidth in us  
    41          
    42         Variable/G root:MyGlobals:gTISANE_prescan // Do we prescan the file? 
    43         Variable/G root:MyGlobals:gTISANE_logint = 1 
    44  
    45         SetDataFolder root: 
    46         NewDataFolder/O/S root:TISANE 
     28        String/G root:Packages:NIST:gTISANE_logfile 
     29        Variable/G      root:Packages:NIST:AIMTYPE_XY=0 // XY Event 
     30        Variable/G      root:Packages:NIST:AIMTYPE_XYM=2 // XY Minor event 
     31        Variable/G      root:Packages:NIST:AIMTYPE_MIR=1 // Minor rollover event 
     32        Variable/G      root:Packages:NIST:AIMTYPE_MAR=3 // Major rollover event 
     33 
     34        Variable/G root:Packages:NIST:gTISANE_time_msw = 0 
     35        Variable/G root:Packages:NIST:gTISANE_time_lsw = 0 
     36        Variable/G root:Packages:NIST:gTISANE_t_longest = 0 
     37 
     38        Variable/G root:Packages:NIST:gTISANE_tsdisp //Displayed slice 
     39        Variable/G root:Packages:NIST:gTISANE_nslices = 10  //Number of time slices 
     40        Variable/G root:Packages:NIST:gTISANE_slicewidth  = 1000 //Slicewidth in us  
     41         
     42        Variable/G root:Packages:NIST:gTISANE_prescan // Do we prescan the file? 
     43        Variable/G root:Packages:NIST:gTISANE_logint = 1 
     44 
     45        NVAR nslices = root:Packages:NIST:gTISANE_nslices 
     46         
     47        SetDataFolder root: 
     48        NewDataFolder/O/S root:Packages:NIST:TISANE 
     49         
     50        Make/O/N=(XBINS,YBINS,nslices) slicedData 
     51        Duplicate/O slicedData logslicedData 
     52        Duplicate/O slicedData dispsliceData 
    4753         
    4854        SetDataFolder root: 
     
    5157Proc TISANE() 
    5258        PauseUpdate; Silent 1           // building window... 
    53         NewPanel/K=1 /W=(100,50,600,680)/N=TISANE 
     59        NewPanel/K=2 /W=(100,50,600,680)/N=TISANE 
    5460        DoWindow/C TISANE 
    5561        ModifyPanel fixedSize=1,noEdit =1 
     
    5965        Button button0,proc=LoadTISANELog_Proc 
    6066        SetVariable setvar3,pos= {20,590},size={460,20},title=" ",fSize=12 
    61         SetVariable setvar3,disable=2,variable=root:myGlobals:gTISANE_logfile 
     67        SetVariable setvar3,disable=2,variable=root:Packages:NIST:gTISANE_logfile 
    6268        CheckBox chkbox1,pos={170,15},title="Prescan file? (increases load time)" 
    63         CheckBox chkbox1,variable = root:myGlobals:gTISANE_prescan 
     69        CheckBox chkbox1,variable = root:Packages:NIST:gTISANE_prescan 
     70        Button doneButton,pos={400,10}, size={50,20},title="Done",fSize=12 
     71        Button doneButton,proc=TISANEDone_Proc 
    6472         
    6573        //DrawLine 10,35,490,35 
     
    6775        Button button1,proc=ProcessLog_Proc 
    6876        SetVariable setvar1,pos={170,50},size={160,20},title="Number of slices",fSize=12 
    69         SetVariable setvar1,value=root:myGlobals:gTISANE_nslices 
     77        SetVariable setvar1,value=root:Packages:NIST:gTISANE_nslices 
    7078        SetVariable setvar2,pos={330,50},size={160,20},title="Slice Width (us)",fSize=12 
    71         SetVariable setvar2,value=root:myGlobals:gTISANE_slicewidth 
     79        SetVariable setvar2,value=root:Packages:NIST:gTISANE_slicewidth 
    7280        //DrawLine 10,65,490,65 
    7381         
    7482        CheckBox chkbox2,pos={20,95},title="Log Intensity",value=1 
    75         CheckBox chkbox2,variable=root:myGlobals:gTISANE_logint,proc=LogInt_Proc 
     83        CheckBox chkbox2,variable=root:Packages:NIST:gTISANE_logint,proc=LogInt_Proc 
    7684        SetVariable setvar0,pos={320,90},size={160,20},title="Display Time Slice",fSize=12 
    77         SetVariable setvar0,value= root:myGlobals:gTISANE_tsdisp 
     85        SetVariable setvar0,value= root:Packages:NIST:gTISANE_tsdisp 
    7886        SetVariable setvar0,proc=sliceSelect_Proc 
    7987        Display/W=(20,120,480,580)/HOST=TISANE/N=TISANE_slicegraph 
    80         AppendImage/W=TISANE#TISANE_slicegraph/T :TISANE:dispsliceData 
     88        AppendImage/W=TISANE#TISANE_slicegraph/T root:Packages:NIST:TISANE:dispsliceData 
    8189        ModifyImage/W=TISANE#TISANE_slicegraph  ''#0 ctab= {*,*,Rainbow,0} 
    8290        ModifyImage/W=TISANE#TISANE_slicegraph ''#0 ctabAutoscale=3 
     
    98106         
    99107        Variable fileref 
    100         SVAR filename = root:MyGlobals:gTISANE_logfile 
    101         NVAR prescan = root:MyGlobals:gTISANE_prescan 
    102         NVAR slicewidth = root:MyGlobals:gTISANE_slicewidth 
    103         NVAR nslices = root:MyGlobals:gTISANE_nslices 
    104         NVAR t_longest = root:MyGlobals:gTISANE_t_longest 
     108        SVAR filename = root:Packages:NIST:gTISANE_logfile 
     109        NVAR prescan = root:Packages:NIST:gTISANE_prescan 
     110        NVAR slicewidth = root:Packages:NIST:gTISANE_slicewidth 
     111        NVAR nslices = root:Packages:NIST:gTISANE_nslices 
     112        NVAR t_longest = root:Packages:NIST:gTISANE_t_longest 
    105113         
    106114        Open/R/D fileref 
     
    115123End 
    116124 
     125Function TISANEDone_Proc(ba) : ButtonControl 
     126        STRUCT WMButtonAction &ba 
     127         
     128        String win = ba.win 
     129        switch (ba.eventCode) 
     130                case 2: 
     131                        DoWindow/K TISANE 
     132                        break 
     133        endswitch 
     134 
     135End 
     136 
    117137Function ProcessLog_Proc(ctrlName) : ButtonControl 
    118138        String ctrlName 
    119139 
    120         NVAR slicewidth = root:MyGlobals:gTISANE_slicewidth 
    121         NVAR nslices = root:MyGlobals:gTISANE_nslices 
     140        NVAR slicewidth = root:Packages:NIST:gTISANE_slicewidth 
     141        NVAR nslices = root:Packages:NIST:gTISANE_nslices 
    122142         
    123143        ProcessLog(nslices,slicewidth) 
     
    129149        Variable checked 
    130150                 
    131         SetDataFolder root:TISANE 
     151        SetDataFolder root:Packages:NIST:TISANE 
    132152        if(checked) 
    133153                Duplicate/O logslicedData dispsliceData 
     
    145165        String varName 
    146166         
    147         NVAR nslices = root:MyGlobals:gTISANE_nslices 
    148         NVAR selectedslice = root:MyGlobals:gTISANE_tsdisp 
     167        NVAR nslices = root:Packages:NIST:gTISANE_nslices 
     168        NVAR selectedslice = root:Packages:NIST:gTISANE_tsdisp 
    149169         
    150170        if(varNum < 0) 
     
    163183        Variable nslices,slicewidth 
    164184         
    165         NVAR time_msw = root:MyGlobals:gTISANE_time_msw 
    166         NVAR time_lsw = root:MyGlobals:gTISANE_time_lsw 
    167         NVAR t_longest = root:MyGlobals:gTISANE_t_longest 
    168          
    169         NVAR logint = root:MyGlobals:gTISANE_logint 
    170          
    171         SVAR filepathstr = root:MyGlobals:gTISANE_logfile 
    172         SetDataFolder root:TISANE 
     185        NVAR time_msw = root:Packages:NIST:gTISANE_time_msw 
     186        NVAR time_lsw = root:Packages:NIST:gTISANE_time_lsw 
     187        NVAR t_longest = root:Packages:NIST:gTISANE_t_longest 
     188         
     189        NVAR logint = root:Packages:NIST:gTISANE_logint 
     190         
     191        SVAR filepathstr = root:Packages:NIST:gTISANE_logfile 
     192        SetDataFolder root:Packages:NIST:TISANE 
    173193 
    174194        //Create bin lookup 
     
    258278        Variable nticks,nslices 
    259279         
    260         WAVE t_lookup = root:TISANE:t_lookup 
     280        WAVE t_lookup = root:Packages:NIST:TISANE:t_lookup 
    261281         
    262282        Variable i 
     
    275295Function PreProcessLog() 
    276296         
    277         NVAR time_msw = root:MyGlobals:gTISANE_time_msw 
    278         NVAR time_lsw = root:MyGlobals:gTISANE_time_lsw 
    279         NVAR t_longest = root:MyGlobals:gTISANE_t_longest 
    280          
    281         SVAR filepathstr = root:MyGlobals:gTISANE_logfile 
    282         SetDataFolder root:TISANE 
     297        NVAR time_msw = root:Packages:NIST:gTISANE_time_msw 
     298        NVAR time_lsw = root:Packages:NIST:gTISANE_time_lsw 
     299        NVAR t_longest = root:Packages:NIST:gTISANE_t_longest 
     300         
     301        SVAR filepathstr = root:Packages:NIST:gTISANE_logfile 
     302        SetDataFolder root:Packages:NIST:TISANE 
    283303 
    284304        Variable fileref 
Note: See TracChangeset for help on using the changeset viewer.