From 42df156cfce57bc12b72cc773cf6c566cf0ecec0 2023-10-19 13:20:14 From: Roberto Flores Date: 2023-10-19 13:20:14 Subject: [PATCH] HDFWriter Fix for correct writing after the first block --- diff --git a/schainpy/model/io/jroIO_param.py b/schainpy/model/io/jroIO_param.py index 443f45b..8a8b08c 100644 --- a/schainpy/model/io/jroIO_param.py +++ b/schainpy/model/io/jroIO_param.py @@ -611,6 +611,8 @@ class HDFWriter(Operation): if ch == -1: ds[self.blockIndex] = getattr(self.dataOut, attr) else: + if self.uniqueChannel and self.blockIndex != 0: #Creates extra dimension to avoid the creation of multiple channels + setattr(self.dataOut, attr, numpy.expand_dims(getattr(self.dataOut, attr), axis=0)) ds[self.blockIndex] = getattr(self.dataOut, attr)[ch] if self.uniqueChannel: #Deletes extra dimension created to avoid the creation of multiple channels setattr(self.dataOut, attr, getattr(self.dataOut, attr)[0])