Skip to content
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
34 changes: 18 additions & 16 deletions Config/sequencerd.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -163,30 +163,32 @@ OFFSET_SETTLE_SEC=3 # sec to wait after an offset-star target o
ACQUIRE_TCS_MAX_OFFSET=60 # the maximum allowable offset sent to the TCS, in arcsec

# Calibration Settings
# CAL_TARGET=(name caldoor calcover U G R I lampthar lampfear lampbluc lampredc lolamp hilamp mod1 mod2 ... mod6 imgtype)
# CAL_TARGET=(name caldoor calcover U G R I lampthar lampfear lampbluc lampredc lolamp hilamp he_arc ultra mod1 mod2 ... mod6 imgtype)
#
# where name must be "DEFAULT" or start with "CAL_"
# caldoor = open | close
# calcover = open | close
# U,G,R,I = on | off # indicates which channels to enable/disable
# lamp* = on | off # lamp power
# mod* = on | off # lamp modulator
# lamp* = on | off # lamp power state
# mod* = on | off # lamp modulator state
# imgtype = <imgtype> # FITS IMGTYPE keyword
# for a total of 20 required parameters
# for a total of 22 required parameters
# name=SCIENCE defines science target operation
#
# name door cover U G R I thar fear bluc redc llmp hlmp mod1 mod2 mod3 mod4 mod5 mod6 imgtype
CAL_TARGET=(CAL_THAR open close on on on on on on on on off off off off off off off on THAR )
CAL_TARGET=(CAL_FEAR open close on on on on on on on on off off on off off off off off FEAR )
CAL_TARGET=(CAL_THAR_UG open close on on off off on on on on off off off off off off off on THAR )
CAL_TARGET=(CAL_FEAR_UG open close on on off off on on on on off off on off off off off off FEAR )
CAL_TARGET=(CAL_CONTR open close on on on on on on on on off off off off off on off off CONT )
CAL_TARGET=(CAL_CONTB open close on on on on on on on on off off off off off off on off CONT )
CAL_TARGET=(CAL_DOME close open on on on on off off off off off on off off off off off off DOMEFLAT)
CAL_TARGET=(CAL_DOME_UG close open on on off off off off off off off on off off off off off off DOMEFLAT)
CAL_TARGET=(CAL_BIAS close close on on on on off off off off off off off off off off off off BIAS )
CAL_TARGET=(CAL_DARK close close on on on on off off off off off off off off off off off off DARK )
CAL_TARGET=(SCIENCE close open on on on on off off off off off off off off off off off off SCI )
# name door cover U G R I thar fear bluc redc llmp hlmp arc ultr mod1 mod2 mod3 mod4 mod5 mod6 imgtype
CAL_TARGET=(CAL_THAR open close on on on on on on on on off off off off off off off off off on THAR )
CAL_TARGET=(CAL_FEAR open close on on on on on on on on off off off off on off off off off off FEAR )
CAL_TARGET=(CAL_THAR_UG open close on on off off on on on on off off off off off off off off off on THAR )
CAL_TARGET=(CAL_FEAR_UG open close on on off off on on on on off off off off on off off off off off FEAR )
CAL_TARGET=(CAL_CONTR open close on on on on on on on on off off off off off off off on off off CONT )
CAL_TARGET=(CAL_CONTB open close on on on on on on on on off off off off off off off off on off CONT )
CAL_TARGET=(CAL_DOME close open on on on on off off off off off on off off off off off off off off DOMEFLAT)
CAL_TARGET=(CAL_DOME_UG close open on on off off off off off off off on off on off off off off off off DOMEFLAT)
CAL_TARGET=(CAL_DOMEHE close open on on on on off off off off off off on off off off off off off off DOMEHE )
CAL_TARGET=(CAL_DOMEHE_UG close open on on off off off off off off off off on off off off off off off off DOMEHE )
CAL_TARGET=(CAL_BIAS close close on on on on off off off off off off off off off off off off off off BIAS )
CAL_TARGET=(CAL_DARK close close on on on on off off off off off off off off off off off off off off DARK )
CAL_TARGET=(SCIENCE close open on on on on off off off off off off off off off off off off off off SCI )

