Changeset 47f695c9 in sasview for guitools/plottables.py
- Timestamp:
- Apr 30, 2008 10:52:41 AM (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:
- eca05c8
- Parents:
- 6ed101a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guitools/plottables.py
r6ed101a r47f695c9 383 383 """ Reload view with new value to plot""" 384 384 self.view = self.View(self.x, self.y, self.dx, self.dy) 385 #save the initial value 386 self.view.Xreel = self.view.x 387 self.view.Yreel = self.view.y 388 self.view.DXreel = self.view.dx 389 self.view.DYreel = self.view.dy 390 391 385 392 386 def render(self,plot): 393 387 """The base class makes sure the correct units are being used for … … 438 432 self.dx = dx 439 433 self.dy = dy 440 #to change x range to the reel range 441 self.Xreel = self.x 442 self.Yreel = self.y 443 self.DXreel = self.dx 444 self.DYreel = self.dy 434 445 435 self.transx ="" 446 436 self.transy ="" … … 459 449 """ 460 450 461 462 451 # Sanity check 463 452 if (x!=None) and (y!=None): … … 474 463 self.dx = [] 475 464 self.dy = [] 476 tempx=[] 477 tempdx=[] 478 tempy=[] 479 tempdy=[] 465 480 466 if dx==None: 481 467 dx=numpy.zeros(len(x)) 482 468 if dy==None: 483 469 dy=numpy.zeros(len(y)) 484 470 485 471 for i in range(len(x)): 486 472 try: … … 495 481 self.dy.append(tempdy) 496 482 except: 497 498 print "View.transform_x: skipping point %g" % x[i] 499 print sys.exc_value 483 print "View.transform: skipping point x %g" % x[i] 484 print "View.transform: skipping point y %g" % y[i] 485 print "View.transform: skipping point dy %g" % dy[i] 486 print sys.exc_value 487 print len(self.x) 488 print len(self.dx) 489 print len(self.y) 490 print len(self.dy) 500 491 # Sanity check 501 492 if not (len(self.x)==len(self.dx))and(len(self.x)==len(self.dy))\ 502 493 and(len(self.x)==len(self.y))and(len(self.y)==len(self.dy)) : 503 494 raise ValueError, "Plottable.View: Given x,y,dy and dx are not of the same length" 504 495 self.check_data_logX() 496 self.check_data_logY() 497 print len(self.x) 498 print len(self.dx) 499 print len(self.y) 500 print len(self.dy) 505 501 def returntransformx(self,funcx,funcdx): 506 502 self.funcx= funcx … … 515 511 516 512 517 def reelXrange(self):518 self.x= self.Xreel519 self.y= self.Yreel520 self.dx= self.DXreel521 self.dy= self.DYreel522 523 513 def check_data_logX(self): 524 514 tempx=[] … … 540 530 tempdy.append(self.dy[i]) 541 531 except: 542 #print "View.transform_x: skipping point%g" %self.x[i]532 print "check_data_logX: skipping point x %g" %self.x[i] 543 533 print sys.exc_value 544 534 pass 545 535 546 self.x=[]547 self.dx=[]548 self.y=[]549 self.dy=[]550 self.x=tempx551 self.y=tempy552 self.dx=tempdx553 self.dy=tempdy536 self.x=[] 537 self.dx=[] 538 self.y=[] 539 self.dy=[] 540 self.x=tempx 541 self.y=tempy 542 self.dx=tempdx 543 self.dy=tempdy 554 544 555 545 def check_data_logY(self): … … 571 561 tempdy.append(self.dy[i]) 572 562 except: 573 #print "View.transform_x: skipping point %g" %self.x[i]563 print "check_data_logY: skipping point %g" %self.y[i] 574 564 print sys.exc_value 575 565 pass 576 566 577 self.x=[]578 self.dx=[]579 self.y=[]580 self.dy=[]581 self.x=tempx582 self.y=tempy583 self.dx=tempdx584 self.dy=tempdy567 self.x=[] 568 self.dx=[] 569 self.y=[] 570 self.dy=[] 571 self.x=tempx 572 self.y=tempy 573 self.dx=tempdx 574 self.dy=tempdy 585 575 586 576
Note: See TracChangeset
for help on using the changeset viewer.