Visualisation de champs de vecteurs et scalaires 2D
Incluant :
- La technique de Line Integral Convolution (LIC) sur les données.
- Des flèches curvilignes suivant les lignes de champs.
- Mode mixte: champs de scalaire avec en surimpression le champs de vecteurs.
- Les données manquantes sont gérées et n'interfèrent pas avec les lignes de champs.
- Génération de fichiers au format Scalable Vector Graphics (SVG), qui sont facilement éditable et convertibles tout en préservant la meilleure qualité possible pour une inclusion dans un article scientifique en PDF.
- La palette de couleurs est conçue pour que les lignes de champs soient uniformément lisibles même imprimées en dégradés de gris.
Téléchargement
Vsfplot version 1.1 est téléchargeable aux formats tar.gz et zip.
Les deux archives contiennent la même chose, incluant :
- Le code source.
- Un binaire linux/64 bits (statique, pas de dépendences externes).
- Un exécutable windows 32 bits vsfplot.exe (également statique / pas besoin de DLLs).
La plateforme Linux/64 bits est la référence, depuis laquelle j’ai cross-compilé l’exécutable windows pour ceux qui utilisent ce système. Vsfplot est un logiciel libre, license LGPL v2.1 ou plus récente.
Usage
« vsfplot data.txt test » produit deux fichiers : « test.svg » and « test_legend.svg », dont des exemples sont affichés ci-dessus.
# Les commentaires commençant par # sont ignorés, ainsi que les lignes vides # Les colonnes sont par défaut spécifiées dans cet ordre : x y vecteur_x vecteur_y scalaire # Les valeurs x et y doivent être placées sur une grille régulière, possiblement avec des trous 0.05 0.25 0.0219881 0.0189318 0.953802 0.05 0.35 0.023919 0.0166145 1.04089 0.05 0.45 0.0241417 0.0153331 1.04686 ...
You pouvez spécifier les colonnes à utiliser et leur ordre, ce qui est particulièrement utile dans le cas de fichiers avec de nombreuses colonnes. Vsfplot peut également afficher des cartes de valeurs (x, y, valeur), ou un mode mixte ou un champs de vecteur est affiché sur la carte des valeurs scalaires (x, y, vx, vy, valeur). Dans le mode 4 colonnes (x, y, vx, vy) les normes des vecteurs sont utilisées comme valeur scalaire. Cf l’aide ci-dessous.
Les fichiers résulats sont produits au format Scalable Vector Graphics (SVG). Vous pouvez facilement les convertir en format bitmap (PNG, JPEG...), vectoriel (PS, PDF...), les éditer (dont extraire l’image générée et changer les flèches, etc.) en utilisant l’excellent logiciel libre Inkscape. Les formats vectoriels sont particulièrement utiles pour produire des articles scientifiques PDF de qualité.
vsfplot [--options args ...] data_file output_base_name
Options can be specified in any order:
-d [ --data ] arg The data file, which can also be specified as the
first free parameter on the command line (no need
for the --data option). This is a simple ascii
multi-column file, see --using. Use the special
name - for stdin.
-o [ --output ] arg The output files base name, which can also be
specified as the second free parameter on the
command line (no need for the --output option). Two
SVG files are generated, one is base_name.svg for
the generated color map / vector field, and the
other is base_name_legend.svg for the associated
legend. The size of the generated image is set to
the number of distinct X and Y values. If this does
not suit your needs you may easily rescale the SVG
file in a SVG editor (tip: try Inkscape), or use
the zoom factor (see below). If this is not enough
you'll have to resample your data file before
passing it to this program.
-u [ --using ] arg Specify which columns to use for plotting, default
is 1:2:3 for a 3-column file, 1:2:3:4 for a
fourth-column file, and 1:2:3:4:5 otherwise. The
first value indicate which column holds the X
coordinates, the second value the Y coordinates.
The program assumes the X and Y data are regularly
spaced, possibly with missing values. If only three
values are specified a scalar color map is built.
If 4 values are specified a vector field is built
using the third and fourth values as the vector
coordinates at each X,Y position, and the color is
set according to the vector norm. If a fifth value
is given then it is used for building a scalar
color map, while fields 3 and 4 are still used as
vector coordinates for plotting the arrows on top
of that map.
-x [ --xrange ] arg The range of the X values, specified as min:max.
The default is to use the min and max in the file.
Data values outside this range are ignored.
-y [ --yrange ] arg The range of the Y values, specified as min:max.
The default is to use the min and max in the file.
Data values outside this range are ignored.
-r [ --scalar_range ] arg The range of the scalar data, specified as min:max.
The default is to use the min and max in the file,
but you can specify a different range, for example
to have comparable colors across different figures.
Values outside the range are clamped to the
min/max.
-a [ --arrows_range ] arg The range of the arrow lengths for the vector data,
specified as min:max. The default is to set the
arrow of a median normed vector to half the grid
size. Here min and max specify the norm below which
no arrow is displayed, and the norm above which the
arrow is clamped to the grid size, with the average
set to half the grid size. This option is mainly
useful to have comparable arrow lengths across
different figures
-b [ --boundary_values ] There is one pixel per value, regularly spaced.
Default is to set each value at a pixel center. If
this option is set, the data min and max correspond
to the left/low boundaries of the first and last
pixels.
-z [ --zoom ] arg If set, each value in the data file is duplicated
that many times along the X and Y directions. This
effectively enlarges pixels. Only integer values
are allowed, no interpolation is performed, see
--output above.
-c [ --config ] arg If specified, add all parameters from this
configuration file in addition to the command-line
arguments. The file syntax is one option=value per
line, # are comments and blank lines are ignored.
In case of duplicated values, the command-line
arguments take precedence.
-s [ --silent ] Do not display warning messages.
-h [ --help ] Display this help
.



