Changeset 45ffa5e in sasview


Ignore:
Timestamp:
Feb 3, 2011 2:56:24 PM (14 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:
eb8474f
Parents:
13913ec
Message:

bug fixes: q_smear bug w/ finite q_range

Location:
DataLoader
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • DataLoader/extensions/smearer.cpp

    rcd2ced80 r45ffa5e  
    167167                double q, q_min, q_max, q_0; 
    168168                get_bin_range(i, &q, &q_min, &q_max); 
     169 
    169170                bool last_qpoint = true; 
    170171                // Find q[0] value to normalize the weight later, 
     
    179180                        // Calculate bin size of q_j 
    180181                        get_bin_range(j, &q_j, &q_low, &q_high); 
     182 
    181183                        // Check q_low that can not be negative. 
    182184                        if (q_low < 0.0){ 
     
    185187                        // default parameter values 
    186188                        (*weights)[i*nbins+j] = 0.0; 
     189                        // protect for negative q 
     190                        if (q <= 0.0 || q_j <= 0.0){ 
     191                                        continue; 
     192                        } 
    187193                        double shift_w = 0.0; 
    188194                        // Condition: zero slit smear. 
  • DataLoader/qsmearing.py

    rd5751ac r45ffa5e  
    192192            temp_last = last_bin 
    193193            #iq_in_temp = iq_in 
    194          
     194 
    195195        # Sanity check 
    196196        if len(iq_in_temp) != self.nbins: 
     
    437437        try: 
    438438            offset = 3.0 * max(self.width) 
    439             _qmin_unsmeared = max([self.min, q_min - offset]) 
    440             _qmax_unsmeared = min([self.max, q_max + offset]) 
     439            _qmin_unsmeared = self.min 
     440            _qmax_unsmeared = self.max 
    441441        except: 
    442442            logging.error("_QSmearer.get_bin_range: %s" % sys.exc_value) 
     
    564564     
    565565    # nbins corrections due to the negative q value 
    566     nbins_low = nbins_low - len(data_x_ext[data_x_ext<0]) 
     566    nbins_low = nbins_low - len(data_x_ext[data_x_ext<=0]) 
    567567    return  nbins_low, nbins_high, \ 
    568568             new_width[data_x_ext>0], data_x_ext[data_x_ext>0] 
Note: See TracChangeset for help on using the changeset viewer.