Class IndexMatrices
Inheritance
IndexMatrices
Assembly: AudioAnalysisTools.dll
public static class IndexMatrices
Fields
|
Improve this Doc
View Source
Declaration
public const string MissingRowString = "<missing row>"
Field Value
Methods
|
Improve this Doc
View Source
DO NOT DELETE THIS METHOD DESPITE NO REFERENCES
It can be useful in future.
Declaration
public static Dictionary<string, double[]> AddDerivedIndices(Dictionary<string, double[]> summaryIndices)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public static Dictionary<string, double[, ]> AddDerivedIndices(Dictionary<string, double[, ]> spectrogramMatrices)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public static Dictionary<string, double[]> AddNDSI_GageGauge(Dictionary<string, double[]> dictionaryOfCsvColumns, string newKey)
Parameters
Returns
|
Improve this Doc
View Source
Compresses the spectral index data in the temporal direction by a factor derived from the data scale and
required image scale.
In most cases, the compression is done by taking the average. ACI, ENT, BGN, and PMN are special cases,
requiring a special form of averaging.
This method got more complicated in June 2016 when it was refactored to cope with recording blocks less than
one minute long.
Declaration
public static Dictionary<string, double[, ]> CompressIndexSpectrograms(Dictionary<string, double[, ]> spectra, TimeSpan imageScale, TimeSpan dataScale, Func<double, double> roundingFunc = null)
Parameters
Returns
|
Improve this Doc
View Source
Concatenates a series of Spectral Index files with a time check,
i.e. check elapse time in file names against accumulated rows of indices.
Declaration
public static List<double[, ]> ConcatenateSpectralIndexFilesWithTimeCheck(FileInfo[] files, TimeSpan indexCalcDuration, string key)
Parameters
Type |
Name |
Description |
FileInfo[] |
files |
All the passed files will be concatenated. Filtering needs to be done somewhere else.
|
TimeSpan |
indexCalcDuration |
used to match rows of indices to elapsed time in file names.
|
String |
key |
this is used only in case need to write an error message. It identifies the key.
|
Returns
|
Improve this Doc
View Source
All the passed files will be concatenated. Filtering needs to be done somewhere else.
Declaration
public static List<SummaryIndexValues> ConcatenateSummaryIndexFilesWithTimeCheck(FileInfo[] files, TimeSpan indexCalcDuration)
Parameters
Type |
Name |
Description |
FileInfo[] |
files |
array of file names.
|
TimeSpan |
indexCalcDuration |
used to match rows of indices to elapsed time in file names.
|
Returns
|
Improve this Doc
View Source
Returns a unique, sorted, list of file paths, sorted on file name.
IMPORTANT: Sorts on alphanumerics, NOT on date or time encoded in the file name.
Declaration
public static FileInfo[] GetFilesInDirectories(DirectoryInfo[] directories, string pattern)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public static FileInfo[] GetFilesInDirectory(string path, string pattern)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public static Dictionary<string, double[, ]> GetSpectralIndexFilesAndConcatenate(DirectoryInfo[] dirs, string analysisType, string[] keys, IndexGenerationData indexGenerationData, bool verbose = false)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public static Dictionary<string, double[, ]> ReadSpectralIndices(DirectoryInfo ipdir, string fileName, string analysisTag, string[] keys)
Parameters
Returns
|
Improve this Doc
View Source
This method reads spectrogram csv files where the first row contains column names
and the first column contains row/time names.
Note: no rotation of data is done!.
Declaration
public static double[, ] ReadSpectrogram(FileInfo csvFile, out int binCount, TwoDimensionalArray transform = TwoDimensionalArray.None)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public static Dictionary<string, double[, ]> ReadSpectrogramCsvFiles(DirectoryInfo ipdir, string fileName, string indexKeys, out int freqBinCount)
Parameters
Returns
|
Improve this Doc
View Source
Reads a list of Spectrogram Csv Files.
Declaration
public static Dictionary<string, double[, ]> ReadSpectrogramCsvFiles(DirectoryInfo ipdir, string fileName, string[] keys, out int freqBinCount)
Parameters
Type |
Name |
Description |
DirectoryInfo |
ipdir |
input dir.
|
String |
fileName |
the file name.
|
String[] |
keys |
an array of keys.
|
Int32 |
freqBinCount |
number of freq bins.
|
Returns
|
Improve this Doc
View Source
Returns dictionary of spectral indices.
Assumes both arrays of same length and keys correspond to file name.
TODO: Do this better one day!.
Declaration
public static Dictionary<string, double[, ]> ReadSummaryIndexFiles(FileInfo[] files, string[] keys)
Parameters
Returns