Changeset dfb58f8 in sasview for prview/perspectives/pr/pr.py


Ignore:
Timestamp:
May 23, 2008 10:56:21 AM (16 years ago)
Author:
Mathieu Doucet <doucetm@…>
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:
f24b8f4
Parents:
43c0a8e
Message:

Add a couple of figures of merit (GUI)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • prview/perspectives/pr/pr.py

    r119a11d rdfb58f8  
    218218 
    219219        sum = 0.0 
     220        cov2 = numpy.ascontiguousarray(cov) 
     221         
    220222        for i in range(len(x)): 
    221             if cov==None: 
     223            if cov2==None: 
    222224                value = pr.pr(out, x[i]) 
    223225            else: 
    224                 (value, dy[i]) = pr.pr_err(out, cov, x[i]) 
     226                (value, dy[i]) = pr.pr_err(out, cov2, x[i]) 
    225227            sum += value 
    226228            y[i] = value 
     
    229231        dy = dy/sum*pr.d_max/len(x) 
    230232         
    231         if cov==None: 
     233        if cov2==None: 
    232234            new_plot = Theory1D(x, y) 
    233235        else: 
     
    337339            @param elapsed: time spent computing 
    338340        """ 
     341        from copy import deepcopy 
    339342        # Save useful info 
    340343        self.elapsed = elapsed 
    341344        message = "Computation completed in %g seconds [chi2=%g]" % (elapsed, pr.chi2) 
    342345        wx.PostEvent(self.parent, StatusEvent(status=message)) 
     346 
     347        cov = numpy.ascontiguousarray(cov) 
    343348 
    344349        # Show result on control panel 
     
    347352        self.control_panel.oscillation = pr.oscillations(out) 
    348353        #print "OSCILL", pr.oscillations(out) 
    349         print "PEAKS:", pr.get_peaks(out) 
     354        print "PEAKS:", pr.get_peaks(out)  
     355        self.control_panel.positive = pr.get_positive(out) 
     356        self.control_panel.pos_err  = pr.get_pos_err(out, cov) 
    350357         
    351358        for i in range(len(out)): 
     
    367374         
    368375        # Show P(r) fit 
    369         x_values, x_range = self.show_pr(out, self.pr 
     376        x_values, x_range = self.show_pr(out, self.pr, cov 
    370377         
    371378        # Popup result panel 
Note: See TracChangeset for help on using the changeset viewer.