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:
- Overview
- Requirements
- Sources
- Compilation
- Setup
- Tools
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.
To run the YOGI system one needs
- Sparcstation,
- Solaris or SunOS operating system,
- Xwindow system with Xlib and Xtoolkit libraries,
- Motiff run-time library (desired),
YOGI C-sources are arranged in the following directory structure:
- yogi
- mkall - main compilation script
- yogi/dataview
- Display.mk
- dataviewm.c
- dataview.main.h
- dataview.c
- dataview.callback.h
- dataview.layout.c
- dataview.layout.h
- dataview.util.c
- dataview.util.h
- links to dbase.c, dbasex.s, dbase.h
interface to the Data Base
- links to imsrv_xdr.c, imsrv_clnt.c, imsrv.h, GetImage.c
intarface to the Image Server
- links to nutil.c, nutil.h, shmio.c, shmio.h, convert.c
names.h, fits.h, camera.h
external Command Language layer routines (only if
dATAview is to be used with Shared Memory interface)
- yogi/tele
- Tele.mk
- telem.c
- tele.main.h
- tele.c
- tele.callback.h
- tele.layout.c
- tele.layout.h
- tele.util.c
- tele.util.h
- links to dbase.c, dbasex.c, dbase.h
interface to the Data Base
- yogi/camera
- Camera.mk
- cameram.c
- camera.main.h
- camera.c
- camera.callback.h
- camera.layout.c
- camera.layout.h
- camera.util.c
- camera.util.h
- links to dbase.c, dbasex.c, dbase.h
- yogi/filter
- Filter.mk
- filterm.c
- filter.main.h
- filter.c
- filter.callback.h
- filter.layout.c
- filter.layout.h
- filter.util.c
- filter.util.h
- links to dbase.c, dbasex.c, dbase.h
- yogi/map
- Map.mk
- mapm.c
- map.main.h
- map.c
- map.callback.h
- map.layout.c
- map.layout.h
- map.util.c
- map.util.h
- links to dbase.c, dbasex.c, dbase.h
- yogi/cmd
- Cmd.mk
- cmdm.c
- cmd.main.h
- cmd.c
- cmd.callback.h
- cmd.layout.c
- cmd.layout.h
- cmd.util.c
- cmd.util.h
- links to dbase.c, dbasex.c, dbase.h
- yogi/config
- Config.mk
- configm.c
- config.main.h
- config.c
- config.callback.h
- config.layout.c
- config.layout.h
- config.util.c
- config.util.h
- links to dbase.c, dbasex.c, dbase.h
- yogi/move
- Move.mk
- movem.c
- move.main.h
- move.c
- move.callback.h
- move.layout.c
- move.layout.h
- move.util.c
- move.util.h
- links to dbase.c, dbasex.c, dbase.h
- yogi/dbsrv
- Dbsrv.mk
- dbsrv.c
- dbase.h
- dbase.c, dbasex.c, for external access
- yogi/cmsrv
- Cmsrv.mk
- cmsrv.c
- chan.h
- links to dbase.c, dbase.h
- links to nutil.c, nutil.h, shmio.c, shmio.h,
names.h, fits.h, camera.h
external Command Language layer routines (only if
dATAview is to be used with Shared Memory interface)
- yogi/imsrv
- Imsrv.mk
- imsrv.c
- imsrv.h
- imsrv_xdr.c
- GetImage.c
- links to dbase.c, dbase.h
- links to nutil.c, nutil.h, shmio.c, shmio.h,
names.h, fits.h, camera.h
external Command Language layer routines (only if
dATAview is to be used with Shared Memory interface)
- yogi/lib
- yogi/boot
- gp_open_omega
- gp_open
- gp_help
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:
- YOGI sources can be compiled either for the SunOS or for the
Solaris. Solaris version (the default one) needs
-DSOLARIS option on the compiler command line. To compile YOGI
under SunOS remove -DSOLARIS switch.
- To make use of the multithread capabilities of the Solaris
-lthread switch must be included in the list of libraries.
Multithreading under Solaris works also on single-processor machines and it
is not clear whether it reduces system performance or not.
- It is importatnt to have a proper setup for Motif includes and
libraries.
The following libraries are in use: -lXm -lXt -lX11 -lm -lsocket -lnsl -lposix4 -lthread -lgp (libgp is located on yogi/lib)
YOGI setup includes :
- 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.
- 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:
- -geometry (e.g. -geometry 180x190+310+0) defines
location of the tool main window. This option is valid for
all graphic tools.
- -dbserver (e.g. -dbserver platon.caha.es) describes on which machine
Data Base Server is located. This option makes
no sense for dbsrv itself.
- -imserver (e.g. -imserver ca35.caha.es) tells where the
Image server is located. This is valid only
for dATAview image display.
- -graph -zoom -view -image options are used in
dATAview to open and position
four additional windows of that tool. By default only
Control (positioned and sized
by -geometry) and
Image windows are opened.
- -target -airmass options are used in
Map to open and position
two additional windows of that tool. By default only
Sky Map (positioned and sized
by -geometry) is opened.
gp_open script is started if the user selects MAX or MAGIC
camera from the
Configuration window, gp_open_omega
if he selects OMEGA.
For the proper functioning of the YOGI system and the underlying
Command Language Layer the following start-up sequence must be followed:
- 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:
- setenv CAMHOME /export/work/generic/
- setenv CAMBIN $CAMHOME/bin
- setenv CAMINFO $CAMHOME/INFO
- setenv CAMSOUND $CAMHOME/SOUNDS
- setenv CAMTMP $HOME/tmp
- 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).
- Shared Memory Manager must be started on the
instrument machine.
- Command Server must be started on the
instrument machine.
- 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.
- 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
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
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
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
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
Data Base variables used by Command:
command macropath macrofile t_macro db_quit
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 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();
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