Skip to content

Commit

Permalink
Removed references to R3D identified by Anthony
Browse files Browse the repository at this point in the history
Issue #276 Removed references to R3D identified by Anthony
Also fixed two failed unit tests.
  • Loading branch information
towsey committed Nov 25, 2019
1 parent 96354c9 commit 4dd38e0
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 52 deletions.
11 changes: 0 additions & 11 deletions src/AnalysisConfigFiles/IndexPropertiesConfig.HiRes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -522,17 +522,6 @@ RNG:
CalculateNormBounds: true
ProjectID: Acoustic Indices
Units: "tracks/s"
R3D:
Name: spectralR3D
Comment: "Spectrum of max value of horizontal, positive and negative slope ridges per sec."
DataType: double[]
DefaultValue: 0.0
DoDisplay: true
NormMin: 0.15
NormMax: 1.0
CalculateNormBounds: true
ProjectID: Acoustic Indices
Units: "tracks/s"
SPT:
Name: spectralSPT
Comment: "Spectrum of average number of spectral Peak Tracks per second within each freq bin."
Expand Down
11 changes: 0 additions & 11 deletions src/AnalysisConfigFiles/IndexPropertiesConfig.Zooming.yml
Original file line number Diff line number Diff line change
Expand Up @@ -616,17 +616,6 @@ RNG:
CalculateNormBounds: false
ProjectID: Acoustic Indices
Units: "tracks/s"
R3D:
Name: spectralR3D
Comment: "Spectrum of max value of horizontal, positive and negative slope ridges per sec."
DataType: double[]
DefaultValue: 0.0
DoDisplay: true
NormMin: 0.15
NormMax: 1.0
CalculateNormBounds: false
ProjectID: Acoustic Indices
Units: "tracks/s"
SPT:
Name: spectralSPT
Comment: "Spectrum of average number of spectral Peak Tracks per second within each freq bin."
Expand Down
14 changes: 0 additions & 14 deletions src/AnalysisConfigFiles/IndexPropertiesConfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -664,20 +664,6 @@ RNG:
#CalculateNormMax: false
ProjectID: Acoustic Indices
Units: "tracks/s"
R3D:
Name: spectralR3D
Comment: "Spectrum of max value of horizontal, positive and negative slope ridges per sec."
DataType: double[]
DefaultValue: 0.0
DoDisplay: true
NormMin: 0.15
NormMax: 1.0
CalculateNormBounds: true
# Merge conflict values from https://github.com/QutEcoacoustics/audio-analysis/pull/233
#CalculateNormMin: false
#CalculateNormMax: false
ProjectID: Acoustic Indices
Units: "tracks/s"
SPT:
Name: spectralSPT
Comment: "Spectrum of average number of spectral Peak Tracks per second within each freq bin."
Expand Down
2 changes: 1 addition & 1 deletion src/AnalysisConfigFiles/SpectrogramFalseColourConfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# It should NOT contain dynamic data (like file names or analysis types)

ColorMap1: "ACI-ENT-EVN"
ColorMap2: "BGN-PMN-R3D"
ColorMap2: "BGN-PMN-EVN"

# The ColourFilter parameter determines how much the low index values are emphasized or de-emphasized.
# The purpose is to make low intensity features stand out (emphasis) or become even less obvious (de-emphasis).
Expand Down
2 changes: 1 addition & 1 deletion src/AnalysisPrograms/Recognizers/Base/RecognizerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ private void DrawLongDurationSpectrogram(
FalseColourSpectrogramConfig = spectrogramConfig.FullName,
IndexPropertiesConfig = ipConfig.FullName,
ColourMap1 = "BGN-DMN-EVN",
ColourMap2 = "R3D-RVT-SPT", //R3D replaces PHN as new derived index
ColourMap2 = "RHZ-RVT-SPT", //R3D replaces PHN as new derived index
TemporalScale = hiResTimeScale,
};

Expand Down
2 changes: 0 additions & 2 deletions src/AudioAnalysisTools/Indices/InitialiseIndexProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,11 @@ public static class InitialiseIndexProperties

//public const string KeYspectralAci = "ACI";
//public const string KeySpectralBgn = "BGN";
//public const string KeYspectralCls = "CLS";
//public const string KeYspectralCvr = "CVR";
//public const string KeYspectralEnt = "ENT";
//public const string KeYspectralEvn = "EVN";
//public const string KeySpectralOsc = "OSC";
//public const string KeySpectralPmn = "PMN";
//public const string KeySpectralR3D = "R3D";
//public const string KeySpectralRhz = "RHZ";
//public const string KeySpectralRng = "RNG";
//public const string KeySpectralRps = "RPS";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public static LdSpectrogramConfig ReadYamlToConfig(FileInfo path)

