*********SUMMARY********* All the visuzalition tool functions/programms are under the directory "euro3d", on the I/O library structure. You need to define the following environmental variables: setenv PGPLOT_DIR /work2/ssa/pgplot/; setenv PGPLOT_DEV /xwin setenv IFU_PATH "/work2/ssa/code/lyon"; setenv IFU_DEFAULT_FMT "Euro3D"; My experience is that the I/O library only works correctly under a TCSHELL under linux (ask Arlette or do more tests!). The functions included in the Euro3D.c file contain three different types of functions: (1) I/O functions, (2) SHM functions and (3) Plotting functions. (1) The I/O functions interact directly with the I/O library, and save in the "normal" memory the results. They are usedd normally by the SERVER (TBD). (2) SHM functions, compromise two different functions, (a) the SERVER, which basically starts the SHM and wait for a FLAG to do something (see flags codes down, and server function on Euro3D.c), and (b) the CLIENT functions, that send different signals to the SERVER asking it to load certain information in the SHM or to load a new file. (still to implement the ask for SAVE a function). I have tested different methods to interact with the SERVER, and I consider that the faster way is toask for the basic information when start (see tk_e3c.c code as an example, in the "ask_load" command). The CLIENT functions include all the functions starting with "ask_". The flag coding could be easily traced to beused by external functions. There is still a lack of exchange of results from external coded applications. I will work on that whenever I have an example. (3) The plotting routines. Based on PGPLOT, are used to open devices, close them, plot images, plot staked spectra or change the colormap and palette variables (bright, contrast, etc). The Euro3D.c functions can be used from any kind of C-coded or Transform to single programs or Python/Perl or IDL modules (This has to be tested by someone else!). It is easy also to mirror this functions interact with the server, and read from the SHM using script languages. I have tested with PERL, asking for loading a file and plotting the staked spectra image using PGPERL. No problem. Finally, I have created a tcl/Tk interpreter, under "tk_e3d.c". This interpreter creates basic Tcl commands that mirror some of the Euro3D functions. This allow us to create a Tcl/Tk script for the widget enviroment, and/or create your own Tcl script to interact with an image. You can run it under "exec/tk_e3d tk_e3d.tcl", under t the "euro3d" directory. This is the basic development. Please, play a bit with the mouse buttons, I had no time to write a help or to debug it, so you will find a couple of bugs (surely!). Play with the different entries to test it! As an example of the own coded scripting capabilities, you can run "exec/tk_e3d log.tcl", or you can follow "log.tcl" as a basic cookbook (sic!) and write you own code. There is a lot of thing to do. I am actually working on the interpolation to create a MAP for the monochromatic cuts, and I have added some basic arithmetic (substract, divide, etc), but they are on my laptop (sorry!). ***** To Be continued! ***** ******************OLD**************************************** Old documentation. brief working notes, I will clean them latter. The important is the KEY send to the flag in the SHM. They are still valid. #################################################################### # PROGRAMS #################################################################### protoEuro3D Monolitic prototype of the Euro3D visualization tool. proto_mem Monolitic prototype of the Euro3D visualization tool. Save in a SHM a protype. basic Euro3D structure in SHM key=1 staked Spectra image in SHM key=2 QUALITY ? NOISE ? n_spaxels in SHM key=5 spaxels in SHM key=6 index_start in SHM key=7 npts in SHM key=8 GROUPS ?? read_staked Read from the SHM: Basic Euro3D structure, Staked Spectra image, n_spaxels, spaxels. Plot it! GROUPS?? shm_server This program reads an Euro3D file and store it on his memory. Then it starts a FLAG on the SHM and start a loop reading it until it recives a command from another program. It stores in the SHM the references of the Euro3D (N_SPEC, N_GROUPS, N_SPAXELS, SPAXELS, GROUPS, etc), but not the RAW_DATA. FLAGS (SHM key=3) COMMAD ------------------------------------ 1 Serve a spectrum flag[2]=SpecId 2 Serve a group of spectra flag[2]=Initial SpecId flag[3]=Final SpecId 3 Load a new Euro3D image 4 Clean the SHM 5 Serve an Slice 6 Serve a group of Slices 7 ask for an intensity 666 Ask for the server if it is alive. The server answer with a 999 answer. IMPLEMENTED FUNCTIONS ------------------------------------ ask_delete_shm() Ask the server to clean the SHM. ask_load_e3d(filename) Ask the server to load an E3D image. ask_e3d_info(&e3d_image,&n_spaxels,&spaxels,&index_start,&npts,&groups); Ask the server for all the E3D basic parameters that are stored by the server in the SHM space. ask_raw_data(&raw_data,nb_spec,npix,delta_n); Ask the server for the staked spectra in pices of 'delta_n' spectra each time. 'delta_n'=256 would be a maximun for the SHM limit in major number of computers. ask_spectrum(&raw_spec,specId,npts,index_start); Ask to the server to provide an spectra corresponding to the spaxel 'specId', with 'npts' points, and with a start index of 'index_start'. ask_slice(&raw_spax_int,nb_spec,wavelength_index); Ask to the server to provide an SLICE monochromatic CUT. where nb_spec is the number of spectra (total number) and 'wavelength_index' is the index that defines the wavelength: i+index_start (by the new definition). shm_client This program reads the basic references from the SHM, served by SHM_SERVER. This program ask for the RAW_DATA to the SERVER writing a flag on the SHM that activates SHM_SERVER. This process is done Spectra to Spectra. It takes 115 seconds for a PMAS-like image. It needs to be improved! SHM = Shared Memory Space. ********************************************** To remove a SHM: shmctl(shmID, IPC_RMID, (struct shmid_ds *) 0) shmctl(shmid, IPC_RMID, 0); //destroy it.