Skip to content
Open
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
13 changes: 13 additions & 0 deletions acamd/acam_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3394,6 +3394,7 @@ logwrite( function, message.str() );
this->sequential_failures = 0;
this->allow_large_offset.store(false); // no stale deliberate-offset allowance
this->is_acquired.store( false, std::memory_order_release );
this->acquire_start_mjd.store( mjd_now() );

// Start the timeout clock, initialized as the time now plus the
// configured timeout in seconds (duration defaults to seconds).
Expand Down Expand Up @@ -3451,6 +3452,18 @@ logwrite( function, message.str() );
return NO_ERROR;
}

// Skip a frame that began exposing before the acquisition started
// (mjd0 is the readout time, so allow one frame cycle).
//
if ( this->acquire_mode == Acam::TARGET_ACQUIRE || this->acquire_mode == Acam::TARGET_ACQUIRE_HERE ) {
const double cycle = ( iface->camera.andor.camera_info.kintime > 0 ? iface->camera.andor.camera_info.kintime
: iface->camera.andor.camera_info.exptime );
if ( iface->camera.andor.camera_info.mjd0 < this->acquire_start_mjd.load() + cycle / 86400.0 ) {
logwrite( function, "frame exposed before the acquisition started: not used" );
return NO_ERROR;
}
}

// Here is the acquisition sequence, called after every frame grab.
//
// Using that frame, call the solver and send offsets to the TCS. After this
Expand Down
1 change: 1 addition & 0 deletions acamd/acam_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ namespace Acam {
int nacquired;
int attempts;
int sequential_failures;
std::atomic<double> acquire_start_mjd{0}; ///< when the current acquisition was started

std::atomic<bool> is_acquired; ///< set if target acquired successfully
std::atomic<bool> stop_acquisition; ///< set if the acquisition sequence should stop
Expand Down
Loading