Skip to content

Commit

Permalink
#204: removed obs copy
Browse files Browse the repository at this point in the history
  • Loading branch information
dbenn committed Feb 2, 2025
1 parent cef0781 commit 4096277
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -299,31 +299,27 @@ protected void modelAction(List<PeriodAnalysisDataPoint> dataPoints) {
final JPanel parent = this;

try {
// Duplicate the obs (just JD and mag) so we can set phases
// without disturbing the original observation object.
List<ValidObservation> phObs = obs; // copyObs(obs);

// Compute binning result again for selected top-hit period.
double period = dataPoints.get(0).getPeriod();
double epoch = PhaseCalcs.epochStrategyMap.get("alpha").determineEpoch(phObs);
double epoch = PhaseCalcs.epochStrategyMap.get("alpha").determineEpoch(obs);

Mediator mediator = Mediator.getInstance();
mediator.createPhasePlot(period, epoch);
mediator.waitForJobCompletion();
mediator.changeAnalysisType(AnalysisType.PHASE_PLOT);

PhaseCalcs.setPhases(phObs, epoch, period);
Collections.sort(phObs, StandardPhaseComparator.instance);
PhaseCalcs.setPhases(obs, epoch, period);
Collections.sort(obs, StandardPhaseComparator.instance);

// Note: 1 / bins = 1 cycle divided into N bins
BinningResult binningResult = DescStats.createSymmetricBinnedObservations(phObs,
BinningResult binningResult = DescStats.createSymmetricBinnedObservations(obs,
PhaseTimeElementEntity.instance, 1.0 / bins);

List<ValidObservation> meanObs = binningResult.getMeanObservations();

// Compute binning result again for selected top-hit period.
// Create piecewise linear model from resulting mean obs.
PiecewiseLinearModel model = new PiecewiseLinearModel(phObs, meanObs);
PiecewiseLinearModel model = new PiecewiseLinearModel(obs, meanObs);
Mediator.getInstance().performModellingOperation(model);
} catch (Exception ex) {
MessageBox.showErrorDialog(parent, "Modelling", ex.getLocalizedMessage());
Expand Down

0 comments on commit 4096277

Please sign in to comment.