com.isti.jevalresp
Class RespUtils

java.lang.Object
  extended by com.isti.jevalresp.RespUtils

public class RespUtils
extends java.lang.Object

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

respDateFormatter

public static final java.text.DateFormat respDateFormatter
DateFormat object for parsing and formatting 'evalresp'-style date/time strings to/from Date objects. Uses a pattern string of "yyyy,DDD,HH:mm:ss" and is configured to the GMT time zone.


respDateMsFormatter

public static final java.text.DateFormat respDateMsFormatter
DateFormat object for parsing and formatting 'evalresp'-style date/time strings (that include fractional seconds) to/from Date objects. Uses a pattern string of "yyyy,DDD,HH:mm:ss.SSS" and is configured to the GMT time zone.


fissDateFormatter

public static final java.text.DateFormat fissDateFormatter
DateFormat object for formatting FISSURES-style date/time strings from Date objects. Uses a pattern string of "yyyyDDD'T'HH:mm:ss.SSS'z'" and is configured to the GMT time zone.


fNameDateFormatter

public static final java.text.DateFormat fNameDateFormatter
DateFormat object for formatting date/time values for use with file names. Uses a pattern string of "yyyy.DDD.HH.mm.ss.SSS" and is configured to the GMT time zone.


NO_ENDDATE_OBJ

public static final java.util.Date NO_ENDDATE_OBJ
Date value of "2599,365,23:59:59" for "no end date".


PASCAL_UNITIMPL_OBJ

public static final edu.iris.Fissures.model.UnitImpl PASCAL_UNITIMPL_OBJ
UnitImpl object for Pascal pressure units.


TESLA_UNITIMPL_OBJ

public static final edu.iris.Fissures.model.UnitImpl TESLA_UNITIMPL_OBJ
UnitImpl object for Tesla magnetic flux density units.


CENTIGRADE_UNITIMPL_OBJ

public static final edu.iris.Fissures.model.UnitImpl CENTIGRADE_UNITIMPL_OBJ
UnitImpl object for Centigrade temperature units.

Method Detail

globStringMatch

public static boolean globStringMatch(java.lang.String dataStr,
                                      java.lang.String patternStr)
Parameters:
dataStr - data string
patternStr - pattern string
Returns:
true if the glob-style pattern is matched on the given data string. A regular expression match is performed after '*' characters are changed to ".*", '?' characters are changed to "." and "special" characters are "quoted".

globToRegExString

public static java.lang.String globToRegExString(java.lang.String patternStr)
Converts the given glob-style pattern string to an equivilant regular expression pattern. All '*' characters are changed to ".*", all '?' characters are changed to ".", and all other "special" characters are "quoted" with a preceding backslash.

Parameters:
patternStr - pattern string
Returns:
regular expression string

globStringArrMatch

public static boolean globStringArrMatch(java.lang.String dataStr,
                                         java.lang.String[] patternStrArr)
Parameters:
dataStr - data string
patternStrArr - pattern string array
Returns:
true if any glob-style pattern in the pattern string array is matched on the given data string. A regular expression match is performed after '*' characters are changed to ".*", '?' characters are changed to "." and "special" characters are "quoted".

regStringMatch

public static boolean regStringMatch(java.lang.String dataStr,
                                     java.lang.String patternStr)
Parameters:
dataStr - data string
patternStr - pattern string
Returns:
true if the regular-expression pattern is matched on the given data string.

containsGlobChars

public static boolean containsGlobChars(java.lang.String str)
Parameters:
str - string
Returns:
true if the given string contains any glob-style wildcard characters ('*' or '?').

respStrToUnit

public static edu.iris.Fissures.Unit respStrToUnit(java.lang.String unitNameStr)
Converts the given RESP file units string to a 'Unit' object.

Parameters:
unitNameStr - unit name string.
Returns:
A 'Unit' object corresponding to the given unit name, or null if no match could be made.

processUnitStrToUnitObj

public 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. A leading '/' or trailing "^#" or "**#" are taken into account.

Parameters:
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.
Returns:
A new 'UnitImpl' object corresponding to the given string, or null if it could not be matched.

oldRespStrToUnit

public static edu.iris.Fissures.Unit oldRespStrToUnit(java.lang.String nameStr)
Converts the given RESP file units string to a 'Unit' object (previous version).

Parameters:
nameStr - unit name string.
Returns:
A 'Unit' object corresponding to the given unit name, or null if no match could be made.

