diff --git a/src/icartt/dataset.py b/src/icartt/dataset.py index 81e5a8cbdedfa2dafcc26e03f98360479c8674e0..6d3c7cedeed91b48e679f285a5218d3e35387e96 100644 --- a/src/icartt/dataset.py +++ b/src/icartt/dataset.py @@ -87,18 +87,20 @@ class DataStore1001: """ if not isinstance(newData, np.ndarray): raise TypeError("Input data needs to be numpy ndarray.") - if newData.dtype.names is None: + + workData = newData.copy() + if workData.dtype.names is None: try: - newData.dtype = [(name, newData.dtype) for name in self.varnames] + workData.dtype = [(name, workData.dtype) for name in self.varnames] except: ValueError( "Could not assign names to data structure, are you providing an array containing all variables?" ) if self.data is None: - self.data = newData + self.data = workData else: - self.data = np.append(self.data, newData) + self.data = np.append(self.data, workData) def denanify(self, d): dd = d.copy()