AAVSO / VStar

VStar is a visualisation and analysis tool for variable star data brought to you by AAVSO
https://www.aavso.org/vstar
GNU Affero General Public License v3.0
10 stars 3 forks source link

Some filter mechanisms ignore user defined series #253

Closed dbenn closed 1 year ago

dbenn commented 2 years ago

In #195, @mpyat2 commented (excerpt) that: New series created via "Create Series" are independent of the loaded data now. However, they behave differently...those new series seem not visible for filters created via "Simple filter...", "Vela Filter...", "Observer list filter...", and, probably, other filters (however, "Filter from plot" takes them)... At least this behavior should be documented somewhere.

dbenn commented 2 years ago

It may be necessary to add a series property (as distinct from band) for the purpose of filtering in order to be able to ask the question: is some observation in series X?

A method could be added to ValidObservation such as:

boolean isMemberOf(SeriesType series) {
  boolean isMember = false;
  Map<SeriesType, List<ValidObservation>> obsMap = Mediator.getInstance().getValidObservationCategoryMap();
  if (obsMap.containsKey(series)) {
    isMember = obsMap.get(visibleType).contains(ob);
  }
  return isMember;
}

and a filtering operation could turn a search for observations in the "MyTestSeries" series:

series = "MyTestSeries"

into:

isInSeries = isMemberOf(SeriesType.getSeriesFromDescription("MyTestSeries") || isMemberOf(SeriesType.getSeriesFromShortName("MyTestSeries")

Thoughts @mpyat2?

mpyat2 commented 2 years ago

Hi @dbenn , I think a series attribute would be a good approach since in practice series having different JD meanings etc. that come from different sources may belong to the same band (filter).

dbenn commented 1 year ago

This was fixed by making Mediator aware of the new series in a way it was not (in its list of valid observations not just in the map of series to observation lists).