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
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 Summary
FieldsModifier and TypeFieldDescriptionprotected BinningResultprotected List<ValidObservation>protected Notifier<BinningResult>protected intprotected intprotected ContinuousModelFunctionprotected intstatic final intprotected ITimeElementEntityprotected doubleFields inherited from class org.aavso.tools.vstar.ui.model.plot.ObservationPlotModel
atLeastOneVisualBandPresent, coordSrc, discrepantListener, excludedListener, filterSeriesNum, lastSinglySelectedSeries, modelSeriesNum, obComparator, residualsSeriesNum, seriesNum, seriesNumToObSrcListMap, seriesNumToSrcTypeMap, seriesToBeJoinedVisually, seriesVisibilityMap, srcTypeToSeriesNumMap -
Constructor Summary
ConstructorsConstructorDescriptionObservationAndMeanPlotModel(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. -
Method Summary
Modifier and TypeMethodDescriptionbooleanchangeMeansSeries(double timeElementsInBin) Attempt to create a new mean series with the specified number of time elements per bin.booleanchangeSeriesVisibility(int seriesNum, boolean visibility) Attempt to change the specified series' visibility.protected Listener<DiscrepantObservationMessage>Listen for discrepant observation change notification and add/remove it from the relevant collections.protected Listener<ExcludedObservationMessage>Listen for excluded observation change notification and add/remove it from the relevant collections.protected Listener<FilteredObservationMessage>Listen for a filtered observation and add/remove its observations from the relevant collections.protected Listener<ModelSelectionMessage>Listen for a model series selection and add/remove its fit and residual observations from the relevant collections.intDetermine which series will initially be the source of the mean series.doublegetMagError(int series, int item) Return the error associated with the magnitude.intintintWhich series' elements should be joined visually (e.g.doubleprotected booleanbooleanRemove all observations from the specified series, but not the series itself.booleansetMeanSeries(boolean updateAfterInitial) Set the mean-based series.voidsetMeanSourceSeriesNum(int meanSourceSeriesNum) voidsetTimeElementsInBin(double timeElementsInBin) voidupdate()Inform the views that the dataset has changed.voidvoidupdateModelSeries(List<ValidObservation> modelObs, List<ValidObservation> residualObs, IModel model) Update the model's fit and residual observation collections.Methods inherited from class org.aavso.tools.vstar.ui.model.plot.ObservationPlotModel
addObservationSeries, addObservationsToSeries, addObservationToSeries, createSeriesCreationListener, getDomainOrder, getEndX, getEndY, getItemCount, getLastSinglySelectedSeries, getMagAsYCoord, getNextSeriesNum, getObservations, getSeriesCount, getSeriesKey, getSeriesKeys, getSeriesNumToObSrcListMap, getSeriesNumToSrcTypeMap, getSeriesVisibilityMap, getSrcTypeToSeriesNumMap, getStartX, getStartY, getValidObservation, getVisibleSeries, getX, getY, isSeriesVisibleByDefault, removeObservationFromSeries, removeObservationsFromSeries, replaceObservationSeries, seriesExists, setLastSinglySelectedSeriesMethods inherited from class org.jfree.data.xy.AbstractIntervalXYDataset
getEndXValue, getEndYValue, getStartXValue, getStartYValueMethods inherited from class org.jfree.data.xy.AbstractXYDataset
getXValue, getYValueMethods inherited from class org.jfree.data.general.AbstractSeriesDataset
indexOf, seriesChangedMethods inherited from class org.jfree.data.general.AbstractDataset
addChangeListener, clone, fireDatasetChanged, getGroup, getNotify, hasListener, notifyListeners, removeChangeListener, setGroup, setNotify, validateObjectMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroupMethods inherited from interface org.jfree.data.general.SeriesDataset
indexOfMethods inherited from interface org.jfree.data.xy.XYDataset
getXValue, getYValue
-
Field Details
-
NO_SERIES
public static final int NO_SERIES- See Also:
-
meanSourceSeriesNum
protected int meanSourceSeriesNum -
meansSeriesNum
protected int meansSeriesNum -
timeElementEntity
-
timeElementsInBin
protected double timeElementsInBin -
meanObsList
-
binningResult
-
meansChangeNotifier
-
modelFunctionSeriesNum
protected int modelFunctionSeriesNum -
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
- 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:ObservationPlotModelAttempt to change the specified series' visibility.- Overrides:
changeSeriesVisibilityin classObservationPlotModel- 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
Which series' elements should be joined visually (e.g. with lines)?- Overrides:
getSeriesWhoseElementsShouldBeJoinedVisuallyin classObservationPlotModel- 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:
getMagErrorin classObservationPlotModel- 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
- Returns:
- the meanObsList
-
getBinningResult
- Returns:
- the binningResult
-
getMeansChangeNotifier
- Returns:
- the meansChangeNotifier
-
getModelFunctionSeriesNum
public int getModelFunctionSeriesNum()- Returns:
- the modelFunctionSeriesNum
-
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
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
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
Description copied from class:ObservationPlotModelListen 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:
createModelSelectionListenerin classObservationPlotModel- See Also:
-
handleNoFilter
-
updateFilteredSeries
-
removeAllObservationFromSeries
Description copied from class:ObservationPlotModelRemove all observations from the specified series, but not the series itself.- Overrides:
removeAllObservationFromSeriesin classObservationPlotModel- Parameters:
type- The series type.- Returns:
- Whether or not the series observations were removed.
-
createFilteredObservationListener
Description copied from class:ObservationPlotModelListen 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:
createFilteredObservationListenerin classObservationPlotModel- See Also:
-