channelIdToFName

public static java.lang.String channelIdToFName(edu.iris.Fissures.IfNetwork.ChannelId chObj,
                                                boolean addDateFlag)
Parameters:
chObj - channel ID
addDateFlag - 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.
Returns:
an 'evalresp' output filename built from the given 'ChannelId' object, with periods separating the names ("net.sta.loc.cha").

channelIdToFName

public static java.lang.String channelIdToFName(java.lang.String staName,
                                                java.lang.String chaName,
                                                java.lang.String netName,
                                                java.lang.String siteName)
Parameters:
staName - station name
chaName - channel name
netName - net name
siteName - site name
Returns:
an 'evalresp' output filename built from the given station/channel/network names, with periods separating the names ("net.sta.loc.cha").

channelIdToString

public static java.lang.String channelIdToString(edu.iris.Fissures.IfNetwork.ChannelId chObj,
                                                 boolean shortFlag)
Parameters:
chObj - channel object
shortFlag - if true then a short version of the information is returned.
Returns:
a string representation of the given 'ChannelId' object.

channelIdToString

public static java.lang.String channelIdToString(edu.iris.Fissures.IfNetwork.ChannelId chObj)
Parameters:
chObj - channel object
Returns:
a string representation of the given 'ChannelId' object.

channelIdToEvString

public static java.lang.String channelIdToEvString(edu.iris.Fissures.IfNetwork.ChannelId chObj,
                                                   java.util.Date respEndDateObj)
Parameters:
chObj - the 'ChannelId' object.
respEndDateObj - the end-time for the channel, or null for no end-time included.
Returns:
a string representation of the given 'ChannelId' object in 'evalresp' verbose display format: (netCode staCode siteCode chaCode yyyy,ddd,hh:mm:ss yyyy,ddd,hh:mm:ss).

channelIdToEvString

public static java.lang.String channelIdToEvString(edu.iris.Fissures.IfNetwork.ChannelId chObj)
Parameters:
chObj - channel object
Returns:
a string representation of the given 'ChannelId' object in 'evalresp' verbose display format: (netCode staCode siteCode chaCode yyyy,ddd,hh:mm:ss).

channelIdToHdrString

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)
Parameters:
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.
Returns:
a string representation of the given 'ChannelId' object in "header" display format.

channelIdToHdrString

public static java.lang.String channelIdToHdrString(edu.iris.Fissures.IfNetwork.ChannelId channelIdObj,
                                                    java.util.Date respEndDateObj,
                                                    java.lang.String sepStr,
                                                    java.lang.String newlineStr)
Parameters:
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.
Returns:
a string representation of the given 'ChannelId' object in "header" display format.

responseToString

public static java.lang.String responseToString(edu.iris.Fissures.IfNetwork.Response respObj)
Parameters:
respObj - response object
Returns:
a string representation of the given 'Response' object.

getRespSensitivity

public static double getRespSensitivity(edu.iris.Fissures.IfNetwork.Response respObj)
Parameters:
respObj - response object
Returns:
the sensitivity factor for the given Response object, or 0.0 if it cannot be returned.

getRespSensFrequency

public static double getRespSensFrequency(edu.iris.Fissures.IfNetwork.Response respObj)
Parameters:
respObj - response object
Returns:
the sensitivity frequency for the given Response object, or 0.0 if it cannot be returned.

deciToSampIntTime

public static java.lang.Double deciToSampIntTime(edu.iris.Fissures.IfNetwork.Decimation deciObj)
Parameters:
deciObj - decimation object
Returns:
the length (in seconds) of the sampling interval of the given 'Decimation' object.

quantityToIntTime

public static java.lang.Double quantityToIntTime(edu.iris.Fissures.Quantity intervalObj)
Parameters:
intervalObj - interval object
Returns:
the length (in seconds) specified by the given time-interval Quantity object.

parseRespDate

public static java.util.Date parseRespDate(java.lang.String dateStr)
Parses the given 'evalresp' format date string into a 'Date' object. The date string must be in "yyyy,D,HH:mm:ss.SSS" format, but may also be a truncated subset of the format (for example, "yyyy,D,HH:mm:ss" or "yyyy,D"). Any number of fractional-second digits are allowed after the decimal point.

Parameters:
dateStr - date string
Returns:
a Date object, or null if error.

pow10

public static double pow10(int exp)
Parameters:
exp - exponent value to use.
Returns:
the value of the given power of 10 (10**exp).

