[AIT logo]

Institut für Astronomie und Astrophysik

Abteilung Astronomie

Sand 1, D-72076 Tübingen, Germany
[Uni logo]


PARTVELVEC Source code in partvelvec.pro

PARTVELVEC

Name
      PARTVELVEC
Purpose
       Plot the velocity vectors of particles at their positions
Explanation
       This procedure plots the velocity vectors of particles (at the
       positions of the particles).
Category
       Plotting, Two-dimensional.
Calling Sequence
       PARTVELVEC, VELX, VELY, POSX, POSY [, X, Y]
Input Parameters
       VELX:  An array of any dimension, containing the x-components
              of the particle velocities.
       VELY:  An array of the same dimension as velx, containing the
              y-components of the particle velocities.
       POSX:  An array of the same dimension as velx, containing the
              x-components of the particle positions.
       POSY:  An array of the same dimension as velx, containing the
              y-components of the particle positions.
Optional Input Parameters
       X:   Optional abcissae values. X must be a vector.
       Y:   Optional ordinate values. Y must be a vector. If only X
            is specified, then Y is taken equal to be equal to X.
Optional Input Keywords
       FRACTION:   The fraction of the vectors to plot. They are
                   taken at random from the complete sample.    Default is
              FRACTION = 1.0, use all vectors
       LENGTH:     The maximum vectorlength relative to the plot data
                   window.   Default = 0.08
       COLOR:      The color for the vectors, axes and titles.
              Default=!P.COLOR
       OVER:       Plot over the previous plot
       VECCOLORS:  The vector colors. Must be either a scalar, or
                   a vector the same size as VELX. Is set to COLOR by default.
       Plot        All other keywords available to PLOT are also used
       Keywords:   by this procedure.
Output Parameters
       This procedure plots the velocity vectors (VELX,VELY) at the
       positions of the particles, (POSX,POSY). If X and Y are not
       specified, then the size of the plot is such that all vectors
       just fit within in the plot data window.
Side Effects
       Plotting on the current device is performed.
Example
       Generate some particle positions and velocities.
         POSX=RANDOMU(seed,200)
         POSY=RANDOMU(seed,200)
         VELX=RANDOMU(seed,200)-0.5
         VELY=RANDOMU(seed,200)-0.5
       Plot the particle velocities.
         PARTVELVEC, VELX, VELY, POSX, POSY
       Example using vector colors.
         POSX=RANDOMU(seed,200)
         POSY=RANDOMU(seed,200)
         VELX=RANDOMU(seed,200)-0.5
         VELY=RANDOMU(seed,200)-0.5
         magnitude = SQRT(velx^2 + vely^2)
         LOADCT, 5, NCOLORS=254, BOTTOM=1 ; Load vector colors
         TVLCT, 0, 255, 0, 255 ; Plot in GREEN
         colors = BytScl(magnitude, Top=254) + 1B
         PARTVELVEC, VELX, VELY, POSX, POSY, COLOR=255, VECCOLORS=colors
Revision History
       Written by:  Joop Schaye (jschaye@astro.rug.nl), Sep 1996.
       Converted to IDL V5.0   W. Landsman   September 1997
       Added /OVER keyword   Theo Brauers (th.brauers@fz-juelich.de) Jul 2002
       Added VECCOLORS keyword. David Fanning (david@dfanning.com) March, 2005

Last modified by pro2html on 2005 April 01 at 03:12 UTC

[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]

Jörn Wilms (wilms@astro.uni-tuebingen.de)
Updated automatically