********************************************* Subaru Data Acquisition Tool Kit for Linux README file Ver.1 Masayuki Akiyama 20030630 Based on SUKA TK ver.5.0 ********************************************* 1. Configurations In this README file, I assume username : akiyama obcp machine : fmos1.subaru.nao.ac.jp daqtk install directory : fmos1:/home/akiyama/SUKA/daqtk <$DAQTKHOME> obs, obc machine : g23.subaru.nao.ac.jp simulator install directory : g23:/home/akiyama/SUKA/simulator <$SIMHOME> FMOS obcp number : obcp18 !!NEW!! Telescope system simulator toolkit only works on Solaris machine at this moment. So you need, one Linux box and one Solaris machine for testing the communication between the instrument and the telescope system. I call the former with and latter with in this file. Tcl 7.4 and Tk 4.0 have to be installed on to start the simulator toolkit. Set "wish" alias apropriately to refer the Tcl 7.4 and Tk 4.0 set. have to have FTP server running (proftpd, wu-ftp-server etc), and accept ftp access from , because will obtain FITS image from with FTP service. You have to change the firewall settings (stop "iptables" etc.) of machine to accept "portmap" from , vice versa. You can check the accessibility with akiyama@g23$ rpcinfo -p fmos1 akiyama@fmos1$ rpcinfo -p g23 At least portmapper should be listed like, 100000 2 tcp 111 portmapper 100000 2 udp 111 portmapper Default kernel parameters (/etc/system) on look fine for the toolkit. Shell program in the toolkits are written for "csh". It is better to run the toolkits on the csh enviroment. 2. Installation 2.1 Install "daqtk_linux" toolkit on akiyama@fmos1$ tar xvf daqtk_linux.tar akiyama@fmos1$ cd daqtk akiyama@fmos1$ ./Install obcp18 Ignore some warning messages during the compilation. You have to setup the enviromental variables below on before you start test programs. --------------------------------------------------------------------------- setenv DAQTKHOME /home/akiyama/SUKA/daqtk setenv FITS_KEYWD_INF $DAQTKHOME/sample/src/makefits/prime.txt setenv WCS_COMMENT_INF $DAQTKHOME/sample/src/makefits/WcsComment.txt setenv MAX_BYTE_RPC_LOG 1000000 setenv MAX_GNRT_RPC_LOG 5 setenv MAX_BYTE_ERR_LOG 1000000 setenv DAQTK_IPCKEY_UP 0 setenv CMDOBCP fmos1 setenv CMDOBS g23 setenv THROUGHOBCP fmos1 setenv THROUGHOBS g23 setenv STATOBCP fmos1 setenv STATOBS g23 setenv DATOBCP fmos1 setenv DATOBC g23 setenv GETOBCP fmos1 setenv GETOBS g23 setenv OBCPNO OBCP16 set path=( /home/akiyama/SUKA/simulator/bin $path ) set path=( /home/akiyama/SUKA/simulator/srctcl $path ) set path=( /home/akiyama/SUKA/daqtk/sample/exe $path ) --------------------------------------------------------------------- 2.2 Install "simulator" toolkit on akiyama@g23$ tar xvf simulator.tar akiyama@g23$ cd simulator akiyama@g23$ ./Install obcp18 You have to edit "$SIMHOME/bin/daqsi" based on your enviroment variables. --------------------------------------------------------------------- #!/usr/bin/csh # # for simulator # setenv DAQSIMULATOR /home/akiyama/SUKA/simulator # setenv CMDOBCP fmos1 setenv CMDOBS g23 setenv THROUGHOBCP fmos1 setenv THROUGHOBS g23 setenv STATOBCP fmos1 setenv STATOBS g23 setenv DATOBCP fmos1 setenv DATOBC g23 setenv GETOBCP fmos1 setenv GETOBS g23 # Your account to fmos1 setenv FTP_LOGIN akiyama setenv FTP_PASSWD ******* # setenv OBSDPLOG $DAQSIMULATOR/log/dispatcher.log setenv OBSECLOG $DAQSIMULATOR/log/executor.log setenv OBSSMLOG $DAQSIMULATOR/log/monitor.log setenv OBSDSLOG $DAQSIMULATOR/log/distributor.log setenv OBCLOG $DAQSIMULATOR/log/obc.log # setenv OBSDPMAX 100000 setenv OBSECMAX 100000 setenv OBSSMMAX 100000 setenv OBSDSMAX 100000 setenv OBCMAX 100000 # setenv COMMANDDATA $DAQSIMULATOR/communication/command.data setenv REPLYDATA $DAQSIMULATOR/communication/reply.data setenv STATUSDATA $DAQSIMULATOR/communication/status.data setenv STATUS_ALIAS_CFG $DAQSIMULATOR/communication/StatusAlias.cfg setenv FTPDIRECTORY $DAQSIMULATOR/datafile # DAQsiMain.tcl --------------------------------------------------------------------------- 3. Sample Programs Various sample programs are provided in the tool kit. The sample programs show how to call the functions provided in the tool kit. You can refer the source programs stored in "$DAQTKHOME/sample/src". The sample programs are compiled when you install the daqtk tool kit and available from "$DAQTKHOME/sample/exe". akiyama@fmos1$ cd $DAQTKHOME/sample/exe 3.1 Receiving command from to At first, start "Command Dispatcher Simulator" on daq simulator. Click "Load Command Data" on the simulator window. The example command list in $SIMHOME/communication/command.data will be loaded in the window. On , initialize command transfer function with, akiyama@fmos1$ cmdinit DAQtkCmdInit() return 0 "-1" reply from a DAQtk function in the sample program means there is a problem, you have to check the configurations, "0" is fine. Start command sending function with, akiyama@fmos1$ cmdsnd In another terminal start command receiving function with, akiyama@fmos1$ cmdrcv In simulator window on , select one command by clicking a line and send the command by clicking "Transmit Command Data". Confirm "cmdrcv" receives the command, and that there is no error message in simulator window on . Finish "cmdsnd" and "cmdrcv" with ctr+C, and execute exit program with, akiyama@fmos1$ cmdexit 3.2 Sending instrument status from to At first, start "OBS Status Monitor" on daq simulator. Initiarize status transfer function with, akiyama@fmos1$ statinit Start status transfer function with, akiyama@fmos1$ statsnd An example status information is in "statwrite.c" (STAT), and the information will be written in "$DAQTKHOME/sample/data/STAT.FIFO" with, akiyama@fmos1$ statwrite The information will be send to OBS status monitor by "statsnd". Finish status transfer function with akiyama@fmos1$ statexit 3.3 Receiving telescope status from to At first, start "OBS Status Distribution Service Simulator" on daq simulator window on . Load sample status list by clicking Load Reply Status Data. The sample status is available from "$SIMHOME/communication/status.data" Initialize status acquisition function with, akiyama@fmos1$ getinit Start status information receiver with, akiyama@fmos1$ getrcv In another terminal, start request sender with akiyama@fmos1$ getsnd In another terminal, write request to FIFO with akiyama@fmos1$ getwrite Confirm the getrcv function receive the status data send by the simulator. Exit the status acquisition function with, akiyama@fmos1$ getexit 3.4 Make sample FITS image on Make sample FITS image with, akiyama@fmos1$ testfits 0 0 0 The header information in "$DAKTKHOME/sample/src/makefits/prime.txt" "$DAKTKHOME/sample/src/makefits/WcsComment.txt" are used. The status values are in "testfits.c". The sample FITS image will be written in "$DAKTKHOME/sample/fits/result.fits" (FITSNAME in testfits.c) !! NOTE !! Confirm the values in the fits image. Display the fits image with ds9, skycat, etc. The values in the image should be 10020. Move the sample image to a directory where the next command will access. akiyama@fmos1$ mv ../fits/result.fits ../data/sample.fits 3.5 Sending the sample FITS image from to Start "OBC simulator" on daq simulator on . Initiarize FITS transfer function with, akiyama@fmos1$ datinit Start request sending function with akiyama@fmos1$ datsnd In another terminal, send transfer request with, akiyama@fmos1$ datwrite O18A 1 1 The ftp client running on will get the data file from ../sample/data/sample.fits (PATH parameter in datwrite.c). Data can be send thorugh RPC in memory with akiyama@fmos1$ datsndmem 0 0 0 0 O18A00000009 Confirm the values in the transfered FITS file as 10020 in ds9, skycat, etc. Stop FITS transfer function with akiyama@fmos1$ datexit 3.6 Check FITS Header Keywords You can use "DAQtkStarsCheck" command to check FITS header. 3.7 Other examples There are some utility functions available for coordinate, date, etc calculations. For usage, please refer sample programs, test-dec test-eq test-lst test-macro test-pix test-ra test-time test-utc