Changeset 7b758fd in sasview


Ignore:
Timestamp:
Feb 15, 2009 1:13:35 PM (16 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:
d35420d
Parents:
6ac004c
Message:

fixed 2d fit cal. on 2d model data; ie. better detector fake data

File:
1 edited

Legend:

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

    ref8b580 r7b758fd  
    1919DEFAULT_QMIN = 0.0 
    2020DEFAULT_QMAX = 0.1 
    21 DEFAULT_NPTS = 40 
     21DEFAULT_NPTS = 50 
    2222import time 
    2323import thread 
     
    803803        detector = Detector() 
    804804        theory.detector=[] 
    805         theory.detector.append(detector) 
    806              
    807         theory.detector[0].pixel_size.x= qmax/(qstep/2-1)#5.0 
    808         theory.detector[0].pixel_size.y= qmax/(qstep/2-1)#5.0 
     805        theory.detector.append(detector)  
     806             
     807        theory.detector[0].pixel_size.x= qmax/(qstep/2+0.5)#5.0 
     808        theory.detector[0].pixel_size.y= qmax/(qstep/2+0.5)#5.0 
    809809        theory.detector[0].beam_center.x= qmax 
    810810        theory.detector[0].beam_center.y= qmax 
    811         theory.detector[0].distance= 1e+12#13705.0 
     811        theory.detector[0].distance=1e+56#13705.0 
    812812        theory.source= Source() 
    813         theory.source.wavelength= 2*math.pi/1e+12#8.4 
     813        theory.source.wavelength=2*math.pi/1e+56#8.4 
    814814        theory.x_bins =[] 
    815815        theory.y_bins =[] 
     
    819819        distance   = theory.detector[0].distance 
    820820        pixel      = qstep/2-1 
    821         theta      = pixel / distance / 100.0 
     821        theta      = pixel / distance / qstep#100.0 
    822822        wavelength = theory.source.wavelength 
    823823        pixel_width_x = theory.detector[0].pixel_size.x 
     
    828828         
    829829        size_x, size_y= numpy.shape(theory.data) 
    830         #print "size_x,size_y",size_x, size_y 
     830        print "size_x,size_y",size_x, size_y 
     831        #This case, q and x are equivalent to each other. 
    831832        for i_x in range(size_x): 
    832             theta = (i_x-center_x+1)*pixel_width_x / distance / size_x#100.0 
    833             qx = 4.0*math.pi/wavelength * math.sin(theta/2.0) 
     833            theta = (i_x-center_x+1)*pixel_width_x / distance #/ size_x#100.0 
     834            qx = distance*theta#4.0*math.pi/wavelength * math.sin(theta/2.0) 
    834835            theory.x_bins.append(qx)     
    835836        for i_y in range(size_y): 
    836             theta = (i_y-center_y+1)*pixel_width_y / distance / size_y#100.0 
    837             qy = 4.0*math.pi/wavelength * math.sin(theta/2.0) 
     837            theta = (i_y-center_y+1)*pixel_width_y / distance #/ size_y#100.0 
     838            qy =distance*theta#4.0*math.pi/wavelength * math.sin(theta/2.0) 
    838839            theory.y_bins.append(qy) 
    839840            
     
    845846        
    846847         
    847         theory.xmin= -qmax 
    848         theory.xmax= qmax 
    849         theory.ymin= -qmax 
    850         theory.ymax= qmax 
     848        theory.xmin= -qmax/math.sqrt(2) 
     849        theory.xmax= qmax/math.sqrt(2) 
     850        theory.ymin= -qmax/math.sqrt(2) 
     851        theory.ymax= qmax/math.sqrt(2) 
    851852         
    852853        print "model draw comptele xmax",theory.xmax,model.name 
Note: See TracChangeset for help on using the changeset viewer.