Changeset 69bee6d in sasview
- Timestamp:
- Apr 14, 2009 7:57:49 PM (16 years ago)
- 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:
- 74ad4b1
- Parents:
- 7b35808
- Location:
- sansview/perspectives/fitting
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/basepage.py
r780d095 r69bee6d 5 5 import time 6 6 7 from sans.guiframe.utils import format_number 7 from sans.guiframe.utils import format_number,check_float 8 8 from sans.guicomm.events import StatusEvent 9 9 import pagestate … … 565 565 # If qmin and qmax have been modified, update qmin and qmax and 566 566 # set the is_modified flag to True 567 from sans.guiframe.utils import check_value 567 from sans.guiframe.utils import check_value 568 568 if check_value( self.qmin, self.qmax): 569 569 if float(self.qmin.GetValue()) != self.qmin_x: … … 577 577 self.fitrange = False 578 578 if self.npts != None: 579 if float(self.npts.GetValue()) != self.num_points: 580 self.num_points = float(self.npts.GetValue()) 581 is_modified = True 582 579 if check_float(self.npts): 580 if float(self.npts.GetValue()) != self.num_points: 581 self.num_points = float(self.npts.GetValue()) 582 is_modified = True 583 else: 584 msg= "Cannot Plot :Must enter a number!!! " 585 wx.PostEvent(self.parent.parent, StatusEvent(status = msg )) 586 583 587 584 588 ## if any value is modify draw model with new value … … 988 992 when enter value on panel redraw model according to changed 989 993 """ 990 self._onparamEnter_helper() 994 tcrtl= event.GetEventObject() 995 if check_float(tcrtl): 996 self._onparamEnter_helper() 997 else: 998 msg= "Cannot Plot :Must enter a number!!! " 999 wx.PostEvent(self.parent.parent, StatusEvent(status = msg )) 1000 return 991 1001 992 1002 … … 1034 1044 item[4].Clear() 1035 1045 item[4].Hide() 1046 1047 1048 value= float(item[2].GetValue()) 1036 1049 1037 value= float(item[2].GetValue())1038 1050 # If the value of the parameter has changed, 1039 1051 # +update the model and set the is_modified flag 1040 1052 if value != self.model.getParam(name): 1041 1053 self.model.setParam(name,value) 1042 is_modified = True 1054 is_modified = True 1055 1043 1056 except: 1044 1057 msg= "Model Drawing Error:wrong value entered : %s"% sys.exc_value -
sansview/perspectives/fitting/fitpage.py
r780d095 r69bee6d 8 8 9 9 from sans.guicomm.events import StatusEvent 10 from sans.guiframe.utils import format_number 10 from sans.guiframe.utils import format_number,check_float 11 11 12 12 ## event to post model to fit to fitting plugins … … 459 459 when enter value on panel redraw model according to changed 460 460 """ 461 self._onparamEnter_helper() 462 self.compute_chisqr() 463 461 tcrtl= event.GetEventObject() 462 if check_float(tcrtl): 463 self._onparamEnter_helper() 464 self.compute_chisqr() 465 else: 466 msg= "Cannot Plot :Must enter a number!!! " 467 wx.PostEvent(self.parent.parent, StatusEvent(status = msg )) 468 return 464 469 465 470 def reset_page(self, state): … … 516 521 if self.text_disp_1 !=None: 517 522 self.text_disp_1.Show(True) 518 519 self.param_toFit[0][3].Show(True) 520 self.param_toFit[0][4].Clear() 521 self.param_toFit[0][4].SetValue(format_number(cov[0])) 522 self.param_toFit[0][4].Show(True) 523 if cov[0]==None: 524 self.param_toFit[0][3].Hide() 525 self.param_toFit[0][4].Clear() 526 self.param_toFit[0][4].Hide() 527 self.param_toFit[0][4].Refresh() 528 else: 529 self.param_toFit[0][3].Show(True) 530 self.param_toFit[0][4].Clear() 531 self.param_toFit[0][4].SetValue(format_number(cov[0])) 532 self.param_toFit[0][4].Show(True) 533 self.param_toFit[0][4].Refresh() 523 534 else: 524 535 i=0 … … 542 553 if out[j]==self.model.getParam(item[1]): 543 554 break 544 item[4].SetValue(format_number(cov[j])) 545 item[4].Refresh() 546 item[4].Show(True) 555 ## unable to compare cov[j]==numpy.nan so switch to None 556 if cov[j]==None: 557 item[3].Hide() 558 item[4].Refresh() 559 item[4].Clear() 560 item[4].Hide() 561 else: 562 item[4].SetValue(format_number(cov[j])) 563 item[4].Refresh() 564 item[4].Show(True) 547 565 i+=1 548 566 -
sansview/perspectives/fitting/fitting.py
ra81e613 r69bee6d 670 670 small_out.append(p.value ) 671 671 model.setParam(param_name,p.value) 672 """ 672 673 if p.stderr==None: 673 674 p.stderr=numpy.nan 674 675 small_cov.append(p.stderr) 675 676 676 else: 677 677 small_cov.append(p.stderr) 678 """ 679 small_cov.append(p.stderr) 678 680 else: 679 681 value= model.getParam(param_name) 680 682 small_out.append(value ) 681 small_cov.append(numpy.nan) 683 #small_cov.append(numpy.nan) 684 small_cov.append(None) 682 685 # Display result on each page 683 686 page.onsetValues(result.fitness, small_out,small_cov) -
sansview/perspectives/fitting/simfitpage.py
r77e23a2 r69bee6d 362 362 self.nb_constraint =0 363 363 self.constraint_dict={} 364 if hasattr(self,"btAdd"): 365 self.btAdd.Hide() 364 366 self._store_model() 365 367
Note: See TracChangeset
for help on using the changeset viewer.