isZero

public static boolean isZero(double val)
Parameters:
val - value to compare.
Returns:
true if given value is near zero.

isZero

public static boolean isZero(float val)
Parameters:
val - value to compare.
Returns:
true if given value is near zero.

isZero

public static boolean isZero(ComplexBlk val)
Parameters:
val - value to compare.
Returns:
true if both parts of the given complex value are near zero.

isNegOrZero

public static boolean isNegOrZero(double val)
Parameters:
val - value to compare.
Returns:
true if given value is negative or near zero.

isNegOrZero

public static boolean isNegOrZero(float val)
Parameters:
val - value to compare.
Returns:
true if given value is negative or near zero.

isNegativeOne

public static boolean isNegativeOne(float val)
Returns true if the given value is "nearly" equal to '-1'.

Parameters:
val - value to compare.

isGainObjValid

public static boolean isGainObjValid(edu.iris.Fissures.IfNetwork.Gain gainObj)
Determines if the given gain object is "valid". The gain object is "valid" if it is not null, its gain value is not zero, and its frequency and gain values are not equal to '-1'.

Parameters:
gainObj - gain object to test.
Returns:
true if the given gain object is "valid", false if not.

isSensObjValid

public static boolean isSensObjValid(edu.iris.Fissures.IfNetwork.Sensitivity sensObj)
Determines if the given sensitivity object is "valid". The sensitivity object is "valid" if it is not null, its sensitivity value is not zero, and its frequency and sensitivity values are not equal to '-1'.

Parameters:
sensObj - sensitivity object to test.
Returns:
true if the given sensitivity object is "valid", false if not.

toUnitsArray

public static edu.iris.Fissures.Unit[] toUnitsArray(edu.iris.Fissures.Unit unitObj)
Builds an array of base Unit objects built from the given Unit object.

Parameters:
unitObj - unit object
Returns:
An array of Unit objects, each of which is a base Unit object (not composite).

toFirstUnitPower

public static int toFirstUnitPower(edu.iris.Fissures.Unit unitObj)
Parameters:
unitObj - unit object
Returns:
the 'power' value of the first base-unit of the given unit object, or 0 if no power value could be found.

unitToUnitImpl

public static edu.iris.Fissures.model.UnitImpl unitToUnitImpl(edu.iris.Fissures.Unit unitObj)
Converts a 'Unit' object to a 'UnitImpl' object.

Parameters:
unitObj - unit object
Returns:
'UnitImpl' object

fmtNumber

public static java.lang.String fmtNumber(double val)
Formats and returns the given value as a String in the form "#.######E+##".

Parameters:
val - value to use.
Returns:
A new value string.

findRespfiles

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)
Finds files that match the given sets of STA/CHA/NET criteria items. The file names are expected to be in the format "NET.STA.CHA" and prefixed with the value of the parameter 'prefixStr'. All search strings are interpreted as glob-style patterns ('*' and '?' only).

Parameters:
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 array
prefixStr - 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).
Returns:
An array of 'File' objects including those from the 'initialFilesVec' Vector and any new files that match the criteria items.

findRespfiles

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)
Finds files that match the given sets of STA/CHA/NET criteria items. The file names are expected to be in the format "NET.STA.CHA" and prefixed with the value of the parameter 'prefixStr'. All search strings are interpreted as glob-style patterns ('*' and '?' only).

Parameters:
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 array
prefixStr - 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.
Returns:
An array of 'File' objects that match the criteria items, or an empty array if no matching files were found.

findRespfiles

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)
Finds files that match the given sets of STA/CHA/NET criteria items. The file names are expected to be in the format "NET.STA.CHA" and prefixed with the value of the parameter 'prefixStr'. All search strings are interpreted as glob-style patterns ('*' and '?' only).

Parameters:
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 array
prefixStr - a prefix that all of the matching files must contain.
Returns:
An array of 'File' objects that match the criteria items, or an empty array if no matching files were found.

processFileNameList

public static java.io.File[] processFileNameList(java.lang.String fileNameListStr)
Processes the given list of file or directory names into an array of 'File' objects. Any file name may contain path information, which will also be used for any later file names that do not contain path information. If no path information has been given then the current-working directory will be used. File names may contain "glob-style" wildcard characters ('*' and '?'). Relative and absolute directory names may also be specified.

Parameters:
fileNameListStr - a list of file or directory names, separated by the 'File.pathSeparator' character and optional spaces.
Returns:
An array 'File' objects.

