Changeset d15c0202 in sasview for sansview/perspectives/fitting/fitting.py
- Timestamp:
- Jan 13, 2009 5:52:02 PM (15 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitting.py
rdb709e4 rd15c0202 611 611 qmax= 1.0 612 612 if qstep ==None: 613 qstep = 0.001613 qstep =100 614 614 615 615 #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 ) 617 622 xlen= len(x) 618 623 y = numpy.zeros(xlen) … … 620 625 for i in range(xlen): 621 626 y[i] = model.run(x[i]) 622 627 623 628 try: 624 629 new_plot = Theory1D(x, y) … … 635 640 for i in range(xlen): 636 641 y[i] = model.run(x[i]) 637 642 #print x, y 638 643 try: 639 644 new_plot = Theory1D(x, y) … … 655 660 wx.PostEvent(self.parent, StatusEvent(status="Calc \ 656 661 complete in %g sec" % elapsed)) 657 658 print "complete",output, model,qmin, qmax 662 #print "complete",output, model,qmin, qmax 659 663 data = output 660 664 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 661 681 theory.name= model.name 662 682 theory.group_id ="Model" 663 683 theory.id ="Model" 664 theory.xmin= qmin684 theory.xmin= -qmax 665 685 theory.xmax= qmax 666 theory.ymin= qmin686 theory.ymin= -qmax 667 687 theory.ymax= qmax 688 print "model draw comptele xmax",theory.xmax 668 689 wx.PostEvent(self.parent, NewPlotEvent(plot=theory, 669 690 title="Analytical model 2D %s" %str(model.name))) … … 673 694 def _draw_model2D(self,model,description=None, enable2D=False,qmin=None,qmax=None, qstep=None): 674 695 if qmin==None: 675 qmin= -0.05696 qmin= 0.0 676 697 if qmax==None: 677 698 qmax= 0.05 678 699 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 682 711 lx = len(x) 683 712 #print x … … 686 715 if enable2D: 687 716 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, 689 721 completefn=self.complete, 690 722 updatefn=self.update)
Note: See TracChangeset
for help on using the changeset viewer.