Package edu.sc.seis.seisFile.mseed3
Class FDSNSourceId
- java.lang.Object
-
- edu.sc.seis.seisFile.mseed3.FDSNSourceId
-
public class FDSNSourceId extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringbandCodestatic java.lang.StringDEFAULT_LOCATION_CODEstatic java.lang.StringDEFAULT_NETWORK_CODEstatic java.lang.StringDEFAULT_SOURCE_CODEstatic java.lang.StringDEFAULT_STATION_CODEstatic java.lang.StringDEFAULT_SUBSOURCE_CODEstatic java.lang.StringFDSN_PREFIXprotected java.lang.StringlocationCodeprotected java.lang.StringnetworkCodestatic java.lang.StringSEPprotected java.lang.StringsourceCodestatic java.util.regex.PatternsourceIdRegExstatic java.lang.StringsourceIdRegExStringprotected java.lang.StringstationCodeprotected java.lang.StringsubsourceCode
-
Constructor Summary
Constructors Constructor Description FDSNSourceId(java.lang.String networkCode, java.lang.String stationCode, java.lang.String locationCode, java.lang.String bandCode, java.lang.String sourceCode, java.lang.String subsourceCode)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.StringbandCodeForRate(java.lang.Double sampRate, java.lang.Double response_lb)Calculates the band code for the given sample rate.static FDSNSourceIdcreateUnknown(double sampleRate)booleanequals(java.lang.Object o)static FDSNSourceIdfromNSLC(java.lang.String networkCode, java.lang.String stationCode, java.lang.String locationCode, java.lang.String channelCode)java.lang.StringgetBandCode()java.lang.StringgetChannelCode()If band, source and subsource are all length 1, returns a 3-char channel code like BHZ.java.lang.StringgetLocationCode()java.lang.StringgetNetworkCode()java.lang.StringgetSourceCode()java.lang.StringgetStationCode()java.lang.StringgetSubsourceCode()inthashCode()static FDSNSourceIdparse(java.lang.String sourceIdUrl)java.lang.StringtoString()
-
-
-
Field Detail
-
FDSN_PREFIX
public static final java.lang.String FDSN_PREFIX
- See Also:
- Constant Field Values
-
SEP
public static final java.lang.String SEP
- See Also:
- Constant Field Values
-
sourceIdRegExString
public static final java.lang.String sourceIdRegExString
- See Also:
- Constant Field Values
-
sourceIdRegEx
public static final java.util.regex.Pattern sourceIdRegEx
-
DEFAULT_SOURCE_CODE
public static final java.lang.String DEFAULT_SOURCE_CODE
- See Also:
- Constant Field Values
-
DEFAULT_NETWORK_CODE
public static final java.lang.String DEFAULT_NETWORK_CODE
- See Also:
- Constant Field Values
-
DEFAULT_STATION_CODE
public static final java.lang.String DEFAULT_STATION_CODE
- See Also:
- Constant Field Values
-
DEFAULT_LOCATION_CODE
public static final java.lang.String DEFAULT_LOCATION_CODE
- See Also:
- Constant Field Values
-
DEFAULT_SUBSOURCE_CODE
public static final java.lang.String DEFAULT_SUBSOURCE_CODE
- See Also:
- Constant Field Values
-
networkCode
protected java.lang.String networkCode
-
stationCode
protected java.lang.String stationCode
-
locationCode
protected java.lang.String locationCode
-
bandCode
protected java.lang.String bandCode
-
sourceCode
protected java.lang.String sourceCode
-
subsourceCode
protected java.lang.String subsourceCode
-
-
Method Detail
-
parse
public static FDSNSourceId parse(java.lang.String sourceIdUrl) throws FDSNSourceIdException
- Throws:
FDSNSourceIdException
-
fromNSLC
public static FDSNSourceId fromNSLC(java.lang.String networkCode, java.lang.String stationCode, java.lang.String locationCode, java.lang.String channelCode) throws FDSNSourceIdException
- Throws:
FDSNSourceIdException
-
createUnknown
public static FDSNSourceId createUnknown(double sampleRate) throws FDSNSourceIdException
- Throws:
FDSNSourceIdException
-
getNetworkCode
public java.lang.String getNetworkCode()
-
getStationCode
public java.lang.String getStationCode()
-
getLocationCode
public java.lang.String getLocationCode()
-
getBandCode
public java.lang.String getBandCode()
-
getSourceCode
public java.lang.String getSourceCode()
-
getSubsourceCode
public java.lang.String getSubsourceCode()
-
getChannelCode
public java.lang.String getChannelCode()
If band, source and subsource are all length 1, returns a 3-char channel code like BHZ. Otherwise, return separated by '_' like B_XY_Z.- Returns:
- combination of band, source and subsource code
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
bandCodeForRate
public static java.lang.String bandCodeForRate(java.lang.Double sampRate, java.lang.Double response_lb) throws FDSNSourceIdExceptionCalculates the band code for the given sample rate. Optionally taking into account the lower bound of the response, response_lb, to distinguish broadband from short period in the higher sample rates, where 0.1 hertz/10 seconds is the boundary. Use of negative values implies period in seconds, while positive implies Hz. See http://docs.fdsn.org/projects/source-identifiers/en/v1.0/channel-codes.html#band-code- Parameters:
sampRate- sample rate, Hz if positive, period in seconds if negativeresponse_lb- response lower bound in Hz if positive, period if negative- Returns:
- Throws:
FDSNSourceIdException
-
-