# miscellaneous
#
Expand Down
6 changes: 5 additions & 1 deletion common/fits_header_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ namespace FitsHeaderKeys {
{ Key::Tcsd::ZENANGLE.c_str(), "", "TCS reported Zenith angle", "FLOAT" },
{ Key::Tcsd::DOMEAZ.c_str(), "", "TCS reported dome azimuth", "FLOAT" },
{ Key::Tcsd::DOMESHUT.c_str(), "", "dome shutters" },
{ Key::Tcsd::TELFOCUS.c_str(), "", "TCS reported telescope focus position in mm", "FLOAT" }
{ Key::Tcsd::TELFOCUS.c_str(), "", "TCS reported telescope focus position in mm", "FLOAT" },
{ Key::Tcsd::LAMP_LO.c_str(), "LAMP_LO", "TCS LO lamp 0=off 1=on", "INT" },
{ Key::Tcsd::LAMP_HI.c_str(), "LAMP_HI", "TCS HI lamp 0=off 1=on", "INT" },
{ Key::Tcsd::LAMP_ARC.c_str(), "LAMP_ARC", "TCS He-arc lamp 0=off 1=on", "INT" },
{ Key::Tcsd::LAMP_ULTRA.c_str(), "LAMP_ULT", "TCS ultra-high lamp 0=off 1=on", "INT" }
};

