Changeset 2408


Ignore:
Timestamp:
02/16/12 16:41:32 (13 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS3606

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: sdfit unit test

Put in Release Notes: Yes/No

Module(s): Module Names change impacts.

Description: Describe your changes here...

In asapfitter.(auto_)fit, preset mask is ignored if length of mask is
not the same as that of number of spectral channel.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapfitter.py

    r2153 r2408  
    151151                self.x = self.data._getabcissa(row)
    152152                self.y = self.data._getspectrum(row)
    153                 self.mask = mask_and(self.mask, self.data._getmask(row))
     153                #self.mask = mask_and(self.mask, self.data._getmask(row))
     154                if len(self.x) == len(self.mask):
     155                    self.mask = mask_and(self.mask, self.data._getmask(row))
     156                else:
     157                    asaplog.push('lengths of data and mask are not the same. preset mask will be ignored')
     158                    asaplog.post('WARN','asapfit.fit')
     159                    self.mask=_n_bools(len(self.x), True)
    154160                asaplog.push("Fitting:")
    155161                i = row
     
    659665            self.x = scan._getabcissa(r)
    660666            self.y = scan._getspectrum(r)
    661             self.mask = mask_and(self.mask, scan._getmask(r))
     667            if len(self.x) == len(self.mask):
     668                self.mask = mask_and(self.mask, self.data._getmask(row))
     669            else:
     670                asaplog.push('lengths of data and mask are not the same. preset mask will be ignored')
     671                asaplog.post('WARN','asapfit.fit')
     672                self.mask=_n_bools(len(self.x), True)
     673            #self.mask = mask_and(self.mask, scan._getmask(r))
    662674            self.data = None
    663675            self.fit()
Note: See TracChangeset for help on using the changeset viewer.