Ignore:
Timestamp:
Nov 5, 2008 4:59:05 PM (16 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:
743d75c
Parents:
415bc97
Message:

working on sector averaging

File:
1 edited

Legend:

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

    rd7d143b0 r57668f8  
    11import os,os.path, re 
    22import sys, wx, logging 
    3 import string, numpy, pylab, math 
     3import string, numpy, math 
    44 
    55from copy import deepcopy  
    6 from danse.common.plottools.plottables import Data1D, Theory1D, Data2D 
     6from danse.common.plottools.plottables import Data1D, Theory1D,Data2D,Theory2D 
    77from danse.common.plottools.PlotPanel import PlotPanel 
    88from sans.guicomm.events import NewPlotEvent, StatusEvent   
     
    1414import fitpage1D,fitpage2D 
    1515import park 
    16 class Theory2D(Data2D): 
    17     def __init__(self,image=None,err_image=None,xmin=None, 
    18                  xmax=None,ymin=None,ymax=None,zmin=None,zmax=None): 
    19         Data2D.__init__(self,image,err_image,xmin, 
    20                         xmax,ymin,ymax,zmin,zmax) 
     16 
    2117class Plugin: 
    2218    """ 
     
    9692                return [["Select data  for Fitting",\ 
    9793                          "Dialog with fitting parameters ", self._onSelect]]  
     94            #elif item.__class__.__name__ is "Theory2D": 
     95            #     return [["Line Slicer [Q-view]","Sector Averaging as a function of Q", 
     96            #             self.onLineSlicer], 
     97            #             ["Annulus Slicer [Phi-view]","Sector Averaging as a function of Phi", 
     98            #             self.onLineSlicer]] 
    9899            else: 
    99100                if item.name==graph.selected_plottable and\ 
     
    528529                 
    529530            else: 
    530                 theory=Data2D(data.image, data.err_image) 
     531                theory=Theory2D(data.data, data.err_data) 
    531532                #theory=Theory2D(data.image, data.err_image) 
    532533                theory.x_bins= data.x_bins 
     
    542543                    ymax=data.ymax 
    543544                     
    544                 theory.image = numpy.zeros((len(data.y_bins),len(data.x_bins))) 
     545                theory.data = numpy.zeros((len(data.y_bins),len(data.x_bins))) 
    545546                for i in range(len(data.y_bins)): 
    546547                    if data.y_bins[i]>= ymin and data.y_bins[i]<= ymax: 
    547548                        for j in range(len(data.x_bins)): 
    548549                            if data.x_bins[i]>= qmin and data.x_bins[i]<= qmax: 
    549                                 theory.image[j][i]=model.runXY([data.x_bins[j],data.y_bins[i]]) 
     550                                theory.data[j][i]=model.runXY([data.x_bins[j],data.y_bins[i]]) 
    550551                
    551552                #print "fitting : plot_helper:", theory.image 
Note: See TracChangeset for help on using the changeset viewer.