Ignore:
Timestamp:
Feb 17, 2009 10:41:53 AM (15 years ago)
Author:
Jae Cho <jhjcho@…>
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:
3c37ba2
Parents:
dd66fbd
Message:

fixed bug in model 2d plot

File:
1 edited

Legend:

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

    r14c707f rf69bc394  
    636636                for i in range(len(data.x)): 
    637637                    try: 
    638                         if data.x[i]> qmin and data.x[i]< qmax: # 1d fit range 
     638                        if data.x[i]> qmin and data.x[i]< qmax:  
    639639                            tempx = data.x[i] 
    640640                            tempy = model.run(tempx) 
     
    669669                theory.x_bins= data.x_bins 
    670670                theory.y_bins= data.y_bins 
     671                     
    671672                tempy=[] 
    672673                #print "max x,y",max(data.xmax,data.xmin),max(data.ymax,data.ymin) 
     
    683684                    xmin=data.xmin 
    684685                if xmax==None: 
    685                     xmax=data.xmax                     
    686                 #print " q range =",     
     686                    xmax=data.xmax       
     687                                   
    687688                theory.data = numpy.zeros((len(data.y_bins),len(data.x_bins))) 
    688689                for j in range(len(data.y_bins)): 
     
    693694                        else: 
    694695                            theory.data[j][i]=0 #None # Later, We need to decide which of  0 and None is better. 
    695                 #print "len(data.x_bins),len(data.y_bins);",len(data.x_bins),len(data.y_bins),i,j 
     696                #print "len(data.x_bins),len(data.y_bins);",len(data.x_bins),len(data.y_bins),qmax 
    696697                #print "fitting : plot_helper:", theory.image 
    697698                #print "fitting : plot_helper:",theory.image 
     
    853854        
    854855         
    855         theory.xmin= -qmax/math.sqrt(2) 
    856         theory.xmax= qmax/math.sqrt(2) 
    857         theory.ymin= -qmax/math.sqrt(2) 
    858         theory.ymax= qmax/math.sqrt(2) 
     856        theory.xmin= -qmax#/math.sqrt(2)#You can not do sqrt(2), that changes axis scale not data itself 
     857        theory.xmax= qmax#/math.sqrt(2) 
     858        theory.ymin= -qmax#/math.sqrt(2) 
     859        theory.ymax= qmax#/math.sqrt(2) 
    859860         
    860861        print "model draw comptele xmax",theory.xmax,model.name 
Note: See TracChangeset for help on using the changeset viewer.