Changeset 1d40f44 in sasview
- Timestamp:
- Apr 2, 2008 4:35:46 PM (17 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:
- 4965ea1
- Parents:
- b6b9d76
- Location:
- guitools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
guitools/PlotPanel.py
rb6b9d76 r1d40f44 113 113 @param x: float value 114 114 """ 115 return math.pow(x,2)115 return x*x 116 116 117 117 def fromX2(self,x): … … 399 399 self.set_yscale("linear") 400 400 self.graph.yaxis("\\rm{Intensity^{2}} ","cm^{-2}") 401 402 item.reset_view() 401 403 402 self.prevXtrans = self.xscales 404 403 self.prevYtrans = self.yscales 405 404 406 405 self.graph.render(self) 407 406 self.subplot.figure.canvas.draw_idle() … … 423 422 @param dx: float value 424 423 """ 425 if not dx == None:424 if dx != None: 426 425 err = 2*x*dx 427 426 if err >= x: … … 436 435 @param dx: float value 437 436 """ 438 if (x > 0) and (dx != None): 439 err = dx/(2*math.sqrt(x)) 437 if (x > 0): 438 if(dx != None): 439 err = dx/(2*math.sqrt(x)) 440 else: 441 err = 0 440 442 if err >= x: 441 err = 0.9*x 443 err = 0.9*x 444 else: 445 err = 0.9*x 446 442 447 return err 443 elif x==0.0:444 err = 0.9*x445 return err446 else:447 return 0.0448 448 449 449 def errFuncToLogX(self,x,dx=None): … … 453 453 @param dx: float value 454 454 """ 455 #if (x != 0) and (dx != None):456 # err= dx/x457 #elif :458 455 if x!=0: 459 456 if dx==None: 460 err = 1/x 457 #err = 1/x 458 err = 0 461 459 else: 462 460 err = dx/x … … 470 468 def errFuncfromLogXY(self,x,dx=None): 471 469 """ 472 calculate error of sqrt(x)470 calculate error of Log(xy) 473 471 @param x: float value 474 472 @param dx: float value 475 473 """ 476 if (x > 0) and (dx != None): 477 err= math.exp(x)*dx 478 if err >= x: 479 err = 0.9*x 480 return err 481 elif x == 0 : 482 err = 0.9*x 483 return err 484 elif dx == None: 485 return 0 486 else: 487 raise ValueError, "Can't calculate the error" 474 return 475 488 476 489 477 def onFitDisplay(self, plottable): -
guitools/plottables.py
rb6b9d76 r1d40f44 345 345 """ Reload view with new value to plot""" 346 346 self.view = self.View(self.x, self.y, self.dx, self.dy) 347 print "the value of view x",self.view.x 348 print "the value of view y",self.view.y 349 347 350 348 351 def render(self,plot):
Note: See TracChangeset
for help on using the changeset viewer.