Skip to content
Closed
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
11 changes: 11 additions & 0 deletions Config/slicecamd.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@ FINE_ACQUIRE_GAIN_LARGE=1.0
#
FINE_ACQUIRE_GAIN_THRESHOLD=2.0

# FINE_ACQUIRE_GOAL=<arcsec>
# Residual (arcsec) at or below which fine acquisition is converged.
#
FINE_ACQUIRE_GOAL=0.4

# FINE_ACQUIRE_PRECISION=<arcsec>
# MAD scatter per axis (arcsec) at or below which a cycle's samples are
# considered settled enough to evaluate a move.
#
FINE_ACQUIRE_PRECISION=0.35

# FINE_ACQUIRE_EXPTIME_MIN / _MAX = <sec>
# Clamp range for auto-adjusted fine-acquisition exposure time.
#
Expand Down
26 changes: 26 additions & 0 deletions slicecamd/slicecam_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1457,6 +1457,32 @@ namespace Slicecam {
applied++;
}

if ( config.param[entry] == "FINE_ACQUIRE_GOAL" ) {
try { this->fineacquire_state.goal_arcsec = std::stod( config.arg[entry] ); }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reject invalid fine-acquire goals

When FINE_ACQUIRE_GOAL is negative, nan, or inf, std::stod succeeds and the daemon accepts the value. In do_fineacquire, a negative/NaN goal can never satisfy the convergence comparison and there is no correction-cycle limit, while infinity marks every target as locked immediately; this can leave acquisition repeatedly commanding offsets or let observations proceed before the target reaches the slit. Require a finite, positive value before updating the state.

Useful? React with 👍 / 👎.

catch ( const std::exception &e ) {
message.str(""); message << "ERROR invalid FINE_ACQUIRE_GOAL "
<< config.arg[entry] << ": " << e.what();
logwrite( function, message.str() );
return ERROR;
}
message.str(""); message << "SLICECAMD:config:" << config.param[entry] << "=" << config.arg[entry];
logwrite( function, message.str() );
applied++;
}

if ( config.param[entry] == "FINE_ACQUIRE_PRECISION" ) {
try { this->fineacquire_state.prec_arcsec = std::stod( config.arg[entry] ); }
catch ( const std::exception &e ) {
message.str(""); message << "ERROR invalid FINE_ACQUIRE_PRECISION "
<< config.arg[entry] << ": " << e.what();
logwrite( function, message.str() );
return ERROR;
}
message.str(""); message << "SLICECAMD:config:" << config.param[entry] << "=" << config.arg[entry];
logwrite( function, message.str() );
applied++;
}

if ( config.param[entry] == "FINE_ACQUIRE_EXPTIME_MIN" ) {
try { this->fineacquire_state.exptime_min = std::stod( config.arg[entry] ); }
catch ( const std::exception &e ) {
Expand Down
Loading