Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use mean_p[012] in allsky common.h #2791

Merged
merged 3 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/capture_RPi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,9 +539,6 @@ myModeMeanSetting.dayMean = CG.myModeMeanSetting.dayMean;
myModeMeanSetting.nightMean = CG.myModeMeanSetting.nightMean;
myModeMeanSetting.dayMean_threshold = CG.myModeMeanSetting.dayMean_threshold;
myModeMeanSetting.nightMean_threshold = CG.myModeMeanSetting.nightMean_threshold;
myModeMeanSetting.mean_p0 = CG.myModeMeanSetting.mean_p0;
myModeMeanSetting.mean_p1 = CG.myModeMeanSetting.mean_p1;
myModeMeanSetting.mean_p2 = CG.myModeMeanSetting.mean_p2;

displaySettings(CG);

Expand Down
5 changes: 0 additions & 5 deletions src/include/mode_mean.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ struct modeMeanSetting {

double const shuttersteps = 6.0; // shuttersteps
int const historySize = 3; // Number of last images for mean target calculation.

// ExposureChange (Steps) = p0 + p1 * diff + (p2*diff)^2
double mean_p0 = DEFAULT_MEAN_P0_RPi;
double mean_p1 = DEFAULT_MEAN_P1_RPi;
double mean_p2 = DEFAULT_MEAN_P2_RPi;
};

bool aegInit(config, raspistillSetting &, modeMeanSetting &);
Expand Down
12 changes: 6 additions & 6 deletions src/mode_mean.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,22 +245,22 @@ void aegGetNextExposureSettings(config * cg,
// fast forward
if (fastforward || meanDiff > (cg->myModeMeanSetting.currentMean_threshold * multiplier1)) {
// We are fairly far off from desired mean so make a big change next time.
ExposureChange = std::max(1.0, currentModeMeanSetting.mean_p0 + (currentModeMeanSetting.mean_p1 * mean_diff) + pow(currentModeMeanSetting.mean_p2 * mean_diff, 2.0));
ExposureChange = std::max(1.0, cg->myModeMeanSetting.mean_p0 + (cg->myModeMeanSetting.mean_p1 * mean_diff) + pow(cg->myModeMeanSetting.mean_p2 * mean_diff, 2.0));
Log(3, " > fast forward ExposureChange now %d (meanDiff=%1.3f > %.2f*threshold=%1.3f)\n",
ExposureChange, meanDiff, multiplier1, cg->myModeMeanSetting.currentMean_threshold*multiplier1);
ExposureChange, meanDiff, multiplier1, cg->myModeMeanSetting.currentMean_threshold * multiplier1);
}
else if (meanDiff > (cg->myModeMeanSetting.currentMean_threshold * multiplier2)) {
// We are somewhat far off from desired mean so make a big change next time.
ExposureChange = std::max(1.0, currentModeMeanSetting.mean_p0 + (currentModeMeanSetting.mean_p1 * mean_diff) + (pow(currentModeMeanSetting.mean_p2 * mean_diff, 2.0) / 2.0));
ExposureChange = std::max(1.0, cg->myModeMeanSetting.mean_p0 + (cg->myModeMeanSetting.mean_p1 * mean_diff) + (pow(cg->myModeMeanSetting.mean_p2 * mean_diff, 2.0) / 2.0));
Log(3, " > medium forward ExposureChange now %d (meanDiff=%1.3f > %.2f*threshold=%1.3f)\n",
ExposureChange, meanDiff, multiplier2, cg->myModeMeanSetting.currentMean_threshold*multiplier2);
ExposureChange, meanDiff, multiplier2, cg->myModeMeanSetting.currentMean_threshold * multiplier2);
}
// slow forward
else if (meanDiff > cg->myModeMeanSetting.currentMean_threshold) {
// We are fairly close to desired mean so make a small change next time.
ExposureChange = std::max(1.0, currentModeMeanSetting.mean_p0 + currentModeMeanSetting.mean_p1 * mean_diff);
ExposureChange = std::max(1.0, cg->myModeMeanSetting.mean_p0 + cg->myModeMeanSetting.mean_p1 * mean_diff);
Log(3, " > slow forward ExposureChange now %d (meanDiff=%1.3f, %.2f*threshold=%1.3f)\n",
ExposureChange, meanDiff, multiplier2, cg->myModeMeanSetting.currentMean_threshold*multiplier2);
ExposureChange, meanDiff, multiplier2, cg->myModeMeanSetting.currentMean_threshold * multiplier2);
}
else {
// We are within the threshold
Expand Down