##// END OF EJS Templates
Bug fixed in Reshaper: factor variable should be a real value
Miguel Valdez -
r522:b46cf7c20599
parent child
Show More
@@ -740,19 +740,23 class ProfileSelector(Operation):
740
740
741
741
742 class Reshaper(Operation):
742 class Reshaper(Operation):
743
743 def __init__(self):
744 def __init__(self):
745
744 Operation.__init__(self)
746 Operation.__init__(self)
745 self.updateNewHeights = False
747 self.updateNewHeights = True
746
748
747 def run(self, dataOut, shape):
749 def run(self, dataOut, shape):
750
748 shape_tuple = tuple(shape)
751 shape_tuple = tuple(shape)
749 dataOut.data = numpy.reshape(dataOut.data, shape_tuple)
752 dataOut.data = numpy.reshape(dataOut.data, shape_tuple)
750 dataOut.flagNoData = False
753 dataOut.flagNoData = False
751
754
752 if not(self.updateNewHeights):
755 if self.updateNewHeights:
756
753 old_nheights = dataOut.nHeights
757 old_nheights = dataOut.nHeights
754 new_nheights = dataOut.data.shape[2]
758 new_nheights = dataOut.data.shape[2]
755 factor = new_nheights / old_nheights
759 factor = 1.0*new_nheights / old_nheights
756 deltaHeight = dataOut.heightList[1] - dataOut.heightList[0]
760 deltaHeight = dataOut.heightList[1] - dataOut.heightList[0]
757 xf = dataOut.heightList[0] + dataOut.nHeights * deltaHeight * factor
761 xf = dataOut.heightList[0] + dataOut.nHeights * deltaHeight * factor
758 dataOut.heightList = numpy.arange(dataOut.heightList[0], xf, deltaHeight) No newline at end of file
762 dataOut.heightList = numpy.arange(dataOut.heightList[0], xf, deltaHeight)
General Comments 0
You need to be logged in to leave comments. Login now