Hits since 2023-09-25 10:59:29:
997

Rosevear Software



Script gogeeq:

Here is a script that I wrote and use in SAM

Here is a script that I wrote and use in SAM, although it is not a part of the SAM distribution.  I put it here for your benefit:

  • #!/bin/sh
    
    # /mnt/joe_root/lib/joresorc/joprivat/other/tools/plotting/gogeeq
    # Copyright (C) 2025 Joseph Rosevear, San Diego CA, USA.
    
    # This program is offered freely on RosevearSoftware.com for personal use
    # or incorporation into your own tools.
    
    # It is not part of an official distribution, but is provided as a
    # useful example program by Joseph Rosevear.
    
    # This program is free software; you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation; either version 3 of the License, or (at
    # your option) any later version.
    
    # This program is distributed in the hope that it will be useful, but
    # WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    # General Public License for more details.
    
    # You should have received a copy of the GNU General Public License
    # along with this program.  If not, see .
    
    
    
    # Joseph Rosevear 220313 I made this script (gogeeqie) by copying it
    # from go_xv.
    
    # Joseph Rosevear 220313 I changed the code to:
    
    #    -store the temporary files in /tmp
    #    -use geeqie instead of xv
    #    -use $plot instead of plot
    #    -use $data instead of data.txt
    #    -don't do "cd $level"
    #    -use $lines (which now comes from $3) instead of $1.
    
    # Joseph Rosevear 220321 I changed to code to be compatible with an
    # instruction file that makes a .svg file instead of a .eps file.
    
    # Joseph Rosevear 220713 I changed the name of this script from
    # gogeeqie to gogeeq.
    
    # Joseph Rosevear 240621 I added a line which removes any existing
    # /tmp/file.svg before attempting to create it.
    
    # Joseph Rosevear 240903 I removed variable lines: definition and use.
    
    # Joseph Rosevear 250516 10:23AM I changed some comments.
    
    # I added "$lib/tool_joe/imaj" and logic that invokes cacasee instead
    # of geeqie when DISPLAY is "".
    
    
    
    # Add "bound $lib/tool_joe/imaj".
    bound $level $lib/tool_joe/imaj
    
    # Definitions.
    data="$1"
    plot="$2"
    
    # Remove any existing file.svg.
    if [ -a /tmp/file.svg ]; then
    
       rm /tmp/file.svg
    fi
    
    # Make file.svg (as defined in instruction file).
    cat $data | gnuplot $plot
    
    # Plot file.svg using geeqie or cacasee depending on value of $DISPLAY.
    if [ "$DISPLAY" != "" ]; then
    
       geeqie /tmp/file.svg
       
    else
    
       cacasee /tmp/file.svg
    fi

If you want to use this script, you'll have to make some changes.  The script uses skip which I haven't provided.  Tool skip skips $1 lines and allows the user to skip over an arbitrary number of initial data points.  Perhaps you can write your own tool or code snippet?

This bit of code might work to replace skip, if you first export lines:

  • tac /dev/stdin | head -n -$lines | tac
© Joseph Rosevear
  |   Source touched: 2025-12-17 01:45:52