Ignore:
Timestamp:
Nov 8, 2007 5:05:14 PM (15 years ago)
Author:
srkline
Message:

Adding three new 2D functions, the easy ones that use a Gaussian distribution of parameters.

Changed the parsing of constraints to only build a constraint wave for those parameters that are not being held. failing to do so results in an "unknown error" from curve fitting. This fix was done in both the 1D and 2D wrappers.

Changed the default mask that was two pixels all around to now mask out the beamstop for 2D data sets. 8 pixel radius is currently hard-wired in PlotUtils2D - and is generated as the fit is dispatched, automatically determining the beam center from the data set.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/Models_2D/Cylinder_2D.ipf

    r197 r198  
    1313// 
    1414 
    15  
    1615///  REQUIRES DANSE XOP for 2D FUNCTIONS 
    1716 
     
    2322        String str 
    2423        Prompt str,"Pick the data folder containing the 2D data",popup,getAList(4) 
    25          
    26         // if any of the resolution waves are missing => abort 
    27 //      if(ResolutionWavesMissingDF(str))               //updated to NOT use global strings (in GaussUtils) 
    28 //              Abort 
    29 //      endif 
    3024         
    3125        SetDataFolder $("root:"+str) 
     
    7771        ModifyGraph width={Aspect,1} 
    7872        ModifyGraph lowTrip=0.001 
    79         Label bottom "q (\\S-1\\M)" 
    80         Label left "q (\\S-1\\M)" 
     73        Label bottom "qx (A\\S-1\\M)" 
     74        Label left "qy (A\\S-1\\M)" 
    8175        AutoPositionWindow/M=1/R=$(WinName(0,1)) $WinName(0,2) 
    8276         
     
    8680        // _mat is for display, _lin is the real calculation 
    8781 
     82        // not a function evaluation - this simply keeps the matrix for display in sync with the triplet calculation 
    8883        Variable/G gs_Cyl2Dmat=0 
    8984        gs_Cyl2Dmat := UpdateQxQy2Mat(xwave_Cyl2D,ywave_Cyl2D,zwave_Cyl2D,Cyl2D_lin,Cyl2D_mat) 
     
    121116#endif 
    122117 
    123 //      return stopMSTimer(-2)          // time when we finished 
    124118        return 0 
    125119End 
    126120 
    127 //function that is actually a wrapper to dispatch the calculation to N threads 
     121// 
     122//  Fit function that is actually a wrapper to dispatch the calculation to N threads 
     123// 
     124// nthreads is 1 or an even number, typically 2 
     125// it doesn't matter if npt is odd. In this case, fractional point numbers are passed 
     126// and the wave indexing works just fine - I tested this with test waves of 7 and 8 points 
     127// and the points "2.5" and "3.5" evaluate correctly as 2 and 3 
    128128// 
    129129Function Cylinder2D(cw,zw,xw,yw) : FitFunc 
     
    135135 
    136136        for(i=0;i<nthreads;i+=1) 
    137 //              Print (i*npt/nthreads),((i+1)*npt/nthreads-1) 
     137        //      Print (i*npt/nthreads),((i+1)*npt/nthreads-1) 
    138138                ThreadStart mt,i,Cylinder2D_T(cw,zw,xw,yw,(i*npt/nthreads),((i+1)*npt/nthreads-1)) 
    139139        endfor 
Note: See TracChangeset for help on using the changeset viewer.