Class Interface

Nested Relationships

Nested Types

Class Documentation

class Interface

interface class for slicecam

This class defines the interface for the slicecam system and contains the functions used to communicate with it.

Public Functions

bool is_acam_status_fresh() const
double tuned_exptime(double cur, double measured, double target) const

scale exposure toward target brightness; sqrt-law, factor-clamped, exptime-clamped

double banded_exptime(double cur, double metric) const

two-band exposure: raise toward faint_goal below counts_faint, lower toward bright_goal above counts_bright, unchanged in band. Returns cur when in band/disabled.

inline Interface()
inline long read_error()
inline std::string get_imagename()
inline std::string get_wcsname()
inline void set_imagename(std::string name_in)
inline void set_wcsname(std::string name_in)
inline long init_pubsub(const std::initializer_list<std::string> &topics = {})

for calling Python fpoffsets, defined in ~/Software/common/skyinfo.h

inline void start_subscriber_thread()
inline void stop_subscriber_thread()
void handletopic_snapshot(const nlohmann::json &jmessage)
void handletopic_acamd(const nlohmann::json &jmessage)
void handletopic_slitd(const nlohmann::json &jmessage)
void handletopic_tcsd(const nlohmann::json &jmessage)
void publish_status(bool force = false)
void publish_snapshot()
void publish_temperature()

publish only the andor temperatures on Topic::SLICECAMD (periodic)

void request_snapshot()
bool wait_for_snapshots()
long fineacquire(std::string args, std::string &retstring)
void do_fineacquire()
long autoexpose(std::string args, std::string &retstring)
void do_autoexpose()
long avg_frames(std::string args, std::string &retstring)
long bin(std::string args, std::string &retstring)
long test_image()
long open(std::string args, std::string &help)
long isopen(std::string which, bool &state, std::string &help)

wrapper to open all slicecams

bool isopen(std::string which)

wrapper for slicecams

void close()

wrapper for slicecams

long close(std::string args, std::string &retstring)
long tcs_init(std::string args, std::string &retstring)
long acamd_init()

initialize connection to TCS

long saveframes(std::string args, std::string &retstring)
void alert_framegrabbing_stopped(const int &waitms)
long framegrab(std::string args)
long framegrab(std::string args, std::string &retstring)

wrapper to control Andor frame grabbing

long framegrab_fix(std::string args, std::string &retstring)

wrapper to control Andor frame grabbing

long image_quality(std::string args, std::string &retstring)

wrapper to control Andor frame grabbing

long put_on_slit(std::string args, std::string &retstring)

wrapper for Astrometry::image_quality

long solve(std::string args, std::string &retstring)

put target on slit

long gui_settings_control()

wrapper for Astrometry::solve

long gui_settings_control(std::string args, std::string &retstring)

get gui settings and push to Guider GUI display

long shutdown(std::string args, std::string &retstring)

set or get and push to Guider GUI display

long shutter(const std::string args, std::string &retstring)
long test(std::string args, std::string &retstring)
long exptime(std::string args, std::string &retstring)
long fan_mode(std::string args, std::string &retstring)
long gain(std::string args, std::string &retstring)
long offset_acam_goal(const std::pair<double, double> &offsets, std::optional<bool> fineacquire = std::nullopt)
long collect_header_info(std::unique_ptr<Andor::Interface> &slicecam)
inline void init_names()
long configure_interface(Config &config)
void dothread_framegrab(const std::string whattodo, const std::string sourcefile)
void preserve_framegrab()
long collect_header_info_threaded()

Public Members

std::unique_ptr<Common::PubSub> publisher

publisher object

std::string publisher_address

publish socket endpoint

std::string publisher_topic

my default topic for publishing

std::unique_ptr<Common::PubSub> subscriber

subscriber object

std::string subscriber_address

subscribe socket endpoint

std::vector<std::string> subscriber_topics

list of topics I subscribe to

std::atomic<bool> is_subscriber_thread_running

is my subscriber thread running?

std::atomic<bool> should_subscriber_thread_run

should my subscriber thread run?

std::unordered_map<std::string, std::function<void(const nlohmann::json&)>> topic_handlers

maps a handler function to each topic

std::atomic<bool> should_framegrab_run

set if framegrab loop should run

std::atomic<bool> is_framegrab_running

set if framegrab loop is running

std::atomic<bool> is_fineacquire_running

set if fine target acquisition is running

std::atomic<bool> is_fineacquire_locked

set when fine acquire target acquired

std::atomic<bool> is_autoexpose_running

set if pre-acquisition auto-exposure is running

std::atomic<bool> is_acam_guiding

is acam guiding?

std::atomic<int64_t> last_acam_pubtime = {0}

pubtime (us) of latest received acamd status

std::atomic<int> nsave_preserve_frames

number of frames to preserve (normally overwritten)

these are set by Interface::saveframes()

std::atomic<int> nskip_preserve_frames

number of frames to skip before saving nsave… frames

std::string tcsname
bool is_tcs_open
double angle_scope
std::string ra_scope_hms
std::string dec_scope_dms
double ra_scope_h
double dec_scope_d
double offsetra
double offsetdec
double az
double telfocus
double airmass
double slitoffset
double slitwidth
struct Slicecam::Interface telem

holds my subscribed-to telemetry

std::mutex snapshot_mtx
std::unordered_map<std::string, bool> snapshot_status
bool is_fineacquire_running = false
bool is_fineacquire_locked = false
bool is_autoexpose_running = false
struct Slicecam::Interface last_status
GUIManager gui_manager
Slicecam::FitsInfo fitsinfo
Common::Header telemkeys
Common::Queue async
Camera camera

asynchronous message queue

FITS_file fits_file
TcsDaemonClient tcsd

instantiate a FITS container object

Common::DaemonClient acamd = {"acamd"}

for communicating with the TCS daemon, defined in ~/Software/tcsd/tcsd_client.h

SkyInfo::FPOffsets fpoffsets

for communicating with acamd

Public Static Functions

static void dothread_fpoffset(Slicecam::Interface &iface)

Public Static Attributes

static constexpr int64_t ACAM_STATUS_MAX_AGE_US = 10'000'000

Max acceptable age (us) for cached ACAM status used by fineacquire.

static constexpr int64_t ACAM_WAIT_TIMEOUT_US = 2'000'000

Max time (us) fineacquire() will wait for a fresh, guiding ACAM status before failing.