Program: PYBLOT #begin section overview OVERVIEW ======== PYBLOT is a program to transfer data to an output set under certain conditions set by one or more blotch regions. It is a follow-up of the GIPSY program BLOT which runs only in 8-bit pseudo color mode. The program was written in Python as a first excercise in writing a complete interactive graphical application. PYBLOT is applied in those cases where a filter based on an algorithm (CLIP, CONDIT, OBJECTS) is not suitable. Filtering individual pixels can be done with the GIPSY application EDITSET. The blotch areas are defined by polygons, splines, ellipses or rectangles or any combination of them. The definitions of the shapes can be stored in the header of the input set. This allows for multiple blot sessions. The definitions are stored on subset level. To start PYBLOT on a TrueColor display, type on the Hermes command line: pyblot ggiopt=fixcol If you omit the ggiopt= keyword, then you may start the application in direct color which may cause color flashing between windows. The size of the canvas can be altered at startup with keywords WIDTH= and HEIGHT= (See section 'keywords'). #end section overview #begin section keywords KEYWORDS ======== WIDTH= Call this keyword when you want to open PYBLOT with a different width. This value will affect the entire windowwidth, but mainly the plotwindow will grow/shrink. HEIGHT= Call this keyword when you want to open PYBLOT with a different height.This value will affect the entire windowheigth, but mainly the plotwindow will grow/shrink. #end section keywords #begin section userinterface USER INTERFACE ============== Menu: ----- FILE: Load set/subsets. EDIT: Write/delete shape data to header of input set; apply shapes to output set. INTP: Set display to bilinear interpolation, just for viewing. CLIP:change the color look-up Set ranges for the colour map. Default the values are read from the header of the input set at top level. If they are not present, these values will be calculated which may be more time-consuming. Run program MNMX on set level to set the values DATAMIN and DATAMAX in the header. FIX: Fix these clip values so that new data will not result in recalculating the default clip values. ASP: If you are not interested in square pixels but want to use the maximum area on the canvas, then press this toggle. LBL: Pressing this button causes axis labelling to be suppressed so that the image will be as large as possible. SHAPE: Select the type of shape to be created next: Spline, Polygon, Rectangle or Ellipse. Instead of this menu it is also possible to use the keyboard letters S, P, R or E. MODE: The display mode: 'Image+Shapes', 'Result Image' or 'Mask'. HATCH: Each shape, except an ellipse, is hatched. This slider sets the distance between hatch lines to create visual effects of opacity. If you want the shapes to disappear, press the 'HIDE' button which toggles between hiding and showing the shapes. Plot window: ----------- The plot window shows your current (sub)set, a frame with grid labels and shapes from previous sessions, if any. In the plot window you can draw and edit your blotting shapes. See section 'Keyboard and Mouse'. Color wedge: ------------ Displays the current ranges of displayed values and their units and allows to change the color map. Controls frame 1: ----------------- This frame contains controls for choosing of and stepping through the specified subsets, for choosing whether data inside or outside the mask is transferred to the output set, for choosing whether newly created shapes will be added to or subtracted from the mask. It also contains an input field in which the output set can be specified. Controls frame 2: ----------------- This frame contains buttons for hiding the shapes, applying the current subset's mask to the output set, for saving this subset's shapes and finally a button for setting the auto-save mode. #end section userinterface #begin section keyboard KEYBOARD and MOUSE ================== NOTICE: keyboard shortcuts currently only work when the keyboard focus is explicitly moved to the plot window by clicking in it. Abbreviations: LMB: left mouse button, MMB middle m. b., RMB: right m. b. Shapes: ------- S - create a new spline P - create a new polygon LMB - add point to spline or polygon MMB - insert point between points of spline or polygon R - create a new rectangle E - create a new ellipse LMB - dragging defines the rectangle or the ellipse outline RMB - dragging allows to move any shape's point or its center D - delete the last point from a spline or polygon M - switch the add/subtract mode for the selected shape H - hides/unhides all shapes TAB - step through the shapes to select one CTRL-C - copy a shape to the buffer CTRL-V - paste a shape from the buffer CTRL-X DEL - delete a shape and save it in the buffer CTRL-LMB - select shape Image: ------ + - zoom in at mouse position - - zoom out 0 - reset zoom 9 - center on cursor position SHIFT-LMB - draw zooming area rectangle Subsets: -------- The left- and right arrow keys can be used to step through the subsets. #end section keyboard #begin section howto HOWTO'S ======= How to start the program? ----------------------------------------------- See the Overview How to blot a ring? ------------------- Create the outer contour and make sure its mode is 'ADD' (the default). Then draw the inner shape and set its mode to 'SUB'. This can be done by selecting it and pressing 'M' on the keyboard. Alternatively the shape mode can be set with the ADD/SUB button before creating the shape. How to save your results? ------------------------- Shapes can be saved by pressing the SAVE button, by choosing an appropriate option from the EDIT menu, or using the saving pop-up at program exit (not recommended). The resulting masks can be applied to the output set with the APPLY button or with an option from the EDIT menu. If an existing output set is used, its shape should be compatible with the input set. If it does not exist, PYBLOT will create a copy of the input set. #end section howto #begin section about Purpose: Conditional transfer of maps using blotch region. Category: ANALYSIS, DISPLAY File: pyblot.src Author: J.P. Terlouw Keywords: See section keywords Acknowledgements: This program is a complete rewrite of XBLOT developed by Ronnie Waijer, a Hanzehogeschool 'stagiair', under the supervision of Martin Vogelaar. The availablity of XBLOT was very useful in developing PYBLOT. Version: 1.0 Updates: Oct 18, 2004: JPT, Document created. Mar 9, 2005: JPT, Set copy bug fixed. Sep 22, 2005: JPT, explicit path /Software eliminated. Jul 12, 2007: JPT, changed for new Python module gipsy. May 27, 2008: JPT, changed for modified header access. Apr 15, 2009: VOG, Changed definition of function nint() so that it is compatible with coordinate routines in the system. Apr 29, 2009: JPT, Fixed syntax error introduced by previous change. Oct 3, 2013: JPT, Corrected behaviour for maps with no mask defined. #end section about