resolveNameToFileObjs

public static java.io.File[] resolveNameToFileObjs(java.lang.String searchPathStr,
                                                   java.lang.String fileNameStr)
Resolves the given name to an array of 'File' objects.

Parameters:
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 '?').
Returns:
An array of 'File' objects resolved for the given name, or an empty array if none could be resolved.

appendArrays

public static float[] appendArrays(float[] fArr1,
                                   float[] fArr2)
Appends all elements in 'dArr2' to end of 'dArr1'.

Parameters:
fArr1 - first value array
fArr2 - second value array
Returns:
A new array of float values.

floatToDoubleArray

public static double[] floatToDoubleArray(float[] fArr)
Converts an array of 'float' values to an array of 'double' values.

Parameters:
fArr - value array
Returns:
A new array of 'double' values converted from the input array.

isBeforeTime

public static boolean isBeforeTime(java.util.Date dateObj,
                                   edu.iris.Fissures.Time timeObj)
Parameters:
dateObj - date object
timeObj - time object
Returns:
true if the given date is before the given time object (non-inclusive).

isAfterTime

public static boolean isAfterTime(java.util.Date dateObj,
                                  edu.iris.Fissures.Time timeObj)
Parameters:
dateObj - date object
timeObj - time object
Returns:
true if the given date is after the given time object (non-inclusive).

inTimeRange

public static boolean inTimeRange(java.util.Date dateObj,
                                  edu.iris.Fissures.TimeRange timeRangeObj)
Parameters:
dateObj - date object
timeRangeObj - time range object
Returns:
true if the given date is with the given time range (inclusive).

datesInTimeRange

public static boolean datesInTimeRange(java.util.Date beginDateObj,
                                       java.util.Date endDateObj,
                                       edu.iris.Fissures.TimeRange timeRangeObj)
Parameters:
beginDateObj - begin date object
endDateObj - end date object
timeRangeObj - time range object
Returns:
true if the range of dates defined the by given dates intersects with the given time-range object. If 'endDateObj' is null then 'beginDateObj' is treated as a single date that must be within the time-range. If both are null then true is returned.

compareTimes

public static int compareTimes(edu.iris.Fissures.Time time1Obj,
                               edu.iris.Fissures.Time time2Obj)
Compares the given time objects.

Parameters:
time1Obj - time object 1
time2Obj - time object 2
Returns:
a value less than 0 if time1Obj is before time2Obj, a value greater than 0 if time1Obj is after time2Obj, and the value 0 if the the given time objects are equal or if an error is detected.

fissTimeToDate

public static java.util.Date fissTimeToDate(edu.iris.Fissures.Time timeObj)
Converts a FISSURES 'Time' object to a 'Date' object.

Parameters:
timeObj - time object
Returns:
A 'Date' object, or null if the given 'Time' object could not be converted.

fissTimeToString

public 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". If the trailing milliseconds value is ".000" then it is trimmed.

Parameters:
timeObj - time object
Returns:
A String representing the date/time, or "???" if the given 'Time' object could not be converted.

fissDateToString

public 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". If the trailing milliseconds value is ".000" then it is trimmed.

Parameters:
dateObj - date object
Returns:
A String representing the date/time.

enterDefaultPropValue

public 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.

Parameters:
propObj - the 'Properties' object holding the properties.
nameStr - the name of the given property.
defaultStr - the default value to be entered.
Returns:
true if the given default value was entered, false if not (the property already had a value).

checkFreqArrayParams

public 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.

Parameters:
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
Returns:
an error message, or null if the parameters are valid.

generateFreqArray

public static double[] generateFreqArray(double minFreq,
                                         double maxFreq,
                                         int numFreqs,
                                         boolean logSpacingFlag)
Generates an array of frequency values.

Parameters:
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
Returns:
A new array of double values, or null if an error was detected.

fileObjPathToUrlStr

public static java.lang.String fileObjPathToUrlStr(java.lang.String pathStr)
Extracts and restores a URL string that has been saved into a 'File' object.

Parameters:
pathStr - the path string from the 'File' object.
Returns:
The URL string that was entered into the 'File' object.

getTextFormatRespStr

public 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.

Parameters:
channelIdObj - the channel ID associated with the response.
respEndDateObj - end date for channel ID, or null for none.
respObj - the response information.
Returns:
A String describing the given response in text "RESP" format.