const Extension ThermalInfoKeys[] = {
Expand Down
4 changes: 4 additions & 0 deletions common/message_keys.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ namespace Key {
inline const std::string DOMEAZ = "DOMEAZ";
inline const std::string DOMESHUT = "DOMESHUT";
inline const std::string TELFOCUS = "TELFOCUS";
inline const std::string LAMP_LO = "LAMP_LO";
inline const std::string LAMP_HI = "LAMP_HI";
inline const std::string LAMP_ARC = "LAMP_ARC";
inline const std::string LAMP_ULTRA= "LAMP_ULTRA";
}

namespace Calibd {
Expand Down
8 changes: 8 additions & 0 deletions common/tcs_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ const int TCS_UNABLE_TO_EXECUTE = -3;
const int TCS_HOST_UNAVAILABLE = -4;
const int TCS_UNDEFINED = 9999;

// dome lamps
// the names are mine but the associated numbers belong to the TCS
//
inline static const char TCS_LAMPNAME_LO[] = "LO"; const int TCS_LAMPNUM_LO = 1;
inline static const char TCS_LAMPNAME_HI[] = "HI"; const int TCS_LAMPNUM_HI = 2;
inline static const char TCS_LAMPNAME_ARC[] = "ARC"; const int TCS_LAMPNUM_ARC = 3;
inline static const char TCS_LAMPNAME_ULTRA[] = "ULTRA"; const int TCS_LAMPNUM_ULTRA = 4;

// human-readable strings to match the above
//
inline static const char TCS_SUCCESS_STR[] = "success";
Expand Down
2 changes: 2 additions & 0 deletions common/tcsd_commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const std::string TCSD_GET_OFFSETS = "getoffsets";
const std::string TCSD_GET_PA = "getpa";
const std::string TCSD_GET_NAME = "getname";
const std::string TCSD_ISOPEN = "isopen";
const std::string TCSD_LAMP = "lamp";
const std::string TCSD_LIST = "list";
const std::string TCSD_LLIST = "llist";
const std::string TCSD_NATIVE = "native";
Expand All @@ -46,6 +47,7 @@ const std::vector<std::string> TCSD_SYNTAX = {
TCSD_GET_PA+" [ ? ]",
TCSD_GET_NAME+" [ ? ]",
TCSD_ISOPEN+" [ ? ]",
TCSD_LAMP+" ? | <lamp> [on|off]",
TCSD_LIST+" [ ? ]",
TCSD_LLIST+" [ ? ]",
TCSD_NATIVE+" ? | <cmd>",
Expand Down
22 changes: 10 additions & 12 deletions sequencerd/sequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2429,18 +2429,16 @@ namespace Sequencer {
}
}

// Not working yet 2025-02-04
//
// // set the dome lamps
// //
// for ( const auto &[lamp,state] : calinfo.domelamp ) {
// if ( this->cancel_flag.load() ) break;
// cmd.str(""); cmd << TCSD_NATIVE << " NPS " << lamp << " " << (state?1:0);
// if ( this->tcsd.command( cmd.str() ) != NO_ERROR ) {
// this->async.enqueue_and_log( function, "ERROR "+cmd.str() );
// throw std::runtime_error("setting dome lamp: "+cmd.str());
// }
// }
// set the dome lamps
//
for ( const auto &[lamp,state] : calinfo.domelamp ) {
if ( this->cancel_flag.load() ) break;
cmd.str(""); cmd << TCSD_LAMP << lamp << " " << (state==1?"on":"off");
if ( this->tcsd.command( cmd.str() ) != NO_ERROR ) {
logwrite(function, "ERROR "+cmd.str());
throw std::runtime_error("setting TCS "+cmd.str());
}
}

// set the lamp modulators
//
Expand Down
18 changes: 9 additions & 9 deletions sequencerd/sequencer_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -960,9 +960,9 @@ namespace Sequencer {

auto size = Tokenize( args, tokens, " \t" );

// there must be 20 args. see cfg file for complete description
if ( size != 20 ) {
logwrite(function, "ERROR bad config file. expected 20 but received "
// there must be 22 args. see cfg file for complete description
if ( size != 22 ) {
logwrite(function, "ERROR bad config file. expected 22 but received "
+std::to_string(size)+" parameters");
return ERROR;
}
Expand Down Expand Up @@ -996,18 +996,18 @@ namespace Sequencer {
info.lamp[lampnames.at(i)] = on_off(tokens.at(7+i));
}

// tokens 11-12 are dome lamps
for (size_t i=0; i < 2; i++) {
// tokens 11-14 are dome lamps: LO, HI, ARC, ULTRA
for (size_t i=0; i < 4; i++) {
info.domelamp[i] = on_off(tokens.at(11+i));
}

// tokens 13-18 -- modulator numbers are {1:6}
// tokens 15-20 -- modulator numbers are {1:6}
for (size_t i=0; i<6; i++) {
info.lampmod[i+1] = on_off(tokens.at(13+i));
info.lampmod[i+1] = on_off(tokens.at(15+i));
}

// token[19] is FITS IMGTYPE
info.imgtype = tokens.at(19);
// token[21] is FITS IMGTYPE
info.imgtype = tokens.at(21);
}
catch (const std::exception &e) {
logwrite(function, "ERROR: "+std::string(e.what()));
Expand Down
4 changes: 2 additions & 2 deletions sequencerd/sequencer_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ namespace Sequencer {
CalibrationTarget() :
chans { "U", "G", "R", "I" },
lampnames { "LAMPTHAR", "LAMPFEAR", "LAMPBLUC", "LAMPREDC" },
domelampnames { "LOLAMP", "HILAMP" } { }
domelampnames { "LO", "HI", "ARC", "ULTRA" } { } // this is how they

///< struct holds all calibration parameters not in the target database
typedef struct {
Expand All @@ -144,7 +144,7 @@ namespace Sequencer {
bool caldoor; // true=open
bool calcover; // true=open
std::map<std::string, bool> lamp; // true=on
std::map<int, bool> domelamp; // 1=LOLAMP, 2=HILAMP, true=on
std::map<int, bool> domelamp; // [1=LO, 2=HI, 3=ARC, 4=ULTRA], true=on
std::map<int, bool> lampmod; // true=on
} calinfo_t;

Expand Down
Loading
Loading