Data Culling and Batch Plotting

Top  Previous  Next

To minimize system resources, FreeFlyer will thin plot data after a predefined number of data points are plotted. Data culling is described below and can be configured to reflect the user's needs. FreeFlyer can also plot data in batches to display data smoothly and perform consolidated updates.

 

 

Data Culling


To reduce memory usage, plot data is thinned after a predefined number of data points are plotted. The default number of maximum plot data points is 500; this can be configured through your User Preferences or in FreeForm Script using the syntax below.

 

PlotWindow1.MaxPoints = 1000;

 

The maximum number of points applies to the PlotWindow object, not the individual PlotSeries object. For example, if the user has three PlotScatterSeries on a single PlotWindow object, once the three combined series have 1000 points total, plot data will be culled. Since the user can add or remove points, data culling could happen at different points in the data for the various series.

 

Disable Data Culling

The user can disable data culling for a PlotSeries by setting the EnableDataCulling property to false; this will ignore the maximum number of points set in the PlotWindow object.

 

PlotScatterSeries1.EnableDataCulling = 0;

 

Points To Update

To improve execution time, plots are only updated after a predefined number of data points have been collected into a buffer. The default buffer size is 25 points; this can be configured through your User Preferences or in FreeForm Script using the syntax below.

 

PlotWindow1.PointsToUpdate = 200000;

 

The PointsToUpdate property applies to both adding and removing data points. The user can also use batch plotting, described below, to update a specified set of data points.

 

 

Batch Plotting


FreeFlyer lets the user perform batch updates to DataTableWindow, GridWindow, PlotWindow, ViewWindow, and WatchWindow Objects. Batch updates allow the user to perform consolidated updates to a Window Object at a single instance in time. In the example below, data is added to the PlotScatterSeries Objects inside of a While Loop. Then, the two data series objects are added to the PlotWindow and several properties of the plot are set. The BeginBatchUpdate and EndBatchUpdate methods bound the desired updates.

 

Note: A separate EndBatchUpdate statement is required for every BeginBatchUpdate statement.

 

Spacecraft Spacecraft1;

PlotWindow PlotWindow1;

 

PlotScatterSeries PercentInEarthShadow;

PlotScatterSeries PercentInMoonShadow;

 

While (Spacecraft1.ElapsedTime().ToDays() < 1); 

      Step Spacecraft1;

      PercentInEarthShadow.AddPoints(Spacecraft1.EpochText, Spacecraft1.PercentEarthShadow);

      PercentInMoonShadow.AddPoints(Spacecraft1.EpochText, Spacecraft1.PercentMoonShadow);

End;

 

PlotWindow1.BeginBatchUpdate();

 

// Add Series data to PlotWindow1

PlotWindow1.AddSeries(PercentInEarthShadow);

PlotWindow1.AddSeries(PercentInMoonShadow);

 

// Set various properties of PlotWindow1

PlotWindow1.PlotTitle.Text = "Percent in Shadow";

PlotWindow1.PlotSubTitle.Visible = 0;  // Hide PlotSubTitle

PlotWindow1.PlotTitle.Font.Bold = 1;

PlotWindow1.PlotTitle.Font.Size = 15;

PlotWindow1.Series[0].Label = "In Earth Shadow";

PlotWindow1.Series[0].LineColor = ColorTools.Blue;

PlotWindow1.Series[1].Label = "In Moon Shadow";

PlotWindow1.Series[1].LineColor = ColorTools.Red;

PlotWindow1.Series[1].LineStyle = 0; // 0 = Solid

 

PlotWindow1.EndBatchUpdate();

 

See Also


User Preferences