Ignore:
Timestamp:
Jan 13, 2009 5:52:02 PM (15 years ago)
Author:
Gervaise Alina <gervyh@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
e8d1066
Parents:
e4032d64
Message:

model page change on interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansview/perspectives/fitting/fitting.py

    rdb709e4 rd15c0202  
    611611                qmax= 1.0 
    612612            if qstep ==None: 
    613                 qstep =0.001 
     613                qstep =100 
    614614            
    615615            #print "x in data1D",qmin,qmax 
    616             x = numpy.arange(qmin, qmax, qstep)         
     616            #x = numpy.arange(qmin, qmax, qstep)   
     617            x=  numpy.linspace(start= qmin, 
     618                               stop= qmax, 
     619                               num= qstep, 
     620                               endpoint=True 
     621                               )       
    617622            xlen= len(x) 
    618623            y = numpy.zeros(xlen) 
     
    620625                for i in range(xlen): 
    621626                    y[i] = model.run(x[i]) 
    622          
     627                 
    623628                try: 
    624629                    new_plot = Theory1D(x, y) 
     
    635640                for i in range(xlen): 
    636641                    y[i] = model.run(x[i]) 
    637                      
     642                #print x, y    
    638643                try: 
    639644                    new_plot = Theory1D(x, y) 
     
    655660        wx.PostEvent(self.parent, StatusEvent(status="Calc \ 
    656661        complete in %g sec" % elapsed)) 
    657                             
    658         print "complete",output, model,qmin, qmax 
     662        #print "complete",output, model,qmin, qmax 
    659663        data = output 
    660664        theory= Data2D(data) 
     665        #print data.detector 
     666        #theory.detector= data.detector 
     667        from DataLoader.data_info import Detector, Source 
     668         
     669        detector = Detector() 
     670        theory.detector=[] 
     671        theory.detector.append(detector) 
     672             
     673        theory.detector[0].pixel_size.x= 5.0 
     674        theory.detector[0].pixel_size.y= 5.0 
     675        theory.source= Source() 
     676        theory.source.wavelength= 8.4 
     677        theory.detector[0].beam_center.x= 0 
     678        theory.detector[0].beam_center.y= 0 
     679        theory.detector[0].distance= 13705.0 
     680         
    661681        theory.name= model.name 
    662682        theory.group_id ="Model" 
    663683        theory.id ="Model" 
    664         theory.xmin= qmin 
     684        theory.xmin= -qmax 
    665685        theory.xmax= qmax 
    666         theory.ymin= qmin 
     686        theory.ymin= -qmax 
    667687        theory.ymax= qmax 
     688        print "model draw comptele xmax",theory.xmax 
    668689        wx.PostEvent(self.parent, NewPlotEvent(plot=theory, 
    669690                         title="Analytical model 2D %s" %str(model.name))) 
     
    673694    def _draw_model2D(self,model,description=None, enable2D=False,qmin=None,qmax=None, qstep=None): 
    674695        if qmin==None: 
    675             qmin= -0.05 
     696            qmin= 0.0 
    676697        if qmax==None: 
    677698            qmax= 0.05 
    678699        if qstep ==None: 
    679             qstep =0.001 
    680         x = numpy.arange(qmin,qmax, qstep) 
    681         y = numpy.arange(qmin,qmax,qstep) 
     700            qstep =100 
     701        
     702        x=  numpy.linspace(start= -1*qmax, 
     703                               stop= qmax, 
     704                               num= qstep, 
     705                               endpoint=True )   
     706        y = numpy.linspace(start= -1*qmax, 
     707                               stop= qmax, 
     708                               num= qstep, 
     709                               endpoint=True ) 
     710        
    682711        lx = len(x) 
    683712        #print x 
     
    686715        if enable2D: 
    687716            from model_thread import Calc2D 
    688             self.calc_thread = Calc2D(parent =self.parent,x=x, y=y,model= self.model, qmin=qmin,qmax=qmax, 
     717            self.calc_thread = Calc2D(parent =self.parent,x=x, 
     718                                       y=y,model= self.model,  
     719                                       qmin=qmin, 
     720                                       qmax=qmax, 
    689721                            completefn=self.complete, 
    690722                            updatefn=self.update) 
Note: See TracChangeset for help on using the changeset viewer.