Class ObservationAndMeanPlotModel

java.lang.Object
org.jfree.data.general.AbstractDataset
org.jfree.data.general.AbstractSeriesDataset
org.jfree.data.xy.AbstractXYDataset
org.jfree.data.xy.AbstractIntervalXYDataset
org.aavso.tools.vstar.ui.model.plot.ObservationPlotModel
org.aavso.tools.vstar.ui.model.plot.ObservationAndMeanPlotModel
All Implemented Interfaces:
ObjectInputValidation, Serializable, Cloneable, EventListener, ISeriesInfoProvider, org.jfree.data.general.Dataset, org.jfree.data.general.SeriesChangeListener, org.jfree.data.general.SeriesDataset, org.jfree.data.xy.IntervalXYDataset, org.jfree.data.xy.XYDataset
Direct Known Subclasses:
PhasedObservationAndMeanPlotModel

public class ObservationAndMeanPlotModel extends ObservationPlotModel
This class is a model that represents a series of valid variable star observations, e.g. for different bands (or from different sources) along with a means series that can change over time.
See Also:
  • Field Details

    • NO_SERIES

      public static final int NO_SERIES
      See Also:
    • meanSourceSeriesNum

      protected int meanSourceSeriesNum
    • meansSeriesNum

      protected int meansSeriesNum
    • timeElementEntity

      protected ITimeElementEntity timeElementEntity
    • timeElementsInBin

      protected double timeElementsInBin
    • meanObsList

      protected List<ValidObservation> meanObsList
    • binningResult

      protected BinningResult binningResult
    • meansChangeNotifier

      protected Notifier<BinningResult> meansChangeNotifier
    • modelFunctionSeriesNum

      protected int modelFunctionSeriesNum
    • modelFunction

      protected ContinuousModelFunction modelFunction
  • Constructor Details

    • ObservationAndMeanPlotModel

      public ObservationAndMeanPlotModel(Map<SeriesType,List<ValidObservation>> obsSourceListMap, ICoordSource coordSrc, Comparator<ValidObservation> obComparator, ITimeElementEntity timeElementEntity, Map<SeriesType,Boolean> seriesVisibilityMap)
      Constructor We add named observation source lists to unique series numbers. Then we add the initial mean-based series.
      Parameters:
      obsSourceListMap - A mapping from source series to lists of observation sources.
      coordSrc - coordinate and error source.
      obComparator - A valid observation comparator (e.g. by JD or phase).
      timeElementEntity - A time element source for observations.
      seriesVisibilityMap - A mapping from series type to visibility status.
  • Method Details

    • getTimeElementEntity

      public ITimeElementEntity getTimeElementEntity()
      Returns:
      the timeElementEntity
    • setMeanSeries

      public boolean setMeanSeries(boolean updateAfterInitial)
      Set the mean-based series. This method creates a new means series based upon the current mean source series index and time-elements-in-bin. It then updates the view and any listeners.
      Parameters:
      updateAfterInitial - Should the mean series be made visible after the initial series is replaced by another? Even if this is set to false, if the series is already visible, it will remain so, and any change to the mean curve will be visible more or less immediately.
    • changeMeansSeries

      public boolean changeMeansSeries(double timeElementsInBin)
      Attempt to create a new mean series with the specified number of time elements per bin.
      Parameters:
      timeElementsInBin - The number of days or phase steps to be created per bin.
      Returns:
      Whether or not the series was changed.
    • changeSeriesVisibility

      public boolean changeSeriesVisibility(int seriesNum, boolean visibility)
      Description copied from class: ObservationPlotModel
      Attempt to change the specified series' visibility.
      Overrides:
      changeSeriesVisibility in class ObservationPlotModel
      Parameters:
      seriesNum - The series number of interest.
      visibility - Whether this series should be visible.
      Returns:
      Whether or not the visibility of the object changed.
      See Also:
    • getSeriesWhoseElementsShouldBeJoinedVisually

      public Collection<Integer> getSeriesWhoseElementsShouldBeJoinedVisually()
      Which series' elements should be joined visually (e.g. with lines)?
      Overrides:
      getSeriesWhoseElementsShouldBeJoinedVisually in class ObservationPlotModel
      Returns:
      A collection of series numbers for series whose elements should be joined visually.
    • getMagError

      public double getMagError(int series, int item)
      Return the error associated with the magnitude. We skip the series and item legality check to improve performance on the assumption that this has been checked already when calling getMagAsYCoord(). So this is a precondition of calling the current function.
      Overrides:
      getMagError in class ObservationPlotModel
      Parameters:
      series - The series number.
      item - The item number within the series.
      Returns:
      The error value associated with the mean.
    • getMeanSourceSeriesNum

      public int getMeanSourceSeriesNum()
      Returns:
      the meanSourceSeriesNum
    • setMeanSourceSeriesNum

      public void setMeanSourceSeriesNum(int meanSourceSeriesNum)
      Parameters:
      meanSourceSeriesNum - the meanSourceSeriesNum to set
    • getMeansSeriesNum

      public int getMeansSeriesNum()
      Returns:
      the means series number
    • getTimeElementsInBin

      public double getTimeElementsInBin()
      Returns:
      the timeElementsInBin
    • setTimeElementsInBin

      public void setTimeElementsInBin(double timeElementsInBin)
      Parameters:
      timeElementsInBin - the timeElementsInBin to set
    • getMeanObsList

      public List<ValidObservation> getMeanObsList()
      Returns:
      the meanObsList
    • getBinningResult

      public BinningResult getBinningResult()
      Returns:
      the binningResult
    • getMeansChangeNotifier

      public Notifier<BinningResult> getMeansChangeNotifier()
      Returns:
      the meansChangeNotifier
    • getModelFunctionSeriesNum

      public int getModelFunctionSeriesNum()
      Returns:
      the modelFunctionSeriesNum
    • getModelFunction

      public ContinuousModelFunction getModelFunction()
      Returns:
      the model
    • determineMeanSeriesSource

      public int determineMeanSeriesSource()
      Determine which series will initially be the source of the mean series. Note that this may be changed subsequently. Visual bands have the highest priority. If not found, the Unspecified series is looked at, otherwise the first band encountered other than fainter-than, excluded, or discrepant will be chosen.
      Returns:
      The series number on which to base the mean series.
    • update

      public void update()
      Inform the views that the dataset has changed.
    • createDiscrepantChangeListener

      protected Listener<DiscrepantObservationMessage> createDiscrepantChangeListener()
      Listen for discrepant observation change notification and add/remove it from the relevant collections. Since a discrepant observation is ignored for statistical analysis purposes (see DescStats class), we need to re-calculate the means series if the discrepant observation's series type is the same as the mean source series type.
    • createExcludedChangeListener

      protected Listener<ExcludedObservationMessage> createExcludedChangeListener()
      Listen for excluded observation change notification and add/remove it from the relevant collections. We need to re-calculate the means series if any of the excluded observations' series type is the same as the mean source series type.
    • updateModelSeries

      public void updateModelSeries(List<ValidObservation> modelObs, List<ValidObservation> residualObs, IModel model)
      Update the model's fit and residual observation collections.
    • createModelSelectionListener

      protected Listener<ModelSelectionMessage> createModelSelectionListener()
      Description copied from class: ObservationPlotModel
      Listen for a model series selection and add/remove its fit and residual observations from the relevant collections. We need to re-calculate the means series if any of the model observations' series type is the same as the mean source series type.
      Specified by:
      createModelSelectionListener in class ObservationPlotModel
      See Also:
    • handleNoFilter

      protected boolean handleNoFilter(FilteredObservationMessage info)
    • updateFilteredSeries

      public void updateFilteredSeries(List<ValidObservation> obs)
    • removeAllObservationFromSeries

      public boolean removeAllObservationFromSeries(SeriesType type)
      Description copied from class: ObservationPlotModel
      Remove all observations from the specified series, but not the series itself.
      Overrides:
      removeAllObservationFromSeries in class ObservationPlotModel
      Parameters:
      type - The series type.
      Returns:
      Whether or not the series observations were removed.
    • createFilteredObservationListener

      protected Listener<FilteredObservationMessage> createFilteredObservationListener()
      Description copied from class: ObservationPlotModel
      Listen for a filtered observation and add/remove its observations from the relevant collections. We need to re-calculate the means series if any of the model observations' series type is the same as the mean source series type.
      Specified by:
      createFilteredObservationListener in class ObservationPlotModel
      See Also: