diff --git a/nexus/nexus.py b/nexus/nexus.py index cf4a4ae261cda486e3b4f37784a4d0de5645d281..5447962d472a7b5c5d391d77a2a54029a27448ec 100755 --- a/nexus/nexus.py +++ b/nexus/nexus.py @@ -16,6 +16,7 @@ from PySide6.QtCore import Qt from obspy import read_inventory from obspy.core.inventory import Network, Station, Equipment +from obspy.core.inventory.util import Comment from .NRLWizard import NRLWizard, DATALOGGER, SENSOR from . import obspyImproved @@ -525,8 +526,7 @@ class ChannelNode(InventoryNode): try: self._inv_obj.comments[0].value = value except: - self._inv_obj.comments = [obspyImproved.Comment( - value=value)] + self._inv_obj.comments.append(Comment(value)) return True channel_comment = property(get_comment, set_comment) FM.append(channel_comment) diff --git a/nexus/obspyImproved.py b/nexus/obspyImproved.py index 5336c0755942ebb1ec6c7a5d3b1799e95b0db751..f1c6bd62caec3b63fb91fa94d65bad13d17582b7 100644 --- a/nexus/obspyImproved.py +++ b/nexus/obspyImproved.py @@ -12,6 +12,7 @@ from obspy import Inventory from obspy import UTCDateTime from obspy.core.inventory import (Network, Station, Channel, Site, Equipment) +from obspy.core.inventory.util import Comment from obspy.io.mseed.core import _is_mseed from obspy.io.mseed import util @@ -228,6 +229,10 @@ class InventoryIm(Inventory): if self.extend_epoch(inv_cha, start, end): inv_cha._new = new + # add Comment object to Channel + comment = Comment('') + inv_cha.comments.append(comment) + def extend_epoch(self, inv, start, end): ret = False if inv.start_date > start: