Program: SLICEVIEW #begin section overview OVERVIEW ======== Movie window ------------ Introduction: This program is an inspection tool for data cubes. Usually these cubes are a set of two dimensional images and the third axis is a spectral type. It has a movie loop facility for a sequence of subsets with control buttons in the main window. Using the frame slider you can quickly browse through your subsets. A [COLOR] button pops up a colour editor. This editor allows you to adjust the colours and to select another colour table. Changing colours is also possible with the mouse cursor on the image display while pressing the left button. Colours are divided over a range of pixel values entered in the CLIP input field in the main gui. If the value in this field is not fixed by the [FIX] button, it will be updated by the program with a default. Smooth images: You can smooth the images by pressing the [INTP] button. This button sets the image interpolation mode for a selected plot device. All images plotted after pressing this button will be interpolated. Hardcopy options: The images are annotated with axis labels for grids and physical coordinates. A hardcopy of a selected image (also called frame) is made by selecting the 'save plot' option from the 'FILE' menu. A new window allows you to enter a plot device and the name of the PostScript output. It is also possible to setup an input file for GPLOT. It creates code to reproduce a selected image. Recording of images: Using the [REC:] button it is possible to record a sequence of frames in an MPEG movie. See section 'MPEG movie' for details. Zooming: In all display modes one can zoom/dezoom an image or move an image (panning) using keyboard keys. See section about mouse and keyboard. Windows resize: The sizes of the windows in your Graphical User Interface cannot be changed while the program is running. You have to restart the program with keywords that alter the window sizes. See section 'keywords' to look how these keywords are called. Slice modes ----------- Images of slices through a data cube are a powerful inspection tool. This program has three modes each corresponding to a special type of slice. Standard is the line type. Samples at equidistant intervals are taken along a line which has a certain length and an angle with respect to the +Y axis (i.e. to the north in a spatial system). The subset values along the sample are stored and extracting is repeated for the remaining subsets. This set of data points is displayed as an image with the sample offsets as X axis and with the physical coordinates of the 'subset repeat' axis as Y axis (usually velocity, hence the name XV image). A second sample line can be activated. This line has a constant offset in angle with respect to the first line. The length and angle of the primary line can be controlled by mouse or control panel in the slice window. The slice width can be changed also. This uneven width in grids averages a number of profiles in the same direction. Blank image values are not taken into account. Second slice type is an ellipse or ellipse segment. The sample extraction starts at the endpoint of the major axis and runs counter clockwise in the direction of the minor axis. Third type is a sample extracted along a spline. The spline is created by entering control points with your mouse. The program creates a smooth curve through these points and tries to find sample points between control points at equal distances. So sample points always coincide with control points. This is also the mode that you need if you have your own sample positions and want to create an XV map with these points. All the slice windows include a line graph. This graph is an intensity plot of the samples along the slice for the current subset. The X axis is the same as the X axis of the XV image. Markers ------- With key 'M' you put a marker in both your subset image and the XV map. The marker in the subset is a symbol of your own choice. The marker in your XV map is a vertical line in a corresponding colour. Pressing 'M' at an already marked position will remove the marker. Markers are positioned onto a slice line, ellipse or spline curve. Z-profiles ---------- If we call the subset axes the X and Y direction of the data cube, then the third axis is called the Z axis. At each position X,Y you can view the intensity along Z for each subset in a so called Z profile. You can move the mouse while pressing the Right mouse button and see how the Z profiles change with position. In the spline slice mode it is also possible to mark an area. The spline is closed then and the sum of the image values is calculated for each subset. Then a Z profile is plotted where the Y axis is no longer intensity but a sum of enclosed intensities. Each intensity is weighted by the enclosed pixel area so accurate fluxes can be derived. External sets ------------- An 'External set' pop up is activated from the FILE menu or by pressing the [EXT.SET] button. First select in which of the three external set frames you want to store the image. Then you select a moments option or enter the name of a set or DSS fits file. The DSS fits file will be converted to a GIPSY set. An external set is reprojected (using GIPSY task REPROJ) with the projection parameters copied from the main input set. The contour button in the main window allows you to enter contour levels and specify whether you want to overlay them on other frames or not. This is an easy way to compare e.g. optical and HI images. The 'load special set' pop-up shows for each external or moments set a clip input field. This clip must be given in units of the external set. For an empty field, the program tries to calculate a reasonable default and shows this default in the input field after it displayed the new set. Note that for frames with different clips and or units, the colour wedge changes accordingly. Hardcopies of external sets show also slice samples and markers. External sets made by the program (sets with moments data, sets from DSS files) are stored on disk and are NOT removed by the program so that you can use them outside SLICEVIEW. The names of these sets all start with prefix "sliceview_", e.g. 'sliceview_dssreproj' or 'sliceview_reproj_0'. #end section overview #begin section lines XV MAP FROM A SAMPLE LINE ========================= Along the plotted sample line in the main (or movie) window, samples are extracted for each subset. These are the line parameters: parameter changed by --------- ---------- Length left mouse or sample length slider. Angle left mouse or angle gauge. Center middle mouse button or position input field. positions in input field can be any valid GIPSY coordinate. Width Sample width input field Sample separation Sample separation input field A second sample can be viewed also. This sample has a constant offset in angle with respect to the first sample line. You can couple the lengths of the two lines and set a ratio with which the length of the second line is calculated from the first. A line graph shows the intensities along the sample line for the current subset. Default, the sample intensity is extracted from the nearest pixel. For a more realistic intensity you can interpolate intensities using a bilinear interpolation scheme for the 4 nearest pixels. Use the [DINPT] button to start bilinear interpolation. Output of sample positions and corresponding image values is possible. Select option 'Save sample' in the [FILE] menu of the slice gui. Note that the slice lines usually have different lengths. This will show in the Ascii file on disk. Empty values are marked with the a character. #end section lines #begin section ellipse XV MAP FROM A SAMPLE ELLIPSE ============================ Along the plotted sample ellipse in the main (or movie) window, samples are extracted for each subset. These are the ellipse parameters: parameter changed by --------- ---------- Major axis Left mouse, Major axis slider or input field. Minor axis Left mouse, Minor axis slider or input field. Center Middle mouse button or position input field. Positions in input field can be any valid GIPSY coordinate. Angle range Angle range input field. sample separation Sample separation input field. While changing the length of an ellipse axis with the mouse, the program will determine which of the minor and major axis is closest. Only this axis is changed in length. You can couple the lengths of major and minor axis and set a ratio with which the length of the minor axis is calculated from the length of the major axis A line graph shows the intensities along the sample ellipse for the current subset. Default, the sample intensity is extracted from the nearest pixel. For a more realistic intensity you can interpolate intensities using a bilinear interpolation scheme for the 4 nearest pixels. Use the [DINPT] button to start bilinear interpolation. You can give a width in grids. Then each sample intensity on the ellipse is an average of samples taken along a vector perpendicular to the tangent. Pressing 'F' will fill the area inside the ellipse. The sum of all the pixels inside is calculated by weighting the intensities by their area inside the ellipse. This process is repeated for all the subsets and a plot displays the sum as function of the subset (in grid coordinates). Besides a scale factor this plot shows the flux as function of subset (usually velocity). Output of sample positions and corresponding image values is possible. Select option 'Save sample' in the [FILE] menu of the slice gui. #end section ellipse #begin section spline XV MAP FROM A SAMPLE SPLINE =========================== Along the plotted sample spline in the main (or movie) window, samples are extracted for each subset. These are the spline parameters: parameter changed by --------- ---------- Sample separation Sample separation input field. New spline control point Left mouse button. Insert spline control point Keyboard 'i' or 'I'. Delete spline control point Keyboard 'd' or 'D'. Close spline curve Keyboard 'c' or 'C'. Clear curve Clear button Insertion of a point is done at the current cursor position. Deletion is an operation done on the nearest spline control point with respect to the current cursor position with a maximum distance of 10 grids. The maximum number of spline control points is 1000. A spline must be closed before a z-flux-profile can be plotted. A line graph shows the intensities along the sample spline for the current subset. Pressing 'F' will fill the area inside a closed spline. The sum of all the pixels inside is calculated by weighting the intensities by their area inside the spline area. This process is repeated for all the subsets and a plot displays the sum as function of the subset (in grid coordinates). Besides a scale factor this plot shows the flux as function of subset (usually velocity). Default, the sample intensity is extracted from the nearest pixel. For a more realistic intensity you can interpolate intensities using a bilinear interpolation scheme for the 4 nearest pixels. Use the [DINPT] button to start bilinear interpolation. You can give a width in grids. Then each sample intensity on the ellipse is an average of samples taken along a vector perpendicular to the tangent. How to enter your sample positions? With the [FILE] button you can select the option 'Read spline points'. Enter the name of the Ascii file on disk. Note that the format of this file is fixed, i.e. each line must contain a valid GIPSY position. Example contents of a file: 23.4 -12.3 Grids * 14 26 9 * -12 3 5.4 Hms, dms in epoch of header *2000 14 26 9 *2000 -12 3 5.4 Hms, dms in another epoch G 128.20 G 23.32323 Galactic longitude or latitude in deg. E 128.20 E 23.32323 Ecliptic longitude or latitude in deg. S 128.20 S 23.32323 Supergalactic longitude or lat. in deg. The menu in [FILE] has also an option to write the spline control points. This is done in a way that the file can be used as input file for control points, i.e. there is one position (in one of the formats from above) per line. Appended in comments is the same output but then with the corresponding (non interpolated) image value corresponding to the nearest integers of the given position. Also appended in comment lines, the physical values corresponding to the grid positions in units of the GDS/FITS header. The format of these positions is: U xxxx.xxx U yyyy.yyy These position can be used as marker positions for other sets, as long the sky systems are the same. One can edit the file to make it suitable as input for various tasks. #end section spline #begin section hardcopy HARDCOPY ======== There are two ways to get a hardcopy of what is displayed on screen. First there is a menu item under FILE called 'Save plot' that sends the current image to a PostScript file. You can enter a name of this PostScript file and have to select a plot device. Another way requires GPLOT. You can store the current colour information in the header of the current displayed image. In GPLOT you can use command 'getlut header' to read back the colour information before you use command 'colplot' to make a hardcopy of this set. Next example is a set of GPLOT commands to create hardcopies. device pcpsfile/a.ps inset dummy_zero_moment 0 box xsize 140 ysize 140 getlut header colplot frame close A third option is to save the current plot (only from the subset range, because the extra sets are in a way artificial). All relevant GPLOT commands are stored in a file on disk. Colour information is stored, contour information is stored and the interpolation mode is copied. Here is an example of a GPLOT input file generated by SLICEVIEW. ! Start GPLOT with COMMAND=input device lcpsfile inset rense VELO 21 xsize 100 ysize 100 box -50 -50 49 49 frame getlut header interpol on colplot interpol off levels 0.01:0.1:0.01 color 2 lwidth 2 lstyle 1 contours close #end section hardcopy #begin section mpeg MPEG MOVIES =========== This option allows you to record a movie in MPEG format. It requires GIPSY's Python binding to be installed and the utilities import (from ImageMagick) and ppmtompeg to be present. Steps: 1. in the text field next to the [REC:] button specify the name of the MPEG file in which the movie should be recorded. If omitted, the name 'sliceview.mpg' will be used. 2. position your movie at the frame position where recording should start. 3. press the [REC:] button. This will cause the task MPEG to be started. 4. make sure that no other windows are covering the movie window. 5. start the movie. From now on, every frame in the movie is recorded by the task MPEG. During this time SLICEVIEW's GUI is hardly responsive to user actions. 6. when the last frame of interest has been recorded, press the [STOP] button of the MPEG task. Then the MPEG movie will be constructed from the recorded frames and SLICEVIEW will resume normal operation. After this, a number of files will have been created in your working directory. Besides the resulting MPEG file there will be a file with a name like 'frame%%%%.ppm' for each recorded frame. And there will be a file 'mpeg.par' which is the ppmtompeg parameter file. These files can be modified and used to regenerate an MPEG movie with different parameters. Or they can be deleted. #end section mpeg #begin section howto HOWTO'S ======= How to start? ------------ From the FILE menu, read set/subsets using the file browser. Select a slice type from the SLICE menu. Use the mouse to change the sample curves in the main plot. What to do if you do not have enough display memory to view all your subsets? ----------------------------------------------------------------------------- Select less subsets in the 'Input set' window or decrease the size of the movie window. If you select the maximum number of available frames, then there is no storage anymore to view 'external' images. How do I make a hardcopy of a framed subset? -------------------------------------------- Select the 'Save plot' option from the 'File' menu. You will be asked to select a device and a PostScript file name. The PS file is always stored on disk. How do I make a movie in MPEG format? ------------------------------------- With the [REC:] button. But please read section 'MPEG movie' first. Can I use the GPLOT commands 'getlut' and 'storelut'? ---------------------------------------------------- These commands retrieved or stored the colour information of a displayed image in the header of the set. It connected to GIDS, so for SLICEVIEW you have to do something else. You can store colour information in a header with the FILE menu option 'save colors to set'. Then you can retrieve the colour settings in GPLOT with command 'getlut header'. How to fix a ratio between minor and major ellipse axes? -------------------------------------------------------- Enter a number or expression, e.g. cos(rad(40)) and push the 'couple' button. Moving the slider for the major axis results in a new value for the minor axis according to the new ratio. The slider for the minor axis is disabled while coupling is on. How to enter your own sample positions? --------------------------------------- Sample positions can be read from an Ascii file on disk. The format for these positions in the file is fixed, i.e. each line must contain a valid GIPSY position. Example contents of a file: 23.4 -12.3 Grids * 14 26 9 * -12 3 5.4 Hms, dms in epoch of header *2000 14 26 9 *2000 -12 3 5.4 Hms, dms in another epoch G 128.20 G 23.32323 Galactic longitude or latitude in deg. E 128.20 E 23.32323 Ecliptic longitude or latitude in deg. S 128.20 S 23.32323 Supergalactic longitude or lat. in deg. How can I select only the spline control points as sample positions? -------------------------------------------------------------------- If you want only your spline control points as sample position, then select a sample separation greater than the largest distance between two control points. How to get a less 'granulated' view of a XV map? ------------------------------------------------ Select both data interpolation (for non-integer sample positions) and display interpolation with the [DINTP] and [INTP] buttons. For a movie you have to reload your data. How can I improve the resolution of my optical overlay? ------------------------------------------------------- External sets are reprojected using the projection parameters from the input set with which you started to display data. If you need higher resolution overlay data then you have to regrid your input set with GIPSY tasks REPROJ or REGRID to a smaller grid separation. A faster but less accurate solution could be the use of interpolation using the [INTP] button in the main gui. An interpolated version of your external- or moments set will be displayed. Note that this will not apply to the plotting of contours. #end section howto #begin section keywords KEYWORDS ======== Only a limited number of keywords need to be remembered. Most of these are related to the sizes of the plot windows. These sizes must be specified before starting the application. Keyword Example Meaning ================================================================== XYWIDTH= 600 Main plot dimensions in screen pixels XYHEIGHT= 500 XVWIDTH= 400 Slice plot dimensions XVHEIGHT= 200 XIHEIGHT= 100 Line graph height ZWIDTH= 500 Z-profile plot dimensions ZHEIGHT= 200 CLIP= -0.003 0.012 Divide available colours over this range of pixel values. If you need to know which keyword is involved while generating an event (e.g. input of a set or a box or pressing a button), then start this program on the command line with keyword MONITOR=Y Your GIPSY log will show the events and the related keywords. #end section keywords #begin section limits PROGRAM LIMITS ============== -The maximum number of input subsets (channel maps) is 4096. -The maximum length of a file name is 256 -The maximum number of spline control points is 1000. -The maximum number of subsets to store in a movie is 256. #end section limits #begin section mouse MOUSE ACTIONS and KEYBOARD KEYS =============================== Mouse actions depend on the slice mode. A short description of the mouse actions is displayed in the status lines of the main window. ALL modes: +: zoom in at cursor position -: zoom out at cursor position 0: reset image to original size 9: move image from current mouse position to center of image arrow keys: pan image over short distance Right mouse button: Open window with Z profile. Drag mouse while pressing this button to inspect profiles at different positions. Shift left mouse: zoom in at cursor position Ctrl left mouse: zoom out at cursor position DISPLAY mode: Left mouse button: Change slope and shift in the colour function with the mouse. In fact this actions changes the setting of the colour editor. LINE mode: Left mouse button: Drag mouse to change length and angle of closest line Middle mouse button: Drag mouse to move center of line Right mouse button: Update window with z-profile M: Put a marker on the line. A corresponding marker line appears in the XV image. Unmark a position with the same key at the same position. E: Erase all markers. ELLIPSE mode: Left mouse button: Drag mouse to change length and angle of major axis Middle mouse button: Drag mouse to move center of ellipse Right mouse button: Update window with z-profile M: Put a marker on the perimeter of the ellipse. A corresponding marker line appears in the XV image. Unmark a position with the same key at the same position. E: Erase all markers. Z: Fill area enclosed by ellipse and calculate sum in area for each image. Result is an integrated Z-profile. SPLINE mode: Left mouse button: Add a spline control point Right mouse button: Update window with z-profile C: Close spline to get a closed area I: Insert a spline control point at mouse cursor position D: Delete nearest spline control point M: Mark/unmark a position on the spline. A corresponding marker line appears in the XV image. Unmark a position with the same key at the same position E: Erase all markers S: Erase spline and prepare for a new one. Z: Fill area enclosed by spline and calculate sum in area for each image. Result is an integrated Z-profile. #end section mouse #begin section defaults DEFAULTS ======== PostScript file name: sliceview.ps File name for sample positions: sliceview.dat Set name for output of XV images: sliceviewxvset Initial position angle line and ellipse: 45 deg. Initial sample line width: 1 Angle between sample lines: 90 Ellipse segment: 0 to 360 deg. Interpolation on plot device: NO Interpolation in XV data: NO Clip values: From header if available #end section defaults #begin section about Purpose: SLICEVIEW is an inspection tool for 2d and 3d data sets. It extracts and displays slices under any angle and (for 3-d sets) shows z-profiles/flux at any position. Category: ANALYSIS, DISPLAY, PLOTTING, PROFILES, ROTATION-CURVES, VELOCITY-FIELDS File: sliceview.src Author: M.G.R. Vogelaar (GUI: J.P. Terlouw) Keywords: See section keywords Version: 1.6 Updates: Feb 27, 2000: VOG, Document created. Sep 07, 2000: VOG. Version 1.2 in system Oct 13, 2000: VOG. Version 1.3 in system Jan 06, 2001: VOG, Changed spline sampling Apr 02, 2002: JPT, Changed movie controls availability. Dec 08, 2004: JPT, Implemented MPEG recording. Apr 20, 2008: VOG, Added image values to slice linegraph output to file. Apr 12, 2009: VOG, Changed NINT macro to definition that uses floor() for compatibility with basic routines dealing with coordinates. #end section about