Changeset 1913820 in sasview


Ignore:
Timestamp:
Aug 19, 2011 11:54:53 AM (13 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
bc73c99f
Parents:
a948dbf
Message:

add function to check valid data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansguiframe/src/sans/guiframe/dataFitting.py

    rc642155 r1913820  
    259259        return result 
    260260         
     261def check_data_validity(data): 
     262      """ 
     263      Return True is data is valid enough to compute chisqr, else False 
     264      """ 
     265      flag = True 
     266      if data is not None: 
     267          if issubclass(data.__class__, Data2D): 
     268              if (data.data is None) or (len(data.data) == 0) \ 
     269               or (len(data.err_data) == 0): 
     270                  flag = False 
     271          else: 
     272              if (data.y is None) or (len(data.y) == 0):  
     273                  flag = False 
     274      else: 
     275          flag = False 
     276      return flag 
Note: See TracChangeset for help on using the changeset viewer.