diff --git a/pyVlsv/vlsvvtkinterface.py b/pyVlsv/vlsvvtkinterface.py index 548e952e..e8dd4269 100644 --- a/pyVlsv/vlsvvtkinterface.py +++ b/pyVlsv/vlsvvtkinterface.py @@ -838,8 +838,9 @@ def RequestUpdateExtent(self, request, inInfo, outInfo): '''This function adds one SpatialGrid variable from the reader object and maps that to the hypertreegrid object. Variable vector sizes of 1,2,3,4,9 supported. ''' - def addArrayFromVlsv(self, htg, varname): + def addArrayFromVlsv(self, varname): + htg = self.__htg # Do not re-add an already existing array if htg.GetCellData().HasArray(varname): print("skipped existing array") @@ -899,7 +900,7 @@ def RequestData(self, request, inInfo, outInfo): for name in self.__cellarrays: if self._arrayselection.ArrayIsEnabled(name): - success = self.addArrayFromVlsv(self.__htg, name) + success = self.addArrayFromVlsv(name) if not success: self._arrayselection.RemoveArrayByName(name)