- Timestamp:
- Apr 2, 2008 3:10:25 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:
- 1d40f44
- Parents:
- 2da23bc
- Location:
- guitools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
guitools/PlotPanel.py
r2da23bc rb6b9d76 371 371 for item in list: 372 372 if ( self.xscales=="x" ): 373 if self.prevXtrans == "x^(2)":374 item.transform_x( self.fromX2, self.errFuncfromX2 )375 if self.prevXtrans == "Log(x)":376 item.transform_x( self.toX, self.errFuncfromLogXY )377 378 373 item.transform_x( self.toX, self.errFunctoX ) 379 374 self.set_xscale("linear") … … 381 376 382 377 if ( self.xscales=="x^(2)" ): 383 if self.prevXtrans != "x^(2)": 384 item.transform_x( self.toX2, self.errFuncToX2 ) 385 386 item.transform_x( self.toX, self.errFunctoX ) 378 item.transform_x( self.toX2, self.errFuncToX2 ) 387 379 self.set_xscale('linear') 388 380 self.graph.xaxis('\\rm{q^{2}} ', 'A^{-2}') 389 381 390 382 if (self.xscales=="Log(x)" ): 391 if self.prevXtrans == "x^(2)":392 item.transform_x( self.fromX2, self.errFuncfromX2 )393 394 383 item.transform_x( self.toX, self.errFuncToLogX ) 395 384 self.set_xscale("log") … … 397 386 398 387 if ( self.yscales=="y" ): 399 if self.prevYtrans == "y^(2)":400 item.transform_y( self.fromX2, self.errFuncfromX2 )401 if self.prevYtrans == "Log(y)":402 item.transform_y( self.toX, self.errFuncfromLogXY )403 404 388 item.transform_y( self.toX, self.errFunctoX ) 405 389 self.set_yscale("linear") 406 390 self.graph.yaxis("\\rm{Intensity} ","cm^{-1}") 407 391 408 if ( self.yscales=="Log(y)" ): 409 if self.prevYtrans == "y^(2)": 410 item.transform_y( self.fromX2, self.errFuncfromX2 ) 411 392 if ( self.yscales=="Log(y)" ): 412 393 item.transform_y( self.toX, self.errFuncToLogX) 413 394 self.set_yscale("log") … … 415 396 416 397 if ( self.yscales=="y^(2)" ): 417 if self.prevYtrans != "y^(2)": 418 item.transform_y( self.toX2, self.errFuncToX2 ) 419 item.transform_y( self.toX, self.errFunctoX ) 398 item.transform_y( self.toX2, self.errFuncToX2 ) 420 399 self.set_yscale("linear") 421 400 self.graph.yaxis("\\rm{Intensity^{2}} ","cm^{-2}") 422 item.set_View(item.x,item.y)423 401 402 item.reset_view() 424 403 self.prevXtrans = self.xscales 425 404 self.prevYtrans = self.yscales … … 435 414 if dx >=x: 436 415 return 0.9*x 416 if dx==None: 417 return 0 437 418 return dx 438 419 def errFuncToX2(self,x,dx=None): … … 472 453 @param dx: float value 473 454 """ 474 if (x != 0) and ( dx != None): 475 err= dx/x 455 #if (x != 0) and (dx != None): 456 # err= dx/x 457 #elif : 458 if x!=0: 459 if dx==None: 460 err = 1/x 461 else: 462 err = dx/x 476 463 if err >= x: 477 464 err = 0.9*x 478 return err 479 elif x==0: 465 else: 480 466 err = 0.9*x 481 return err 482 else: 483 return 0 467 468 return err 484 469 485 470 def errFuncfromLogXY(self,x,dx=None): -
guitools/plottables.py
r2da23bc rb6b9d76 412 412 for i in range(len(x)): 413 413 self.x[i] = func(x[i]) 414 if dx :414 if dx !=None: 415 415 self.dx[i] = errfunc(x[i], dx[i]) 416 416 else: … … 436 436 for i in range(len(y)): 437 437 self.y[i] = func(y[i]) 438 if dy :438 if dy !=None: 439 439 self.dy[i] = errfunc(y[i], dy[i]) 440 440 else:
Note: See TracChangeset
for help on using the changeset viewer.