|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.isti.jevalresp.RespUtils
public class RespUtils
Class RespUtils is a group of static utility functions for JEvalResp.
Field Summary | |
---|---|
static edu.iris.Fissures.model.UnitImpl |
CENTIGRADE_UNITIMPL_OBJ
UnitImpl object for Centigrade temperature units. |
static java.text.DateFormat |
fissDateFormatter
DateFormat object for formatting FISSURES-style date/time strings from Date objects. |
static java.text.DateFormat |
fNameDateFormatter
DateFormat object for formatting date/time values for use with file names. |
static java.util.Date |
NO_ENDDATE_OBJ
Date value of "2599,365,23:59:59" for "no end date". |
static edu.iris.Fissures.model.UnitImpl |
PASCAL_UNITIMPL_OBJ
UnitImpl object for Pascal pressure units. |
static java.text.DateFormat |
respDateFormatter
DateFormat object for parsing and formatting 'evalresp'-style date/time strings to/from Date objects. |
static java.text.DateFormat |
respDateMsFormatter
DateFormat object for parsing and formatting 'evalresp'-style date/time strings (that include fractional seconds) to/from Date objects. |
static edu.iris.Fissures.model.UnitImpl |
TESLA_UNITIMPL_OBJ
UnitImpl object for Tesla magnetic flux density units. |
Method Summary | |
---|---|
static float[] |
appendArrays(float[] fArr1,
float[] fArr2)
Appends all elements in 'dArr2' to end of 'dArr1'. |
static java.lang.String |
channelIdToEvString(edu.iris.Fissures.IfNetwork.ChannelId chObj)
|
static java.lang.String |
channelIdToEvString(edu.iris.Fissures.IfNetwork.ChannelId chObj,
java.util.Date respEndDateObj)
|
static java.lang.String |
channelIdToFName(edu.iris.Fissures.IfNetwork.ChannelId chObj,
boolean addDateFlag)
|
static java.lang.String |
channelIdToFName(java.lang.String staName,
java.lang.String chaName,
java.lang.String netName,
java.lang.String siteName)
|
static java.lang.String |
channelIdToHdrString(edu.iris.Fissures.IfNetwork.ChannelId channelIdObj,
java.util.Date respEndDateObj,
java.lang.String sepStr,
java.lang.String newlineStr)
|
static java.lang.String |
channelIdToHdrString(edu.iris.Fissures.IfNetwork.ChannelId channelIdObj,
java.util.Date respEndDateObj,
java.lang.String sLineStr,
java.lang.String sepStr,
java.lang.String newlineStr)
|
static java.lang.String |
channelIdToString(edu.iris.Fissures.IfNetwork.ChannelId chObj)
|
static java.lang.String |
channelIdToString(edu.iris.Fissures.IfNetwork.ChannelId chObj,
boolean shortFlag)
|
static java.lang.String |
checkFreqArrayParams(double minFreq,
double maxFreq,
int numFreqs,
boolean logSpacingFlag)
Checks the given parameters (used to generate an array of frequency values) for validity. |
static int |
compareTimes(edu.iris.Fissures.Time time1Obj,
edu.iris.Fissures.Time time2Obj)
Compares the given time objects. |
static boolean |
containsGlobChars(java.lang.String str)
|
static boolean |
datesInTimeRange(java.util.Date beginDateObj,
java.util.Date endDateObj,
edu.iris.Fissures.TimeRange timeRangeObj)
|
static java.lang.Double |
deciToSampIntTime(edu.iris.Fissures.IfNetwork.Decimation deciObj)
|
static boolean |
enterDefaultPropValue(java.util.Properties propObj,
java.lang.String nameStr,
java.lang.String defaultStr)
Enters the given property value if the current value is null. |
static java.lang.String |
fileObjPathToUrlStr(java.lang.String pathStr)
Extracts and restores a URL string that has been saved into a 'File' object. |
static java.io.File[] |
findRespfiles(java.lang.String searchPathStr,
java.lang.String[] stationPatArr,
java.lang.String[] channelPatArr,
java.lang.String[] networkPatArr,
java.lang.String[] sitePatArr,
java.lang.String prefixStr)
Finds files that match the given sets of STA/CHA/NET criteria items. |
static java.io.File[] |
findRespfiles(java.lang.String searchPathStr,
java.lang.String[] stationPatArr,
java.lang.String[] channelPatArr,
java.lang.String[] networkPatArr,
java.lang.String[] sitePatArr,
java.lang.String prefixStr,
java.io.File[] initialFilesArr)
Finds files that match the given sets of STA/CHA/NET criteria items. |
static java.io.File[] |
findRespfiles(java.lang.String searchPathStr,
java.lang.String[] stationPatArr,
java.lang.String[] channelPatArr,
java.lang.String[] networkPatArr,
java.lang.String[] sitePatArr,
java.lang.String prefixStr,
java.util.Vector initialFilesVec)
Finds files that match the given sets of STA/CHA/NET criteria items. |
static java.lang.String |
fissDateToString(java.util.Date dateObj)
Converts a 'Date' object to a String with the format ""yyyy,D,HH:mm:ss.SSS". |
static java.util.Date |
fissTimeToDate(edu.iris.Fissures.Time timeObj)
Converts a FISSURES 'Time' object to a 'Date' object. |
static java.lang.String |
fissTimeToString(edu.iris.Fissures.Time timeObj)
Converts a FISSURES 'Time' object to a String with the format ""yyyy,D,HH:mm:ss.SSS". |
static double[] |
floatToDoubleArray(float[] fArr)
Converts an array of 'float' values to an array of 'double' values. |
static java.lang.String |
fmtNumber(double val)
Formats and returns the given value as a String in the form "#.######E+##". |
static double[] |
generateFreqArray(double minFreq,
double maxFreq,
int numFreqs,
boolean logSpacingFlag)
Generates an array of frequency values. |
static double |
getRespSensFrequency(edu.iris.Fissures.IfNetwork.Response respObj)
|
static double |
getRespSensitivity(edu.iris.Fissures.IfNetwork.Response respObj)
|
static java.lang.String |
getTextFormatRespStr(edu.iris.Fissures.IfNetwork.ChannelId channelIdObj,
java.util.Date respEndDateObj,
edu.iris.Fissures.IfNetwork.Response respObj)
Returns a String describing the given response in text "RESP" format. |
static boolean |
globStringArrMatch(java.lang.String dataStr,
java.lang.String[] patternStrArr)
|
static boolean |
globStringMatch(java.lang.String dataStr,
java.lang.String patternStr)
|
static java.lang.String |
globToRegExString(java.lang.String patternStr)
Converts the given glob-style pattern string to an equivilant regular expression pattern. |
static boolean |
inTimeRange(java.util.Date dateObj,
edu.iris.Fissures.TimeRange timeRangeObj)
|
static boolean |
isAfterTime(java.util.Date dateObj,
edu.iris.Fissures.Time timeObj)
|
static boolean |
isBeforeTime(java.util.Date dateObj,
edu.iris.Fissures.Time timeObj)
|
static boolean |
isGainObjValid(edu.iris.Fissures.IfNetwork.Gain gainObj)
Determines if the given gain object is "valid". |
static boolean |
isNegativeOne(float val)
Returns true if the given value is "nearly" equal to '-1'. |
static boolean |
isNegOrZero(double val)
|
static boolean |
isNegOrZero(float val)
|
static boolean |
isSensObjValid(edu.iris.Fissures.IfNetwork.Sensitivity sensObj)
Determines if the given sensitivity object is "valid". |
static boolean |
isZero(ComplexBlk val)
|
static boolean |
isZero(double val)
|
static boolean |
isZero(float val)
|
static edu.iris.Fissures.Unit |
oldRespStrToUnit(java.lang.String nameStr)
Converts the given RESP file units string to a 'Unit' object (previous version). |
static java.util.Date |
parseRespDate(java.lang.String dateStr)
Parses the given 'evalresp' format date string into a 'Date' object. |
static double |
pow10(int exp)
|
static java.io.File[] |
processFileNameList(java.lang.String fileNameListStr)
Processes the given list of file or directory names into an array of 'File' objects. |
static edu.iris.Fissures.model.UnitImpl |
processUnitStrToUnitObj(java.lang.String unitStr,
edu.iris.Fissures.model.UnitImpl unitObj)
Processes a unit string into a unit object. |
static java.lang.Double |
quantityToIntTime(edu.iris.Fissures.Quantity intervalObj)
|
static boolean |
regStringMatch(java.lang.String dataStr,
java.lang.String patternStr)
|
static java.io.File[] |
resolveNameToFileObjs(java.lang.String searchPathStr,
java.lang.String fileNameStr)
Resolves the given name to an array of 'File' objects. |
static java.lang.String |
responseToString(edu.iris.Fissures.IfNetwork.Response respObj)
|
static edu.iris.Fissures.Unit |
respStrToUnit(java.lang.String unitNameStr)
Converts the given RESP file units string to a 'Unit' object. |
static int |
toFirstUnitPower(edu.iris.Fissures.Unit unitObj)
|
static edu.iris.Fissures.Unit[] |
toUnitsArray(edu.iris.Fissures.Unit unitObj)
Builds an array of base Unit objects built from the given Unit object. |
static edu.iris.Fissures.model.UnitImpl |
unitToUnitImpl(edu.iris.Fissures.Unit unitObj)
Converts a 'Unit' object to a 'UnitImpl' object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.text.DateFormat respDateFormatter
public static final java.text.DateFormat respDateMsFormatter
public static final java.text.DateFormat fissDateFormatter
public static final java.text.DateFormat fNameDateFormatter
public static final java.util.Date NO_ENDDATE_OBJ
public static final edu.iris.Fissures.model.UnitImpl PASCAL_UNITIMPL_OBJ
public static final edu.iris.Fissures.model.UnitImpl TESLA_UNITIMPL_OBJ
public static final edu.iris.Fissures.model.UnitImpl CENTIGRADE_UNITIMPL_OBJ
Method Detail |
---|
public static boolean globStringMatch(java.lang.String dataStr, java.lang.String patternStr)
dataStr
- data stringpatternStr
- pattern string
public static java.lang.String globToRegExString(java.lang.String patternStr)
patternStr
- pattern string
public static boolean globStringArrMatch(java.lang.String dataStr, java.lang.String[] patternStrArr)
dataStr
- data stringpatternStrArr
- pattern string array
public static boolean regStringMatch(java.lang.String dataStr, java.lang.String patternStr)
dataStr
- data stringpatternStr
- pattern string
public static boolean containsGlobChars(java.lang.String str)
str
- string
public static edu.iris.Fissures.Unit respStrToUnit(java.lang.String unitNameStr)
unitNameStr
- unit name string.
public static edu.iris.Fissures.model.UnitImpl processUnitStrToUnitObj(java.lang.String unitStr, edu.iris.Fissures.model.UnitImpl unitObj)
unitStr
- unit string to parse and process.unitObj
- unit object into which to multiply the the given unit,
or null to create a new unit object.
public static edu.iris.Fissures.Unit oldRespStrToUnit(java.lang.String nameStr)
nameStr
- unit name string.
public static java.lang.String channelIdToFName(edu.iris.Fissures.IfNetwork.ChannelId chObj, boolean addDateFlag)
chObj
- channel IDaddDateFlag
- if true then a date code in the format
".yyyy.DDD.HH.mm.ss.SSS" built from the channel-ID will be
appended to the returned string.
public static java.lang.String channelIdToFName(java.lang.String staName, java.lang.String chaName, java.lang.String netName, java.lang.String siteName)
staName
- station namechaName
- channel namenetName
- net namesiteName
- site name
public static java.lang.String channelIdToString(edu.iris.Fissures.IfNetwork.ChannelId chObj, boolean shortFlag)
chObj
- channel objectshortFlag
- if true then a short version of the information
is returned.
public static java.lang.String channelIdToString(edu.iris.Fissures.IfNetwork.ChannelId chObj)
chObj
- channel object
public static java.lang.String channelIdToEvString(edu.iris.Fissures.IfNetwork.ChannelId chObj, java.util.Date respEndDateObj)
chObj
- the 'ChannelId' object.respEndDateObj
- the end-time for the channel, or null for no
end-time included.
public static java.lang.String channelIdToEvString(edu.iris.Fissures.IfNetwork.ChannelId chObj)
chObj
- channel object
public static java.lang.String channelIdToHdrString(edu.iris.Fissures.IfNetwork.ChannelId channelIdObj, java.util.Date respEndDateObj, java.lang.String sLineStr, java.lang.String sepStr, java.lang.String newlineStr)
channelIdObj
- the 'ChannelId' object.respEndDateObj
- the end-time for the channel, or null for no
end-time included.sLineStr
- the string to begin each line with.sepStr
- the item separator string to use.newlineStr
- the new-line string to use.
public static java.lang.String channelIdToHdrString(edu.iris.Fissures.IfNetwork.ChannelId channelIdObj, java.util.Date respEndDateObj, java.lang.String sepStr, java.lang.String newlineStr)
channelIdObj
- the 'ChannelId' object.respEndDateObj
- the end-time for the channel, or null for no
end-time included.sepStr
- the item separator string to use.newlineStr
- the new-line string to use.
public static java.lang.String responseToString(edu.iris.Fissures.IfNetwork.Response respObj)
respObj
- response object
public static double getRespSensitivity(edu.iris.Fissures.IfNetwork.Response respObj)
respObj
- response object
public static double getRespSensFrequency(edu.iris.Fissures.IfNetwork.Response respObj)
respObj
- response object
public static java.lang.Double deciToSampIntTime(edu.iris.Fissures.IfNetwork.Decimation deciObj)
deciObj
- decimation object
public static java.lang.Double quantityToIntTime(edu.iris.Fissures.Quantity intervalObj)
intervalObj
- interval object
public static java.util.Date parseRespDate(java.lang.String dateStr)
dateStr
- date string
public static double pow10(int exp)
exp
- exponent value to use.
public static boolean isZero(double val)
val
- value to compare.
public static boolean isZero(float val)
val
- value to compare.
public static boolean isZero(ComplexBlk val)
val
- value to compare.
public static boolean isNegOrZero(double val)
val
- value to compare.
public static boolean isNegOrZero(float val)
val
- value to compare.
public static boolean isNegativeOne(float val)
val
- value to compare.public static boolean isGainObjValid(edu.iris.Fissures.IfNetwork.Gain gainObj)
gainObj
- gain object to test.
public static boolean isSensObjValid(edu.iris.Fissures.IfNetwork.Sensitivity sensObj)
sensObj
- sensitivity object to test.
public static edu.iris.Fissures.Unit[] toUnitsArray(edu.iris.Fissures.Unit unitObj)
unitObj
- unit object
public static int toFirstUnitPower(edu.iris.Fissures.Unit unitObj)
unitObj
- unit object
public static edu.iris.Fissures.model.UnitImpl unitToUnitImpl(edu.iris.Fissures.Unit unitObj)
unitObj
- unit object
public static java.lang.String fmtNumber(double val)
val
- value to use.
public static java.io.File[] findRespfiles(java.lang.String searchPathStr, java.lang.String[] stationPatArr, java.lang.String[] channelPatArr, java.lang.String[] networkPatArr, java.lang.String[] sitePatArr, java.lang.String prefixStr, java.util.Vector initialFilesVec)
searchPathStr
- the path to the directory to be search; if
null or an empty string then the local directory is searched.stationPatArr
- an array of station name patterns to search for,
or a null or empty array to accept all station names.channelPatArr
- an array of channel name patterns to search for,
or a null or empty array to accept all channel names.networkPatArr
- an array of network name patterns to search for,
or a null or empty array to accept all network names.sitePatArr
- site pattern arrayprefixStr
- a prefix that all of the matching files must
contain.initialFilesVec
- a Vector of File objects to be entered into
the returned array and to be appended with the found File objects,
or null for none. File entries will not be duplicated in the
returned array (and Vector).
public static java.io.File[] findRespfiles(java.lang.String searchPathStr, java.lang.String[] stationPatArr, java.lang.String[] channelPatArr, java.lang.String[] networkPatArr, java.lang.String[] sitePatArr, java.lang.String prefixStr, java.io.File[] initialFilesArr)
searchPathStr
- the path to the directory to be search; if
null or an empty string then the local directory is searched.stationPatArr
- an array of station name patterns to search for,
or a null or empty array to accept all station names.channelPatArr
- an array of channel name patterns to search for,
or a null or empty array to accept all channel names.networkPatArr
- an array of network name patterns to search for,
or a null or empty array to accept all network names.sitePatArr
- site pattern arrayprefixStr
- a prefix that all of the matching files must
contain.initialFilesArr
- an array of File objects to be entered into
the returned array, or null for none. File entries will not be
duplicated in the returned array.
public static java.io.File[] findRespfiles(java.lang.String searchPathStr, java.lang.String[] stationPatArr, java.lang.String[] channelPatArr, java.lang.String[] networkPatArr, java.lang.String[] sitePatArr, java.lang.String prefixStr)
searchPathStr
- the path to the directory to be search; if
null or an empty string then the local directory is searched.stationPatArr
- an array of station name patterns to search for,
or a null or empty array to accept all station names.channelPatArr
- an array of channel name patterns to search for,
or a null or empty array to accept all channel names.networkPatArr
- an array of network name patterns to search for,
or a null or empty array to accept all network names.sitePatArr
- site pattern arrayprefixStr
- a prefix that all of the matching files must
contain.
public static java.io.File[] processFileNameList(java.lang.String fileNameListStr)
fileNameListStr
- a list of file or directory names, separated
by the 'File.pathSeparator' character and optional spaces.
public static java.io.File[] resolveNameToFileObjs(java.lang.String searchPathStr, java.lang.String fileNameStr)
searchPathStr
- path to search for files, or null or empty
string to use the current-working directory (".").fileNameStr
- the name string, which may contain "glob-style"
wildcard characters ('*' and '?').
public static float[] appendArrays(float[] fArr1, float[] fArr2)
fArr1
- first value arrayfArr2
- second value array
public static double[] floatToDoubleArray(float[] fArr)
fArr
- value array
public static boolean isBeforeTime(java.util.Date dateObj, edu.iris.Fissures.Time timeObj)
dateObj
- date objecttimeObj
- time object
public static boolean isAfterTime(java.util.Date dateObj, edu.iris.Fissures.Time timeObj)
dateObj
- date objecttimeObj
- time object
public static boolean inTimeRange(java.util.Date dateObj, edu.iris.Fissures.TimeRange timeRangeObj)
dateObj
- date objecttimeRangeObj
- time range object
public static boolean datesInTimeRange(java.util.Date beginDateObj, java.util.Date endDateObj, edu.iris.Fissures.TimeRange timeRangeObj)
beginDateObj
- begin date objectendDateObj
- end date objecttimeRangeObj
- time range object
public static int compareTimes(edu.iris.Fissures.Time time1Obj, edu.iris.Fissures.Time time2Obj)
time1Obj
- time object 1time2Obj
- time object 2
public static java.util.Date fissTimeToDate(edu.iris.Fissures.Time timeObj)
timeObj
- time object
public static java.lang.String fissTimeToString(edu.iris.Fissures.Time timeObj)
timeObj
- time object
public static java.lang.String fissDateToString(java.util.Date dateObj)
dateObj
- date object
public static boolean enterDefaultPropValue(java.util.Properties propObj, java.lang.String nameStr, java.lang.String defaultStr)
propObj
- the 'Properties' object holding the properties.nameStr
- the name of the given property.defaultStr
- the default value to be entered.
public static java.lang.String checkFreqArrayParams(double minFreq, double maxFreq, int numFreqs, boolean logSpacingFlag)
minFreq
- the minimum frequency to generate output for.maxFreq
- the maximum frequency to generate output for.numFreqs
- the number of frequencies to generate output for.logSpacingFlag
- log spacing flag
public static double[] generateFreqArray(double minFreq, double maxFreq, int numFreqs, boolean logSpacingFlag)
minFreq
- the minimum frequency to generate output for.maxFreq
- the maximum frequency to generate output for.numFreqs
- the number of frequencies to generate output for.logSpacingFlag
- log spacing flag
public static java.lang.String fileObjPathToUrlStr(java.lang.String pathStr)
pathStr
- the path string from the 'File' object.
public static java.lang.String getTextFormatRespStr(edu.iris.Fissures.IfNetwork.ChannelId channelIdObj, java.util.Date respEndDateObj, edu.iris.Fissures.IfNetwork.Response respObj)
channelIdObj
- the channel ID associated with the response.respEndDateObj
- end date for channel ID, or null for none.respObj
- the response information.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |