Changeset 93b145a in sasview


Ignore:
Timestamp:
Aug 22, 2016 5:54:51 AM (8 years ago)
Author:
lewis
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, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
ff11b21
Parents:
c97d76a
Message:

Show warning when bg is negative and/or results in negative I values

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/corfunc/corfunc_panel.py

    re8418bb r93b145a  
    187187            wx.PostEvent(self.parent.parent, StatusEvent(status=msg)) 
    188188            return 
     189 
     190        warning_msg = "" 
     191        if self.background < 0: 
     192            warning_msg += "Negative background value entered." 
     193        if any((self._data.y - self.background) < 0): 
     194            if warning_msg != "": 
     195                warning_msg += "\n" 
     196            warning_msg += "Background value entered results in negative Intensity values." 
     197        if warning_msg != "": 
     198            dlg = wx.MessageDialog(self.parent.parent, warning_msg, caption="Warning", style=wx.ICON_EXCLAMATION) 
     199            dlg.ShowModal() 
     200            dlg.Destroy() 
     201 
    189202        self._calculator.set_data(self._data) 
    190203        self._calculator.lowerq = self.qmin 
    191204        self._calculator.upperq = self.qmax 
    192205        self._calculator.background = self.background 
     206 
    193207        try: 
    194208            self._extrapolated_data = self._calculator.compute_extrapolation() 
Note: See TracChangeset for help on using the changeset viewer.