/// <summary>
/// NOTE: As of August 2015, we are using EVN (event count) in both spectrograms because CVR (cover) is too highly correlated with POW.
/// NOTE: As of May 2017, PMN replaces POW and we are using R3D in spectrogram2 because it is less correlated with PMN.
/// NOTE: As of May 2017, PMN replaces POW.
/// </summary>
public static LdSpectrogramConfig GetDefaultConfig()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ public class LDSpectrogramRGB
public static string[] GetArrayOfAvailableKeys()
{
// Before May 2017, only the required six spectral indices were incorporated in a dictionary of spectral matrices.
// Since May 2017, all the likely available matrices are incorporated into a dictionary. Note the new names for PMN and R3D, previously POW and HPN respectively.
// Since May 2017, all the likely available matrices are incorporated into a dictionary. Note the new name for PMN, previously POW.
// Note 1: This default array will be subsequently over-written by the indices in the IndexPropertiesConfig file if one is available.
// Note 1: RHZ, SPT and CVR are correlated with POW and do not add much. CLS is not particularly useful. Currently using R3D
// Decmeber 2018: Now all spectral indices are always used in drawing images
// Note 1: RHZ, SPT and CVR are correlated with PMN and do not add much.
// December 2018: Now all spectral indices are always used in drawing images
return SpectralIndexValues.Keys;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,13 @@ public static class SpectrogramConstants

public const string RGBMap_ACI_ENT_PMN = "ACI-ENT-PMN"; //R-G-B
public const string RGBMap_ACI_ENT_CVR = "ACI-ENT-CVR"; //R-G-B
public const string RGBMap_ACI_ENT_CLS = "ACI-ENT-CLS"; //R-G-B
public const string RGBMap_ACI_ENT_EVN = "ACI-ENT-EVN"; //R-G-B
public const string RGBMap_ACI_ENT_SPT = "ACI-ENT-SPT"; //R-G-B

// A second set of RGB mappings based on BGN and PMN.
public const string RGBMap_BGN_PMN_EVN = "BGN-PMN-EVN"; //R-G-B
public const string RGBMap_BGN_PMN_SPT = "BGN-PMN-SPT"; //R-G-B
public const string RGBMap_BGN_PMN_CLS = "BGN-PMN-CLS"; //R-G-B
public const string RGBMap_BGN_PMN_OSC = "BGN-PMN-OSC";
public const string RGBMap_BGN_PMN_R3D = "BGN-PMN-R3D";
public const string RGBMap_BGN_PMN_RHZ = "BGN-PMN-RHZ";
public const string RGBMap_BGN_PMN_CVR = "BGN-PMN-CVR"; //R-G-B

Expand Down
2 changes: 1 addition & 1 deletion src/AudioAnalysisTools/SpectralPeakTracks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ public void GetPeakTracksSpectrum(double[,] dBSpectrogram, double dBThreshold)
} // LocalPeaks()

/// <summary>
/// CALCULATEs SPECTRAL PEAK TRACKS: spectralIndices.SPT, RHZ, RVT, RPS, RNG, R3D,
/// CALCULATEs SPECTRAL PEAK TRACKS: spectralIndices.SPT, RHZ, RVT, RPS, RNG
/// This method is only called from IndexCalulate.analysis() when the IndexCalculation Duration is less than 10 seconds,
/// because need to recalculate background noise etc.
/// Otherwise the constructor of this class is called: sptInfo = new SpectralPeakTracks(decibelSpectrogram, peakThreshold);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void TestAnalyzeSr22050Recording()
var resultsDirectory = this.outputDirectory.Combine("Towsey.Acoustic");
var listOfFiles = resultsDirectory.EnumerateFiles().ToArray();

Assert.AreEqual(40, listOfFiles.Length);
Assert.AreEqual(38, listOfFiles.Length);

var csvCount = listOfFiles.Count(f => f.Name.EndsWith(".csv"));
Assert.AreEqual(16, csvCount);
Expand Down Expand Up @@ -207,7 +207,7 @@ public void TestAnalyzeSr64000Recording()
var resultsDirectory = this.outputDirectory.Combine("Towsey.Acoustic");
var listOfFiles = resultsDirectory.EnumerateFiles().ToArray();

Assert.AreEqual(20, listOfFiles.Length);
Assert.AreEqual(19, listOfFiles.Length);

var csvCount = listOfFiles.Count(f => f.Name.EndsWith(".csv"));
Assert.AreEqual(16, csvCount);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ public void TestImagesHaveCorrectLength(double renderScale, int expectedWidth)
var config = new LdSpectrogramConfig()
{
// same color map to reduce memory stress for test
ColorMap1 = SpectrogramConstants.RGBMap_BGN_PMN_R3D,
ColorMap2 = SpectrogramConstants.RGBMap_BGN_PMN_R3D,
ColorMap1 = SpectrogramConstants.RGBMap_BGN_PMN_EVN,
ColorMap2 = SpectrogramConstants.RGBMap_BGN_PMN_EVN,
};

var generationData = new IndexGenerationData()
Expand Down

0 comments on commit 4dd38e0

Please sign in to comment.