Kstars
gaussian_process_guider.cpp
75 QString("GPG Parameters: control_gain %1 min_move %2 pred_gain %3 min_for_inf %4 min_for_period %5 pts %6 cpd %7 -- se0L %8 se0V %9 PL %10 PV %11 Se1L %12 se1V %13 ppd %14")
99 double delta_measurement_time = std::chrono::duration<double>(current_time - last_time_).count();
140void GaussianProcessGuider::UpdateGP(double prediction_point /*= std::numeric_limits<double>::quiet_NaN()*/)
216 if (GetBoolComputePeriod() && get_last_point().timestamp > parameters.min_periods_for_period_estimation_ * period_length)
232 // inference of the GP with the new points, maximum accuracy should be reached around current time
233 gp_.inferSD(timestamps, gear_error, parameters.points_for_approximation_, variances, prediction_point);
250 last_prediction_end_ = std::chrono::duration<double>(std::chrono::system_clock::now() - start_time_).count();
269double GaussianProcessGuider::result(double input, double SNR, double time_step, double prediction_point /*= -1*/)
283 .arg(input, 6, 'f', 2).arg(SNR, 5, 'f', 1).arg(time_step, 6, 'f', 2).arg(prediction_point, 5, 'f', 1);
302 .arg(input, 6, 'f', 2).arg(SNR, 5, 'f', 1).arg(time_step, 6, 'f', 2).arg(prediction_point, 5, 'f', 1);
335 prediction_point = std::chrono::duration<double>(std::chrono::system_clock::now() - start_time_).count();
348 double percentage = get_last_point().timestamp / (parameters.min_periods_for_inference_ * period_length);
371 GPDebug->Log("PPEC rslt: input = %.2f, final = %.2f, react = %.2f, pred = %.2f, hyst = %.2f, hyst_pct = %.2f, period_length = %.2f",
372 input, control_signal_, parameters.control_gain_ * input, parameters.prediction_gain_ * prediction_, hysteresis_control,
376 QString("PPEC rslt: input = %1, final = %2, react = %3, pred = %4, hyst = %5, hyst_pct = %6, period_length = %7")
394 && get_last_point().timestamp > parameters.min_periods_for_inference_ * GetGPHyperparameters()[PKPeriodLength])
398 prediction_point = std::chrono::duration<double>(std::chrono::system_clock::now() - start_time_).count();
505 hyperparameters(PKLengthScale) = std::asin(hyperparameters(PKLengthScale) / 4.0) * hyperparameters(PKPeriodLength) / M_PI;
514 Eigen::VectorXd hyperparameters_eig = Eigen::VectorXd::Map(&hyperparameters[0], hyperparameters.size());
592void GaussianProcessGuider::inject_data_point(double timestamp, double input, double SNR, double control)
605double GaussianProcessGuider::EstimatePeriodLength(const Eigen::VectorXd &time, const Eigen::VectorXd &data)
611 std::pair<Eigen::VectorXd, Eigen::VectorXd> result = math_tools::compute_spectrum(windowed_data, FFT_SIZE);
621 amplitudes = (periods > 1500.0).select(0, amplitudes); // set amplitudes to zero for too large periods
704 hypers[PKPeriodLength] = (1 - learning_rate_) * hypers[PKPeriodLength] + learning_rate_ * period_length;
720 int grid_size = static_cast<int>(std::ceil(timestamps(timestamps.size() - 1) / grid_interval)) + 1;
744 gear_error_sum += (inter_timestamp - last_timestamp) * 0.5 * (last_gear_error + inter_gear_error);
811 Eigen::VectorXd locations = Eigen::VectorXd::LinSpaced(M, 0, get_second_last_point().timestamp + 1500);
void UpdateGP(double prediction_point=std::numeric_limits< double >::quiet_NaN())
Runs the inference machinery on the GP.
Definition gaussian_process_guider.cpp:140
void SetLearningRate(double learning_rate)
Sets the learning rate.
Definition gaussian_process_guider.cpp:851
void GuidingDitherSettleDone(bool success)
This method tells the guider that dithering is finished.
Definition gaussian_process_guider.cpp:455
void reset()
Clears the data from the circular buffer and clears the GP data.
Definition gaussian_process_guider.cpp:423
void save_gp_data() const
Saves the GP data to a csv file for external analysis.
Definition gaussian_process_guider.cpp:776
void GuidingDithered(double amt, double rate)
This method tells the guider that a dither command was issued.
Definition gaussian_process_guider.cpp:443
void DirectMoveApplied(double amt, double rate)
This method tells the guider that a direct move was issued.
Definition gaussian_process_guider.cpp:466
void UpdatePeriodLength(double period_length)
Does filtering and sets the period length of the GPGuider.
Definition gaussian_process_guider.cpp:690
double deduceResult(double time_step, double prediction_point=-1.0)
This method provides predictive control if no measurement could be made.
Definition gaussian_process_guider.cpp:387
void inject_data_point(double timestamp, double input, double SNR, double control)
This method is needed for automated testing.
Definition gaussian_process_guider.cpp:592
Eigen::MatrixXd regularize_dataset(const Eigen::VectorXd ×tamps, const Eigen::VectorXd &gear_error, const Eigen::VectorXd &variances)
Takes timestamps, measurements and SNRs and returns them regularized in a matrix.
Definition gaussian_process_guider.cpp:709
double result(double input, double SNR, double time_step, double prediction_point=-1.0)
Calculates the control value based on the current input.
Definition gaussian_process_guider.cpp:269
Implementation of Open Astronomy Log (OAL) XML specifications to record observation logs.
QCA_EXPORT Logger * logger()
QFlags()
QString arg(Args &&... args) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:19:02 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:19:02 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.