Changeset bcfc969 in sasview for sanscalculator/src/sans


Ignore:
Timestamp:
Aug 11, 2011 9:04:56 AM (13 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:
c0a30a24
Parents:
0f282a5
Message:

more accurate way to cal averaging sigmas

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sanscalculator/src/sans/calculator/resolution_calculator.py

    red91a0e rbcfc969  
    166166            #    continue 
    167167            image = out 
    168             # set sigmas 
    169             sigma_1 += sig1_list[ind] * self.intensity 
    170             sigma_r += sigr_list[ind] * self.intensity 
    171             sigma_2 += sig2_list[ind] * self.intensity 
    172             sigma1d += sigma1d_list[ind] * self.intensity 
     168            # set variance as sigmas 
     169            sigma_1 += sig1_list[ind] *  sig1_list[ind] * self.intensity 
     170            sigma_r += sigr_list[ind] * sigr_list[ind] * self.intensity 
     171            sigma_2 += sig2_list[ind] * sig2_list[ind] * self.intensity 
     172            sigma1d += sigma1d_list[ind] * sigma1d_list[ind] * self.intensity 
    173173            total_intensity += self.intensity 
     174         
    174175        if total_intensity != 0: 
     176            # average variance 
    175177            image_out = image / total_intensity 
    176178            sigma_1 = sigma_1 / total_intensity 
     
    179181            sigma1d = sigma1d / total_intensity 
    180182            # set sigmas 
    181             self.sigma_1 = sigma_1 
    182             self.sigma_lamd = sigma_r 
    183             self.sigma_2 = sigma_2 
    184             self.sigma_1d = sigma1d 
     183            self.sigma_1 = sqrt(sigma_1) 
     184            self.sigma_lamd = sqrt(sigma_r) 
     185            self.sigma_2 = sqrt(sigma_2) 
     186            self.sigma_1d = sqrt(sigma1d) 
    185187            # rescale  
    186188            max_im_val = 1 #image_out.max() 
Note: See TracChangeset for help on using the changeset viewer.