diff --git a/geomagio/iaga2002/IAGA2002Writer.py b/geomagio/iaga2002/IAGA2002Writer.py index 10cec07de7005b003065ed5a4301bc5c350a0619..b74bcc2be109e199a57a99194639ccacc7ec3c8a 100644 --- a/geomagio/iaga2002/IAGA2002Writer.py +++ b/geomagio/iaga2002/IAGA2002Writer.py @@ -37,7 +37,7 @@ class IAGA2002Writer(object): (channel, str(TimeseriesUtility.get_channels(timeseries)))) stats = timeseries[0].stats if len(channels) != 4: - self._pad_to_four_channels(timeseries, channels) + channels = self._pad_to_four_channels(timeseries, channels) out.write(self._format_headers(stats, channels)) out.write(self._format_comments(stats)) out.write(self._format_channels(channels, stats.station)) @@ -247,10 +247,12 @@ class IAGA2002Writer(object): for val in values]) def _pad_to_four_channels(self, timeseries, channels): + padded = channels[:] for x in range(len(channels), 4): channel = self.empty_channel - channels.append(channel) + padded.append(channel) timeseries += create_empty_trace(timeseries[0], channel) + return padded @classmethod def format(self, timeseries, channels):