| trename granular2pdf to granular2img and add options - granular - granular dyna… | |
| git clone git://src.adamsgaard.dk/granular | |
| Log | |
| Files | |
| Refs | |
| README | |
| LICENSE | |
| --- | |
| commit 0f0410502efc06bc13ea71e1bfe0a3ac2ee32688 | |
| parent 5899b209713d5b7860fdd7814c78b9645f731885 | |
| Author: Anders Damsgaard <[email protected]> | |
| Date: Thu, 22 Apr 2021 21:02:07 +0200 | |
| rename granular2pdf to granular2img and add options | |
| Diffstat: | |
| M Makefile | 2 +- | |
| M granular.1 | 2 +- | |
| A granular2img | 31 +++++++++++++++++++++++++++++… | |
| A granular2img.1 | 59 +++++++++++++++++++++++++++++… | |
| D granular2pdf | 9 --------- | |
| D granular2pdf.1 | 36 -----------------------------… | |
| M granular2vtu.1 | 2 +- | |
| M granularpacking.1 | 2 +- | |
| 8 files changed, 94 insertions(+), 49 deletions(-) | |
| --- | |
| diff --git a/Makefile b/Makefile | |
| t@@ -14,7 +14,7 @@ BIN = \ | |
| granulargrain\ | |
| granularpacking | |
| SCRIPTS = \ | |
| - granular2pdf | |
| + granular2img | |
| SRC = \ | |
| arrays.c\ | |
| diff --git a/granular.1 b/granular.1 | |
| t@@ -61,7 +61,7 @@ error | |
| .Sh EXAMPLES | |
| .Dl $ granularpacking | granular | granular2vtk > out.vtk | |
| .Sh SEE ALSO | |
| -.Xr granular2pdf 1 , | |
| +.Xr granular2img 1 , | |
| .Xr granular2vtu 1 , | |
| .Xr granularpacking 1 , | |
| .Xr granular 5 | |
| diff --git a/granular2img b/granular2img | |
| t@@ -0,0 +1,31 @@ | |
| +#!/bin/sh | |
| + | |
| +usage() { | |
| + printf 'usage: %s [-f field] [-h] [-l label] [-t term]\n' "${0##*/}" 1… | |
| +} | |
| + | |
| +field="1" | |
| +label="diameter [m]" | |
| +term="pdf" | |
| +while getopts 'f:hl:t:' arg; do | |
| + case "${arg}" in | |
| + f) field="${OPTARG}" ;; | |
| + h) usage; exit 0 ;; | |
| + l) label="${OPTARG}" ;; | |
| + t) term="${OPTARG}" ;; | |
| + *) usage; exit 1 ;; | |
| + esac | |
| +done | |
| +shift $((OPTIND - 1)) | |
| +if test $# != 0; then | |
| + usage | |
| + exit 1 | |
| +fi | |
| + | |
| +awk -F' ' "{print \$2, \$3, \$1 / 2.0, \$${field}}" \ | |
| + | gnuplot -e "set term ${term};\ | |
| + set xlabel 'x [m]';\ | |
| + set ylabel 'y [m]';\ | |
| + set cblabel '${label}';\ | |
| + set size ratio -1;\ | |
| + plot '-' with circles fill solid fillcolor p… | |
| diff --git a/granular2img.1 b/granular2img.1 | |
| t@@ -0,0 +1,59 @@ | |
| +.Dd $Mdocdate$ | |
| +.Dt GRANULAR2IMG 1 | |
| +.Os | |
| +.Sh NAME | |
| +.Nm granular2img | |
| +.Nd render granular data as image | |
| +.Sh SYNOPSIS | |
| +.Nm | |
| +.Op Fl f Ar field | |
| +.Op Fl h | |
| +.Op Fl l Ar label | |
| +.Op Fl t Ar term | |
| +.Sh DESCRIPTION | |
| +The | |
| +.Nm | |
| +utility reads | |
| +.Xr granular 5 | |
| +formatted data and plots grains as an image file, e.g. pdf (default), | |
| +written to stdout. | |
| +.Pp | |
| +The options are as follows: | |
| +.Bl -tag -width Ds | |
| +.It Fl f Ar field | |
| +Specify the column number to use for grain coloring (default: 1 | |
| +(diameter)). | |
| +.It Fl h | |
| +Show help text. | |
| +.It Fl l Ar label | |
| +Set the label text for the color bar (default: 'diameter [m]'). | |
| +.It Fl t Ar term | |
| +Specify the | |
| +.Xr gnuplot 1 | |
| +output terminal type, for example pdf (default), png, or dumb. | |
| +Use the command "help term" in gnuplot | |
| +.Xr gnuplot 1 | |
| +to see the available terminals. | |
| +.El | |
| +.Sh EXIT STATUS | |
| +.Nm | |
| +exits 0 on success, and >0 if a runtime error occurs: | |
| +.Pp | |
| +.Bl -tag -width Ds -compact | |
| +.It 0 | |
| +successful exit | |
| +.It 1 | |
| +unspecified error | |
| +.El | |
| +.Sh EXAMPLES | |
| +.Dl $ granularpacking | granular2img -t png > out.png | |
| +.Pp | |
| +.Dl $ granularpacking | granular2img -f 2 -l 'x position [m]' | zathura - | |
| +.Pp | |
| +.Dl $ granular2img < packing.tsv > out.pdf | |
| +.Sh SEE ALSO | |
| +.Xr gnuplot 1 , | |
| +.Xr granular2vtu 1 , | |
| +.Xr granular 5 | |
| +.Sh AUTHORS | |
| +.An Anders Damsgaard Aq Mt [email protected] | |
| diff --git a/granular2pdf b/granular2pdf | |
| t@@ -1,9 +0,0 @@ | |
| -#!/bin/sh | |
| - | |
| -awk -F' ' '{print $2, $3, $1 / 2.0, $1}' \ | |
| - | gnuplot -e "set term pdf;\ | |
| - set xlabel 'x [m]';\ | |
| - set ylabel 'y [m]';\ | |
| - set cblabel 'diameter [m]';\ | |
| - set size ratio -1;\ | |
| - plot '-' with circles fill solid fillcolor p… | |
| diff --git a/granular2pdf.1 b/granular2pdf.1 | |
| t@@ -1,36 +0,0 @@ | |
| -.Dd $Mdocdate$ | |
| -.Dt GRANULAR2PDF 1 | |
| -.Os | |
| -.Sh NAME | |
| -.Nm granular2pdf | |
| -.Nd render granular data as PDF plot | |
| -.Sh SYNOPSIS | |
| -.Nm | |
| -.Sh DESCRIPTION | |
| -The | |
| -.Nm | |
| -utility reads | |
| -.Xr granular 5 | |
| -formatted data and plots grains as a PDF file, written to stdout. | |
| -.Sh EXIT STATUS | |
| -.Nm | |
| -exits 0 on success, and >0 if a runtime error occurs: | |
| -.Pp | |
| -.Bl -tag -width Ds -compact | |
| -.It 0 | |
| -successful exit | |
| -.It 1 | |
| -unspecified error | |
| -.El | |
| -.Sh EXAMPLES | |
| -.Dl $ granularpacking | granular2pdf > out.pdf | |
| -.Pp | |
| -.Dl $ granularpacking | granular2pdf | zathura - | |
| -.Pp | |
| -.Dl $ granular2pdf < packing.tsv > out.pdf | |
| -.Sh SEE ALSO | |
| -.Xr gnuplot 1 , | |
| -.Xr granular2vtu 1 , | |
| -.Xr granular 5 | |
| -.Sh AUTHORS | |
| -.An Anders Damsgaard Aq Mt [email protected] | |
| diff --git a/granular2vtu.1 b/granular2vtu.1 | |
| t@@ -31,7 +31,7 @@ error | |
| .Pp | |
| .Dl $ granular2vtu < packing.tsv > out.vtu | |
| .Sh SEE ALSO | |
| -.Xr granular2pdf 1 , | |
| +.Xr granular2img 1 , | |
| .Xr granular 5 | |
| .Sh AUTHORS | |
| .An Anders Damsgaard Aq Mt [email protected] | |
| diff --git a/granularpacking.1 b/granularpacking.1 | |
| t@@ -77,7 +77,7 @@ error | |
| .Sh EXAMPLES | |
| .Dl $ granularpacking | granular2vtk > out.vtk | |
| .Sh SEE ALSO | |
| -.Xr granular2pdf 1 , | |
| +.Xr granular2img 1 , | |
| .Xr granular2vtu 1 , | |
| .Xr granulargrain 1 , | |
| .Xr granular 5 |