Your Observing Graphic Interface - Technical Reference

Your Observing Graphic Interface is a set of front-end graphic tools developed to make observer's life easier.

This document is divided into the following sections:

  1. Overview
  2. Requirements
  3. Sources
  4. Compilation
  5. Setup
  6. Tools

Overview

YOGI system was written in the C language using Xlib, Xtoolkit and Motiff widget library. The heart of the system is Data Base Server, remotely accesed simple data base. It is compatible in many aspects with the Argonne National Laboratory and Los Alamos National Laboratory EPICS system, which is expected to be implemented also by MPIA on Calar Alto. All communication between the different tools in YOGI system is realized via the Data Base entries. Any tool may establish Data Base entries, set and read their values and request to be notified about entry changes. Data Base entries emulate structures known in EPICS as "channels". Data Base Server and corresponding C-routines realize what is known as a "channel access". Big effort was put into the design process to enable easy EPICS inclusion in future. Since EPICS itself does not support image (or any other massive data input/output) we had to develope independent Image Server, which sends images to the remote clients. At the moment the only existing client that needs this feature is dATAview - a powerfull image display and analysis tool. In EPICS "channels" are located on the separte real-time unix systems (VxWorks) where the instrument control software exists. In YOGI, instrument control software should be interfaced to the Data Base exactly in the same way as the individual tools are. However, current implementaion of YOGI was designed to support MPIA IR cameras (OMEGA, MAGIC, MAX), and therefore had to be interfaced to the existing Command Language layer. It was achiewed with the Command Server, which is interfaced to the Data Base and outputs Command Language commads. Instrument responds (Command Language routines answers) however are directly interfaced to the Data Base. Such complicated interface is the result of a tradeoff between the unwanted Command Language changes and flexibility requirements of the YOGI system. Currently the following YOGI tools were implemented: dATAview, Telescope, Camera, Filter, Sky Map, Command.

Requirements

To run the YOGI system one needs
  1. Sparcstation,
  2. Solaris or SunOS operating system,
  3. Xwindow system with Xlib and Xtoolkit libraries,
  4. Motiff run-time library (desired),

Sources

YOGI C-sources are arranged in the following directory structure:

Compilation

The simplest way to compile the whole YOGI system is to run mkall script on the yogi directory. Two variables, YOGI and BINDIR in the mkall script define location of the C-sources and desired location of the executables.

Other compilation options are set in the individual makefiles:

The following libraries are in use: -lXm -lXt -lX11 -lm -lsocket -lnsl -lposix4 -lthread -lgp (libgp is located on yogi/lib)

Setup

YOGI setup includes :
  1. Configuration setup - interactive tool with wich observer descibes his environment: name, telescope, optics, camera. This setup is saved in the $HOME/tmp/CAMDEFAULTS file and reused during the next start-up.
  2. Layout setup - describes layout of the windows on the observers monitor. It is contained in the gp_open or gp_open_omega scripts which start graphic tools. The following switches can be included on the command lines in the script:
gp_open script is started if the user selects MAX or MAGIC camera from the Configuration window, gp_open_omega if he selects OMEGA.

Startup

For the proper functioning of the YOGI system and the underlying Command Language Layer the following start-up sequence must be followed:
  1. Proper environmental variables must be set. This is Command Lnguage Layer requirement, since YOGI itself (despite the Command Server tool) makes no use of them. Here is en example how to set them:
  2. Data Base Server must be started. It can be run on any machine, but the recomended location is the instrument control machine (on which Camera Language layer runs).
  3. Shared Memory Manager must be started on the instrument machine.
  4. Command Server must be started on the instrument machine.
  5. Configuration tool initializes the YOGI graphic tools. It may be started on the instrument machine, or on the remote one, in which case -dbserver (Data Base Server location) and -imserver (Image Server Location) switches must be used.
  6. Image Server must be started on the instrument machine, if the user works from the remote site.
It is advised to wait for a second or two between each step to make sure that programs have completed initialization. The best way to execute this sequence is to run GPSTART script located on the CAMBIN directory.

Tools - specicfic information

dATAview Tool

The current version requires dATAview to be compiled in the full configuration, i.e. with a disk-file, Image Server and Shared Memory interfaces included. However compiled program can run without Image Server or Shared Memory Manager installed. In this case it will work only as a disk-file browser. Alternatively, if all services are available, user can select (from the File-menu) which service to use. Permanent removing Image Server or Shared Memory interfaces requires small changes in the dATAview source code.

Data Base variables used by dATAview:

alpha_set	delta_set	cassoff	casspos	suba_dx	 
suba_dy	suba_x	suba_y	nimages	t_move_rel	db_quit

Telescope Tool

Data Base variables used by Telescope:

alpha	delta	alpha_set	delta_set	equinox	casspos	
cassoff	tellat	tellong	tele_busy	t_casspos	t_move_abs	
t_move_rel	db_quit

Camera Tool

Data Base variables used by Camera:

