Package core

Class Visualizer

java.lang.Object
core.Visualizer

public class Visualizer extends Object
Handles visualization of spectrometer data. Supports bar and curve plots with optional error bars and normalization. Can display data on wavelength or frequency axes.
Version:
1.0
Author:
Spectrometer Control Software
  • Constructor Details

    • Visualizer

      public Visualizer(MeasurementSet measurementSet)
      Constructs a Visualizer for the given measurement set.
      Parameters:
      measurementSet - the data to visualize
  • Method Details

    • setPlotType

      public void setPlotType(Visualizer.PlotType plotType)
      Sets the plot type.
      Parameters:
      plotType - the PlotType enum value
    • setPlotType

      public void setPlotType(String plotType)
      Sets the plot type from a string.
      Parameters:
      plotType - "bar" for bar chart, anything else for curve
    • setNormalize

      public void setNormalize(boolean normalize)
      Sets whether to normalize data to maximum value.
      Parameters:
      normalize - true to normalize, false otherwise
    • setShowErrorBars

      public void setShowErrorBars(boolean showErrorBars)
      Sets whether to show error bars.
      Parameters:
      showErrorBars - true to show error bars, false otherwise
    • setAxisType

      public void setAxisType(Visualizer.AxisType axisType)
      Sets the axis type.
      Parameters:
      axisType - the AxisType enum value
    • useWavelengthAxis

      public void useWavelengthAxis(boolean useWavelength)
      Convenience method to set wavelength/frequency axis.
      Parameters:
      useWavelength - true for wavelength axis, false for frequency
    • createBarChart

      public org.knowm.xchart.CategoryChart createBarChart()
      Create bar chart for current measurement set.
      Returns:
      CategoryChart configured with the measurement data
    • createCurveChart

      public org.knowm.xchart.XYChart createCurveChart()
      Create curve chart for current measurement set.
      Returns:
      XYChart configured with the measurement data
    • createAbsorptionChart

      public org.knowm.xchart.XYChart createAbsorptionChart(MeasurementSet reference, MeasurementSet sample)
      Create absorption chart comparing reference and sample. Absorbance A = -log₁₀(I/I₀).
      Parameters:
      reference - the reference measurement set (I₀)
      sample - the sample measurement set (I)
      Returns:
      XYChart showing absorption spectrum