- Timestamp:
- Apr 2, 2008 12:39:24 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:
- b6b9d76
- Parents:
- 8cebf9b
- Location:
- guitools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
guitools/PlotPanel.py
r8cebf9b r2da23bc 373 373 if self.prevXtrans == "x^(2)": 374 374 item.transform_x( self.fromX2, self.errFuncfromX2 ) 375 375 if self.prevXtrans == "Log(x)": 376 item.transform_x( self.toX, self.errFuncfromLogXY ) 377 376 378 item.transform_x( self.toX, self.errFunctoX ) 377 379 self.set_xscale("linear") … … 381 383 if self.prevXtrans != "x^(2)": 382 384 item.transform_x( self.toX2, self.errFuncToX2 ) 385 383 386 item.transform_x( self.toX, self.errFunctoX ) 384 387 self.set_xscale('linear') … … 386 389 387 390 if (self.xscales=="Log(x)" ): 388 #if self.prevXtrans == "x^(2)":389 #item.transform_x( self.fromX2, self.errFuncfromX2 )390 391 #item.transform_x( self.toX, self.errFuncToLogX )391 if self.prevXtrans == "x^(2)": 392 item.transform_x( self.fromX2, self.errFuncfromX2 ) 393 394 item.transform_x( self.toX, self.errFuncToLogX ) 392 395 self.set_xscale("log") 393 396 self.graph.xaxis('\\rm{q} ', 'A^{-1}') … … 395 398 if ( self.yscales=="y" ): 396 399 if self.prevYtrans == "y^(2)": 397 item.transform_y( self.toX2, self.errFuncToX2 ) 398 item.transform_x( self.toX, self.errFunctoX ) 400 item.transform_y( self.fromX2, self.errFuncfromX2 ) 401 if self.prevYtrans == "Log(y)": 402 item.transform_y( self.toX, self.errFuncfromLogXY ) 403 404 item.transform_y( self.toX, self.errFunctoX ) 399 405 self.set_yscale("linear") 400 406 self.graph.yaxis("\\rm{Intensity} ","cm^{-1}") … … 403 409 if self.prevYtrans == "y^(2)": 404 410 item.transform_y( self.fromX2, self.errFuncfromX2 ) 405 item.transform_x( self.toX, self.errFuncToLogX) 411 412 item.transform_y( self.toX, self.errFuncToLogX) 406 413 self.set_yscale("log") 407 414 self.graph.yaxis("\\rm{Intensity} ","cm^{-1}") … … 410 417 if self.prevYtrans != "y^(2)": 411 418 item.transform_y( self.toX2, self.errFuncToX2 ) 412 item.transform_ x( self.toX, self.errFunctoX )419 item.transform_y( self.toX, self.errFunctoX ) 413 420 self.set_yscale("linear") 414 421 self.graph.yaxis("\\rm{Intensity^{2}} ","cm^{-2}") … … 483 490 """ 484 491 if (x > 0) and (dx != None): 485 err= dx/2*math.sqrt(x)492 err= math.exp(x)*dx 486 493 if err >= x: 487 494 err = 0.9*x -
guitools/plottables.py
r8cebf9b r2da23bc 411 411 412 412 for i in range(len(x)): 413 self.x[i] = func(x[i]) 414 self.dx[i] = errfunc(x[i], dx[i]) 415 413 self.x[i] = func(x[i]) 414 if dx: 415 self.dx[i] = errfunc(x[i], dx[i]) 416 else: 417 self.dx[i] = errfunc(x[i]) 416 418 def transform_y(self, func, errfunc, y, dy): 417 419 """ … … 424 426 """ 425 427 import copy 428 import numpy 426 429 # Sanity check 427 430 if dy and not len(y)==len(dy): … … 433 436 for i in range(len(y)): 434 437 self.y[i] = func(y[i]) 435 self.dy[i] = errfunc(y[i], dy[i]) 438 if dy: 439 self.dy[i] = errfunc(y[i], dy[i]) 440 else: 441 self.dy[i] = errfunc(y[i]) 436 442 437 443 class Data1D(Plottable):
Note: See TracChangeset
for help on using the changeset viewer.