Class SyncFile

  • All Implemented Interfaces:
    java.lang.Iterable<SyncLine>

    public class SyncFile
    extends java.lang.Object
    implements java.lang.Iterable<SyncLine>
    Represents an IRIS sync file. Documentation here: http://www.iris.edu/bud_stuff/goat/syncformat.html
    • Constructor Detail

      • SyncFile

        public SyncFile​(java.lang.String dccName)
      • SyncFile

        public SyncFile​(java.lang.String dccName,
                        java.lang.String dateModified)
      • SyncFile

        public SyncFile​(java.lang.String dccName,
                        java.lang.String dateModified,
                        java.lang.String[] extraHeaders)
      • SyncFile

        public SyncFile​(java.lang.String dccName,
                        java.lang.String dateModified,
                        java.lang.String[] extraHeaders,
                        java.util.List<SyncLine> lines)
    • Method Detail

      • splitByChannel

        public java.util.HashMap<java.lang.String,​SyncFile> splitByChannel()
      • consolidate

        public SyncFile consolidate()
      • cleanSmallSegments

        public SyncFile cleanSmallSegments​(float tolerence)
      • sort

        public void sort()
      • addLine

        public void addLine​(SyncLine line)
      • addLine

        public void addLine​(SyncLine line,
                            boolean consolidate)
      • saveToFile

        public void saveToFile​(java.lang.String filename)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • saveToFile

        public void saveToFile​(java.io.File f)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • appendToWriter

        public void appendToWriter​(java.io.PrintWriter writer,
                                   boolean writeHeader)
      • getHeaderLine

        public java.lang.String getHeaderLine()
      • getDccName

        public java.lang.String getDccName()
      • setDccName

        public void setDccName​(java.lang.String dccName)
      • getDateModified

        public java.lang.String getDateModified()
      • setDateModified

        public void setDateModified​(java.lang.String dateModified)
      • getExtraHeaders

        public java.lang.String[] getExtraHeaders()
      • setExtraHeaders

        public void setExtraHeaders​(java.lang.String[] extraHeaders)
      • getSyncLines

        public java.util.List<SyncLine> getSyncLines()
      • isEmpty

        public boolean isEmpty()
      • size

        public int size()
      • getEarliest

        public java.util.Date getEarliest()
        calculates the earliest time in the syncfile. This assuemes that the SyncFile has been sorted either before loading or via the sort() method.
        Returns:
        earliest time
        Throws:
        SeisFileRuntimeException - if empty
      • getLatest

        public java.util.Date getLatest()
        calculates the latest time in the syncfile. This assuemes that the SyncFile has been sorted either before loading or via the sort() method.
        Returns:
        latest time
        Throws:
        SeisFileRuntimeException - if empty
      • iterator

        public java.util.Iterator<SyncLine> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<SyncLine>