Ignore:
Timestamp:
Apr 11, 2013 4:08:43 PM (10 years ago)
Author:
srkline
Message:

minor changes to the MC scripting, more examples of looping to generate long "runs"

Modified the NCNR loader (Macros menu) to include different facility packages, hopefully exclusive. Will need final tweaking once we settle on file names.

For the USANS procedures from KIST - changed the names to have "KIST_" prefix, and changed NCNR-specific to have "NCNR_" prefix, and I'll do the same with the SANS reduction procedures. Then all will be consistent, and each set of facility-specific files will be grouped in a directory listing.

Location:
sans/Dev/trunk/NCNR_User_Procedures/Reduction
Files:
4 added
4 deleted
1 edited

Legend:

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

    r902 r903  
    245245End 
    246246 
     247// this example was really used, run repeatedly with different count times to get 
     248// replicate data sets to test the overlap 
     249Function Example_Loop_1DSim() 
     250 
     251        String confList,ctTimeList,saveNameList,funcStr,titleStr 
     252         
     253 
     254        Sim_SetSimulationType(0)                //kill the simulation panel 
     255        Sim_SetSimulationType(1)                //open the 1D simulation panel 
     256         
     257//(1)   enter the (unsmeared) function name 
     258        funcStr = "DAB_model" 
     259        Wave cw = $("root:"+getFunctionCoef(funcStr)) 
     260        Sim_SetModelFunction(funcStr)                                           // model function name 
     261                 
     262//(2) model coefficients here, if needed. Wave name is "cw" 
     263//   then set the sample thickness. Be sure to use an appropriate incoherent background in the model 
     264        Sim_Set1D_Transmission(0.8)                                             // For 1D, I need to supply the transmission 
     265        Sim_SetThickness(0.1)                                                           // thickness 
     266        Sim_Set1D_ABS(1)                                                                                // absolute scaling (1== yes) 
     267        Sim_Set1D_Noise(1)                                                                      // noise (1== yes, add statistical noise) 
     268 
     269 
     270        cw = {1e-05,200,0} 
     271         
     272         
     273//(3) set the configuration list, times, and saved names 
     274// -- the mumber of listed configurations must match the number of discrete count times and save names 
     275// titleStr is the label and is the same for each run of the same sample 
     276        confList = "Config_4m;" 
     277        ctTimeList = ""         //filled in the loop 
     278        saveNameList = "" 
     279        titleStr = "DAB versus count time t = " 
     280 
     281        Make/O/D ctTime = {5,11,16,21,27,32,37,43,48,53,107,160,214,267,321,374,428,481,535,1604,5348,21390,53476} 
     282 
     283        Variable ii=0,nTrials=10,jj 
     284         
     285        for(jj=0;jj<numpnts(ctTime);jj+=1)       
     286                for(ii=0;ii<nTrials;ii+=1) 
     287                        titleStr = "DAB versus count time t = "+num2str(ctTime[jj]) 
     288                        saveNameList = "DAB_4m_t"+num2str(ctTime[jj])+"_"+num2str(ii)+".abs;" 
     289                        ctTimeList = num2str(ctTime[jj])+";" 
     290                        // then this runs the samples as listed 
     291                        Sim_RunSample_1D(confList,ctTimeList,titleStr,saveNameList) 
     292                endfor 
     293        endfor 
     294 
     295        // no transmissions or empty beam measurements to make for 1D simulation 
     296 
     297        return(0)        
     298End 
     299 
     300 
     301 
     302 
     303 
    247304// pass in a semicolon delimited list of configurations + corresponding count times + saved names 
    248305Function Sim_RunSample_1D(confList,ctTimeList,titleStr,saveNameList) 
Note: See TracChangeset for help on using the changeset viewer.