edu.sc.seis.sod.process.waveform

## Class PhaseSignalToNoise

- java.lang.Object
- - edu.sc.seis.sod.process.waveform.PhaseSignalToNoise

- All Implemented Interfaces:
    WaveformProcess, SodElement, Subsetter, Threadable
  Direct Known Subclasses:
    CompoundPhaseSignalToNoise

      public class PhaseSignalToNoise
      extends java.lang.Object
      implements WaveformProcess, Threadable

  Calculates triggers, via LongShortSignalToNoise, and checks to see if a trigger exists within +- the time interval for the given phase name. Uses the first phase returned, ignoring later phases, such as triplications. The first trigger within the time window of the phase, if there is one, is added to the cookieJar with key "sod_phaseStoN_"+phaseName for use by later subsetters or later velocity output.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected edu.iris.Fissures.model.TimeInterval` | `longOffsetBegin`
    `protected edu.iris.Fissures.model.TimeInterval` | `longOffsetEnd`
    `protected java.lang.String` | `modelName`
    `static java.lang.String` | `PHASE_STON_PREFIX`
    `protected java.lang.String` | `phaseName`
    `protected edu.sc.seis.fissuresUtil.bag.SimplePhaseStoN` | `phaseStoN`
    `protected float` | `ratio`
    `protected edu.iris.Fissures.model.TimeInterval` | `shortOffsetBegin`
    `protected edu.iris.Fissures.model.TimeInterval` | `shortOffsetEnd`
    `protected edu.sc.seis.fissuresUtil.bag.TauPUtil` | `taupUtil`
    `protected edu.iris.Fissures.model.TimeInterval` | `triggerWindow`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PhaseSignalToNoise(org.w3c.dom.Element config)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `WaveformResult` | `accept(edu.sc.seis.fissuresUtil.cache.CacheEvent event, edu.iris.Fissures.network.ChannelImpl channel, edu.iris.Fissures.IfSeismogramDC.RequestFilter[] original, edu.iris.Fissures.IfSeismogramDC.RequestFilter[] available, edu.iris.Fissures.seismogramDC.LocalSeismogramImpl[] seismograms, CookieJar cookieJar)` Processes localSeismograms, possibly modifying them.
    `edu.sc.seis.fissuresUtil.bag.LongShortTrigger` | `calcTrigger(edu.iris.Fissures.IfEvent.EventAccessOperations event, edu.iris.Fissures.IfNetwork.Channel channel, edu.iris.Fissures.seismogramDC.LocalSeismogramImpl[] seismograms)` This method exists to make the trigger available to other subsetters or processors so they don't have to call accept, which adds it to the cookieJar.
    `java.lang.String` | `getCookieName()`
    `java.lang.String` | `getPhaseName()`
    `boolean` | `isThreadSafe()`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### PHASE_STON_PREFIX

          public static final java.lang.String PHASE_STON_PREFIX

      See Also:
        Constant Field Values

    - #### phaseStoN

          protected edu.sc.seis.fissuresUtil.bag.SimplePhaseStoN phaseStoN

    - #### ratio

          protected float ratio

    - #### phaseName

          protected java.lang.String phaseName

    - #### shortOffsetBegin

          protected edu.iris.Fissures.model.TimeInterval shortOffsetBegin

    - #### shortOffsetEnd

          protected edu.iris.Fissures.model.TimeInterval shortOffsetEnd

    - #### longOffsetBegin

          protected edu.iris.Fissures.model.TimeInterval longOffsetBegin

    - #### longOffsetEnd

          protected edu.iris.Fissures.model.TimeInterval longOffsetEnd

    - #### modelName

          protected java.lang.String modelName

    - #### triggerWindow

          protected edu.iris.Fissures.model.TimeInterval triggerWindow

    - #### taupUtil

          protected edu.sc.seis.fissuresUtil.bag.TauPUtil taupUtil

  - ### Constructor Detail

    - #### PhaseSignalToNoise

          public PhaseSignalToNoise(org.w3c.dom.Element config)
                             throws ConfigurationException,
                                    edu.sc.seis.TauP.TauModelException

      Throws:
        `ConfigurationException`
        `edu.sc.seis.TauP.TauModelException`

  - ### Method Detail

    - #### isThreadSafe

          public boolean isThreadSafe()

      Specified by:
        `isThreadSafe` in interface `Threadable`

    - #### accept

          public WaveformResult accept(edu.sc.seis.fissuresUtil.cache.CacheEvent event,
                                       edu.iris.Fissures.network.ChannelImpl channel,
                                       edu.iris.Fissures.IfSeismogramDC.RequestFilter[] original,
                                       edu.iris.Fissures.IfSeismogramDC.RequestFilter[] available,
                                       edu.iris.Fissures.seismogramDC.LocalSeismogramImpl[] seismograms,
                                       CookieJar cookieJar)
                                throws java.lang.Exception

      Description copied from interface: `WaveformProcess`
      Processes localSeismograms, possibly modifying them.
      Specified by:
        `accept` in interface `WaveformProcess`
      Throws:
        `java.lang.Exception`

    - #### calcTrigger

          public edu.sc.seis.fissuresUtil.bag.LongShortTrigger calcTrigger(edu.iris.Fissures.IfEvent.EventAccessOperations event,
                                                                           edu.iris.Fissures.IfNetwork.Channel channel,
                                                                           edu.iris.Fissures.seismogramDC.LocalSeismogramImpl[] seismograms)
                                                                    throws edu.iris.Fissures.IfEvent.NoPreferredOrigin,
                                                                           edu.iris.Fissures.FissuresException,
                                                                           edu.sc.seis.fissuresUtil.bag.PhaseNonExistent,
                                                                           edu.sc.seis.TauP.TauModelException

      This method exists to make the trigger available to other subsetters or processors so they don't have to call accept, which adds it to the cookieJar.
      Throws:
        `edu.iris.Fissures.IfEvent.NoPreferredOrigin`
        `edu.iris.Fissures.FissuresException`
        `edu.sc.seis.fissuresUtil.bag.PhaseNonExistent`
        `edu.sc.seis.TauP.TauModelException`

    - #### getCookieName

          public java.lang.String getCookieName()

    - #### getPhaseName

          public java.lang.String getPhaseName()

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`