Ignore:
Timestamp:
Jul 19, 2012 11:07:32 AM (12 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:
3df5ecf
Parents:
80ff71e
Message:

Invaraint freeze fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansinvariant/src/sans/invariant/invariant.py

    r3fc01c5 r07eb396  
    132132        """ 
    133133        self.scale = math.exp(constant) 
     134        if slope > 0: 
     135            slope = 0.0 
    134136        self.radius = math.sqrt(-3 * slope) 
    135          
    136137        # Errors 
    137138        self.dscale = math.exp(constant)*dconstant 
    138         self.dradius = -3.0/2.0/math.sqrt(-3 * slope)*dslope 
     139        if slope == 0.0: 
     140            n_zero = -1.0e-24 
     141            self.dradius = -3.0/2.0/math.sqrt(-3 * n_zero)*dslope 
     142        else: 
     143            self.dradius = -3.0/2.0/math.sqrt(-3 * slope)*dslope 
    139144         
    140145        return [self.radius, self.scale], [self.dradius, self.dscale] 
Note: See TracChangeset for help on using the changeset viewer.