Description Usage Arguments Value Author(s) Examples
Produces a raster image visualising particle positions in 3D N-body/SPH data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | sphview(
x,
species = NULL,
value = NULL,
valrange = NULL,
fix.brightness = TRUE,
weight = NULL,
colspecies = c("#ff0010", "#0515ff", "green", "orange", "yellow", "purple"),
colscale = cooltools::spectrumcolors(1000),
center = NULL,
width = NULL,
aspect = 1,
thickness = NULL,
subsampling = 1,
screen = TRUE,
pngfile = NULL,
pdffile = NULL,
rotation = 1,
ngrid = 300,
title = NULL,
title.origin = NULL,
lum = 1,
shadows = 1,
freeze.lum = FALSE,
sigma = NULL,
kde = TRUE,
arrows = TRUE,
arrow.origin = NULL,
arrow.length = NULL,
arrow.lwd = 1.5,
scale = TRUE,
scale.origin = NULL,
scale.length = NULL,
scale.lwd = 1.5,
length.unit = "",
xlab = NULL,
ylab = NULL,
cex = 1,
text.offset = 0,
text.col = "white"
)
|
x |
n-by-3 matrix, representing the 3D-coordinates of n particles. |
species |
optional argument specifying different particle species. This must be either a n-element vector giving the integer species indices of each particle or a 6-element vector giving the number of particles of each type (see |
value |
optional n-element vector specifying a particle property (e.g. temperatures) to be shown in color. This overwrites the colors set by |
valrange |
2-vector specifying the range of values covered by the colors in the vector |
fix.brightness |
logical flag specifying whether the brightness of value-plots should scale with density. |
weight |
optional n-element vector, specifying the weight of different particles. |
colspecies |
vector of colors, specifying the color of the species given in the optional |
colscale |
vector of colors used to shown the particle property given by the optional vectors |
center |
optional 3-vector specifying the coordinate at the center of the plot. The default is the geometric center (= center of mass, if all particle masses are equal). |
width |
optional horizontal range of the image in the length units of |
aspect |
aspect ratio (= width/height). |
thickness |
optional thickness in length units of |
subsampling |
fraction of particles to be used (if 1, all particles are used, if <1 a random subsample is drawn) |
screen |
logical flag specifying whether the images is displayed on the screen. |
pngfile |
optional png-filename to save the image as raster image. |
pdffile |
optional pdf-filename to save the image as pdf-file. |
rotation |
either an integer (1-6), a 3-vector or a 3-by-3 matrix, specifying a rotation of the 3D particle positions. In case of an integer: 1=(x,y)-plane, 2=(y,z)-plane, 3=(x,y)-plane, 4=(qmax,qmin)-plane, 5=(qmax,qmid)-plane, 6=(qmid,qmin)-plane, where qmax/qmid/qmin are the eigenvectors of the particle-quadrupole, associated with the maximum/middle/minimum eigenvalues, respectively. If |
ngrid |
optional number of grid cells per side in the output image. If the image is not square ngrid is interpreted as the geometric mean between the horizontal and the vertical number of pixels, such that the total number of pixels remains about ngrid^2. |
title |
Text to be added to the figure. |
title.origin |
optional 2-vector specifying the position of the title |
lum |
overall luminosity scaling factor (default 1). |
shadows |
differential luminosity scaling factor for darker regions (default 1). |
freeze.lum |
logical flag (default FALSE). If set to TRUE, the luminosity will not be adjusted as a function of the visible particles. This is normally needed to avoid flickering in animations. |
sigma |
smoothing scale in simulation units. The default is NULL, meaning that a value is picked automatically. If a vector is provided, the different elements will be interpreted as corresponding to different species. |
kde |
logical flag, specifying whether the particles are smoothed using an adaptive kernel density estimator. If a vector is provided, the different elements will be interpreted as corresponding to different species. |
arrows |
logical flag, specifying if axis-arrows are drawn |
arrow.origin |
optional 2-vector specifying the bottom left corner of the arrows |
arrow.length |
optional number specifying the length of the arrows |
arrow.lwd |
line width of arrows |
scale |
logical flag, specifying if a length scale is shown |
scale.origin |
optional 2-vector specifying the right end of the length scale |
scale.length |
optional number specifying the length of the length scale (is always rounded to one significant digit) |
scale.lwd |
line width of length scale |
length.unit |
character string of length unit (e.g. "m" or "kpc") |
xlab |
label on horizontal arrow (only shown if |
ylab |
label on vertical arrow (only shown if |
cex |
text size |
text.offset |
optional extra offset for the arrow and scale labels |
text.col |
color of text, arrows and scale |
Returns a list of items
rgb |
ngrid-by-ngrid-by-3 array of containig the rgb colour data between 0 and 1 |
radius |
positive real number specifying the radius of the image along the horizontal and vertical axes, in the units of the particle positions |
rotationmatrix |
rotation matrix applied to the input data, i.e. the projection was x = (x%*%rot)[,1:2] |
Danail Obreschkow
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.