Skip to content

Commit

Permalink
Initial work to support Concat Gap Rendering Modes
Browse files Browse the repository at this point in the history
  • Loading branch information
towsey authored and atruskie committed Dec 18, 2017
1 parent ddf7918 commit 1f53f36
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions AudioAnalysis/AnalysisPrograms/ConcatenateIndexFiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,21 @@ namespace AnalysisPrograms

using Zio;

/// <summary>
/// Choices in how recording gaps are visualised.
/// NoGaps: Recording gaps will be ignored. Segments joined without space. Time scale will be broken. This may sometimes be required.
/// TimedGaps: Recording gaps will be filled with grey "error" segment of same duration as gap. Time scale remains linear and complete.
/// This is the normal mode for visualisation
/// BlendedGaps: Recording gaps are filled with some blend of pre- and post-gap spectra.
/// Use this when recordings are one minute in 10, for example.
/// </summary>
public enum ConcatMode
{
NoGaps,
TimedGaps,
BlendedGaps,
}

/// <summary>
/// First argument on command line to call this action is "concatenateIndexFiles"
///
Expand Down Expand Up @@ -102,6 +117,9 @@ public class Arguments
[ArgDescription("Set true only when concatenating more than 24-hours of data into one image - e.g. PNG/Indonesian data.")]
public bool ConcatenateEverythingYouCanLayYourHandsOn { get; set; }

[ArgDescription("How to render gaps in a recording.")]
public string GapRendering { get; set; }

[ArgDescription("One or more directories where the RECOGNIZER event scores are located in csv files. This is optional")]
public DirectoryInfo[] EventDataDirectories { get; set; }

Expand Down Expand Up @@ -184,6 +202,7 @@ public static Arguments Dev()
// ########################## CONCATENATION of Yvonne's BAT recordings
// The drive: work = G; home = E
drive = "G";

// top level directory AVAILAE JOB #181
DirectoryInfo[] dataDirs = { new DirectoryInfo($"{drive}:\\SensorNetworks\\OutputDataSets\\YvonneBats_Gympie20170906"),
};
Expand All @@ -195,6 +214,8 @@ public static Arguments Dev()
bool concatenateEverythingYouCanLayYourHandsOn = false; // Set false to work in 24-hour blocks only
dtoStart = new DateTimeOffset(2017, 08, 08, 0, 0, 0, TimeSpan.Zero);
dtoEnd = new DateTimeOffset(2017, 08, 08, 0, 0, 0, TimeSpan.Zero);
string gapRendering = "TimedGaps";

// ########################## END of Yvonne's BAT recordings

/*
Expand Down Expand Up @@ -456,6 +477,7 @@ public static Arguments Dev()
ColorMap1 = colorMap1,
ColorMap2 = colorMap2,
ConcatenateEverythingYouCanLayYourHandsOn = concatenateEverythingYouCanLayYourHandsOn,
GapRendering = gapRendering,
TimeSpanOffsetHint = timeSpanOffsetHint,
SunRiseDataFile = sunriseDatafile,
DrawImages = drawImages,
Expand Down Expand Up @@ -562,6 +584,9 @@ public static void Execute(Arguments arguments)
}
}

// GapRendering
string GapRendering = "gapRendering";

var startDateTimeOffset = (DateTimeOffset)startDate;

if (verbose)
Expand Down Expand Up @@ -673,8 +698,7 @@ public static void Execute(Arguments arguments)
TimeSpan start = ((DateTimeOffset)indexGenerationData.RecordingStartDate).TimeOfDay;
string startTime = $"{start.Hours:d2}{start.Minutes:d2}h";
string imageTitle = $"SOURCE: \"{opFileStem}\". Starts at {startTime} {Meta.OrganizationTag}";
Bitmap tracksImage =
IndexDisplay.DrawImageOfSummaryIndices(
Bitmap tracksImage = IndexDisplay.DrawImageOfSummaryIndices(
IndexProperties.GetIndexProperties(indexPropertiesConfig),
dictionaryOfSummaryIndices,
imageTitle,
Expand Down

0 comments on commit 1f53f36

Please sign in to comment.