camera	nimages	saved	fs_status	fs_fcap	cpar1	cpar2	autosave	
satcheck	verbose	clobber	sound	itime	crep	coadds	cplats	
nwait	object	comment	skyfile	savepath	nextfile	logfile	
savearea	macropath	macrofile	ctypes	ctype	read_busy	
wheel_busy	tele_busy	macro_busy	macroline	macrolines	
ctype_?	optic_?	fratio_?	telescope_?	camera_?	xdim	
ydim	pixscale	suba_dx	suba_dy	suba_x	suba_y	t_read	t_endless	
t_macro	t_pause	t_abort	t_save	t_backup	t_autosave	t_satcheck	
t_verbose	t_clobber	t_sound	t_itime	t_crep	t_coadds	
t_cplats	t_object	t_comment	t_skyfile	t_nextfile	
t_savepath	t_macropath	t_logfile	t_savearea	t_ctype	
t_quit	 db_quit

Filter Tool

DataBase variables used by Filter:

wheelsnwheel_busy	read_busywheel_?_name	wheel_?_npos	 
wheel_?_cpos	wheel_?_pos_?_name	t_wheel_?nt_init_wheel	
db_quit

Sky Map Tool

Data Base variables used by Map:

alpha	 delta	alpha_set	delta_set	casspos	pixscale 
xdim	ydim	saved	tellong	tellat	telalt	t_move_abs	 
t_move_rel	t_object	t_equinox	t_comment	db_quit

Command Tool

Data Base variables used by Command:

command	 macropath	 macrofile	 t_macro	 db_quit

Image Server

Image Server is a RPC program, that registers on the host at the adress 0x20000099. It also connects to the Shared Memory Manager and therefore has access to the images stored on the Shared Memory pages (GetImage.c routines). To acces the image through the Image Server one has first to obtain the handle
	clnt_imsrv=clnt_create(server_name,IMSRVPROG,IMSRVVER,"tcp");
and than ask for image
	ret_image_ptr=image_1(&ask,clnt_imsrv);
The following RPC structure defines communication with the Image Server:
struct _frame{
  short width;
  short height;
  float zero_flux;
  float itime;
  float alpha;
  float delta;
  float pixscale;
  float zero;
  float scale;
  char filter[16];
  char title[16];
  opaque data<>;
};
struct ask_image{
  short x;
  short y;
  short dx;
  short dy;
  short depth;
  int frame_number;
  int min;
  int max;
  short cmd;
  };
struct ret_image {
  short x;
  short y;
  short dx;
  short dy;
  short depth;
  int frame_count;
  int min;
  int max;
  struct _frame frame;
  };
typedef unsigned int info_pos[2];
program IMSRVPROG{
  version IMSRVVER{
    ret_image IMAGE (ask_image) = 2;
    void SHUTDOWN (void) = 99;
  } = 1;
} = 0x20000099;

Data Base Server

Data Base Server is an RPC routine that registers on the host at address 0x20000098; The following structure defines communication with the DataBase Server:
struct db_connect {
  int type;
  string varname<>;
  };
struct db_subscribe {
  unsigned long ch_id;
  unsigned long host;
  unsigned long prognum;
  };
struct db_value {
  unsigned long ch_id;
  int type;
  opaque data<>;
  };
struct db_ctrl {
  int type;
  opaque data<>;
  };
 
program DBSRV{
  version DBSRVVER{
    unsigned long DB_CONNECT (db_connect) = 1;
    void DB_DISCONNECT (db_connect) = 2;
    void DB_SUBSCRIBE (db_subscribe)=3;
    void DB_UNSUBSCRIBE (db_subscribe)=4;
    db_value DB_GETVALUE (unsigned int) = 5;
    void DB_PUTVALUE (db_value) = 6;
    db_ctrl DB_CONTROL (db_ctrl) = 7;
    void SHUTDOWN (void) = 99;
  } = 1;
} = 0x20000098;

On the client side the following routines amy be used to access the server:
void DB_clnt_initialize();
void DB_svc_initialize();
void DB_task_initialize();
int DB_add_event();
int DB_clear_event();
int DB_get();
int DB_put();
int DB_named_get();
int DB_named_put();
int DB_change_connection_event();
void DB_task_exit();
 
void DB_MainLoop();
void DB_XtAppMainLoop();
void DB_Xt_svc_initialize();
void DB_Xt_task_initialize();

Command Server

Data Base variables used by Command Server:

saved	ctype	alpha_tel	delta_tel	eqnx_tel	camera	
w4exist	t_abort	t_savearea	t_autosave	t_backup	t_cassoff	
t_casspos	t_comment	t_savepath	t_charm	t_clobber	
t_crep	t_coadds	t_cplats	t_ctype	t_init_camera	t_init_tele	
t_init_wheel	t_interactive	t_itime	t_logfile	t_macro	t_macropath	
t_message	t_nextfile	t_object	t_observer	t_quit	
t_pause	t_polpos	t_read	t_endless	t_satcheck	t_save	
t_skyfile	t_sound	t_move_abs	t_move_rel	t_verbose	
t_wheel_0	t_wheel_1	t_wheel_2	t_wheel_3	t_wheel_4	

Grzegorz Pojmanski / gp@sirius.astrouw.edu.pl