Coyote Graphics Routines

Date: Fri Mar 27 12:14:20 2015

single page | use frames     summary     class     fields     routine details     file attributes

.\

cgmapvector__define.pro


Class description for cgMapVector

Inheritance

All ancestor classes: cgContainer IDL_OBJECT IDL_CONTAINER

Properties

Properties in cgContainer

Properties in cgMapVector

LATS get set init
_EXTRA set init
SOLID get set init
ADDCMD set init
HSIZE get set init
LENGTH get set init
VMAGNITUDE get set init
CLIP get set init
PALETTE set init
LONS get set init
LINESTYLE get set init
ZVALUE get set init
UMAGNITUDE get set init
_REF_EXTRA get
MAPCOORD get set
COLOR get set init
NOCLIP get set init
UVCOORDS get set init
THICK get set init
T3d get set init

Fields

Fields in cgContainer

Fields in IDL_OBJECT

Fields in IDL_CONTAINER

Fields in cgMapVector

LATS ptr_new()
U ptr_new()
V ptr_new()
SOLID 0S
HSIZE 0.000000
LENGTH 0.00000000D
CLIP [0.00000000D, 0.00000000D, 0.00000000D, 0.00000000D]
MAGCOLORS ptr_new()
PALETTE ptr_new()
LONS ptr_new()
LINESTYLE 0S
ZVALUE 0.000000
MAPCOORD obj_new()
COLOR ''
NOCLIP 0B
UVCOORDS 0B
THICK 0S
T3D 0B

Routines

result = cgMapVector::INIT(mapCoord [, /ADDCMD] [, CLIP=fltarr(4)] [, COLOR=string] [, HSIZE=float] [, LATS=float], LENGTH=LENGTH [, LINESTYLE=integer] [, LONS=float] [, /NOCLIP] [, PALETTE=byte] [, /SOLID] [, /T3d] [, THICK=integer] [, UMAGNITUDE=float] [, /UVCOORDS] [, VMAGNITUDE=float] [, ZVALUE=float] [, _EXTRA=_EXTRA])

This object allows vectors (arrows) to be placed as annotations on map projections created with the cgMap coordinate object.

cgMapVector::DrawArrow, x0, y0, x1, y1, CLIP=CLIP [, COLOR=string] [, /DATA], HSIZE=HSIZE, HTHICK=HTHICK [, LINESTYLE=integer] [, /NORMALIZED] [, THICK=integer] [, /SOLID] [, _EXTRA=_EXTRA]

This is a heavily modified IDL ARROW procedure, with extra keywords added and the COLOR keyword modified to accept color names.

cgMapVector::Draw

Draws the vectors on the map projection.

cgMapVector::GetProperty [, CLIP=fltarr(4)] [, COLOR=string] [, HSIZE=float] [, LATS=float], LENGTH=LENGTH [, LINESTYLE=integer] [, LONS=float] [, MAPCOORD=object] [, /NOCLIP] [, /SOLID] [, /T3D] [, THICK=integer] [, UMAGNITUDE=float] [, /UVCOORDS] [, VMAGNITUDE=float] [, ZVALUE=float] [, _REF_EXTRA=_REF_EXTRA]

This method allows the user to get various properties of the object.

cgMapVector::SetProperty [, /ADDCMD] [, CLIP=fltarr(4)] [, COLOR=string] [, HSIZE=float] [, LATS=float], LENGTH=LENGTH [, LINESTYLE=integer] [, LONS=float] [, MAPCOORD=object] [, /NOCLIP] [, PALETTE=byte] [, /SOLID] [, /T3D] [, THICK=integer] [, UMAGNITUDE=float] [, /UVCOORDS] [, VMAGNITUDE=float] [, ZVALUE=float] [, _EXTRA=_EXTRA]

This method allows the user to set various properties of the object.

cgMapVector::CLEANUP

This is the clean-up routine for the object.

cgMapVector__DEFINE [, class]

This is the class definition module.

Routine details

top cgMapVector::INIT

Graphics, Map Projections

result = cgMapVector::INIT(mapCoord [, /ADDCMD] [, CLIP=fltarr(4)] [, COLOR=string] [, HSIZE=float] [, LATS=float], LENGTH=LENGTH [, LINESTYLE=integer] [, LONS=float] [, /NOCLIP] [, PALETTE=byte] [, /SOLID] [, /T3d] [, THICK=integer] [, UMAGNITUDE=float] [, /UVCOORDS] [, VMAGNITUDE=float] [, ZVALUE=float] [, _EXTRA=_EXTRA])

This object allows vectors (arrows) to be placed as annotations on map projections created with the cgMap coordinate object.

Parameters

mapCoord in required type=object

A map coordinate object that will set up a map coordinate data space. Required to convert lat/lon values to projected meter space. A cgMap object.

Keywords

ADDCMD in optional type=boolean default=0

If this keyword is set, the object is added to the resizeable graphics window, cgWindow. The DRAW method of the object is called in cgWindow.

CLIP in optional type=fltarr(4)

The coordinates of a rectangle used to clip the graphics output. The rectangle is specified as a vector of the form [X0, Y0, X1, Y1], giving coordinates of the lower left and upper right corners, respectively. The default clipping rectangle is the plot window set up by the cgMap object.

COLOR in optional type=string default=opposite

The name of the color to draw the arrows lines in.

HSIZE in optional type=float default=0.35

The value of this keyword sets the length of the arrowhead. See the documenation for the ARROW command in IDL for further explanation.

LATS in optional type=float

The latitude values where the vector is to be drawn.

LENGTH

The length of the UV vectors. The default value calculates a maximum length, which is the larger of either the latitude or longitude range. This value is then divided by 100. To scale the UV values, the values are divided by the maximum magnitude of the UV vectors and then multiplied by the length. The code looks like this for the default case:

maxlength = Max( [Max(lons)-Min(lons), Max(lats)-Min(lats)] ) length = maxlength / 100.0 maxMagnitude = Max(Sqrt(u^2 + v^2)) uscaled = (u/maxMagnitude) * length vscaled = (v/maxMagnitude) * length
The default length value is likely to be too large for polar plots, but seems adequate for other map projections. If you need to adjust the length, get the current length with the GetProperty method and the LENGTH keyword, and adjust accordingly. The length is not set finally, until the vectors are first drawn.

LINESTYLE out optional type=integer default=1

Set this keyword to the type of linestyle desired. See Graphics Keywords in the on-line help for additional information.

LONS in optional type=float

The longitude values where the vector is to be drawn.

NOCLIP in optional type=boolean default=0

Set this keyword to supress clipping of the plot.

PALETTE in optional type=byte

A (256x3) color palette containing the RGB color vectors to use for coloring the vectors according to the magitude of the vectors. If the color palette is not 256 colors in length then the magitude is scaled into the number of colors available. If a color palette is used, then the Color keyword is ignored.

SOLID in optional type=boolean default=0

Set this keyword to draw solid arrow heads.

T3d in optional type=boolean default=0

Set this graphics keyword if you wish to draw using the T3D transformation matrix.

THICK in optional type=integer default=1

Set this keyword to the thickness of the line used to draw the grid.

UMAGNITUDE in optional type=float

The magnitude of the vector in the U direction.

UVCOORDS in optional type=boolean default=0

Set this keyword if the LONS and LATS are specified in UV (XY) coordinates, rather than longitude and latitude coordinates.

VMAGNITUDE in optional type=float

The magnitude of the vector in the V direction.

ZVALUE in optional type=float default=0.0

Set this keyword to the ZVALUE where the output should be drawn.

_EXTRA in optional

Any keywords appropriate for superclass objects are also permitted.

Author information

Author:

FANNING SOFTWARE CONSULTING:

David W. Fanning 1645 Sheely Drive Fort Collins, CO 80526 USA Phone: 970-221-0438 E-mail: david@idlcoyote.com Coyote's Guide to IDL Programming: http://www.idlcoyote.com

Copyright:

Copyright (c) 2011, Fanning Software Consulting, Inc. The initialization method for the object.

History:

Change History:

Written by David W. Fanning, 21 November 2011. Tested and bugs fixed. 17 Sept 2012. DWF. Bug fix in draw method when passing lat/lon vectors. 6 Jan 2013. DWF. Added PALETTE keyword to allow the vectors to be drawn in colors scaled to vector magnitude. 6 Jan 2012. DWF. The CLIP keyword was not working correctly and was fixed 29 April 2013. DWF.

top cgMapVector::DrawArrow

cgMapVector::DrawArrow, x0, y0, x1, y1, CLIP=CLIP [, COLOR=string] [, /DATA], HSIZE=HSIZE, HTHICK=HTHICK [, LINESTYLE=integer] [, /NORMALIZED] [, THICK=integer] [, /SOLID] [, _EXTRA=_EXTRA]

This is a heavily modified IDL ARROW procedure, with extra keywords added and the COLOR keyword modified to accept color names. It assumes drawing in the device coordinate space, unless the DATA or NORMALIZED keywords are set.

Copyright (c) 1993-2004, Research Systems, Inc. All rights reserved.

Parameters

x0 in required type=float

The X value at the butt end of the arrow.

y0 in required type=float

The Y value at the butt end of the arrow.

x1 in required type=float

The X value at the tip end of the arrow.

y1 in required type=float

The Y value at the tip end of the arrow.

Keywords

CLIP
COLOR in optional type=string default=opposite

The name of the color to draw the grid lines in.

DATA in optional type=boolean default=0

Set this keyword to draw in the data coordinate space.

HSIZE
HTHICK
LINESTYLE in optional type=integer default=0

The graphics linestyle to draw the vector in.

NORMALIZED in optional type=boolean default=0

Set this keyword to draw in the normalized data coordinate space.

THICK in optional type=integer default=1

Set this keyword to the thickness of the line used to draw the grid.

SOLID in optional type=boolean default=0

Set this keyword to fill the arrow head with a solid color. Otherwise, draw the arrow head as an outline.

_EXTRA in optional

Any keywords appropriate PlotS or PolyFill.

top cgMapVector::Draw

cgMapVector::Draw

Draws the vectors on the map projection.

top cgMapVector::GetProperty

cgMapVector::GetProperty [, CLIP=fltarr(4)] [, COLOR=string] [, HSIZE=float] [, LATS=float], LENGTH=LENGTH [, LINESTYLE=integer] [, LONS=float] [, MAPCOORD=object] [, /NOCLIP] [, /SOLID] [, /T3D] [, THICK=integer] [, UMAGNITUDE=float] [, /UVCOORDS] [, VMAGNITUDE=float] [, ZVALUE=float] [, _REF_EXTRA=_REF_EXTRA]

This method allows the user to get various properties of the object. The same keywords that are used for the INIT method can be used here.

Keywords

CLIP out optional type=fltarr(4)

The coordinates of a rectangle used to clip the graphics output. The rectangle is specified as a vector of the form [X0, Y0, X1, Y1], giving coordinates of the lower left and upper right corners, respectively. The default clipping rectangle is the plot window set up by the cgMap object.

COLOR out optional type=string default=opposite

The name of the color to draw the grid lines in.

HSIZE out optional type=float default=0.35

The value of this keyword sets the length of the arrowhead. See the documenation for the ARROW command ind IDL for further explanation.

LATS out optional type=float

The latitude values where the vector is to be drawn.

LENGTH

The U and V vectors are mutiplied by LENGTH before they are used to calculate the (x1,y1) endpoint of the vector. By default, the length is set to 1/100th of the XRANGE of the MapCoord object. This means that the maximum length of a vector will be approximately LENGTH * SQRT(2).

LINESTYLE out optional type=integer default=1

Set this keyword to the type of linestyle desired. See Graphics Keywords in the on-line help for additional information.

LONS out optional type=float

The longitude values where the vector is to be drawn.

MAPCOORD out optional type=object

The map coordinate for the object.

NOCLIP out optional type=boolean default=0

Set this keyword to supress clipping of the plot.

SOLID out optional type=boolean

This keyword is set if solid arrow heads are currently being drawn.

T3D out optional type=boolean default=0

Set this graphics keyword if you wish to draw using the T3D transformation matrix.

THICK out optional type=integer default=1

Set this keyword to the thickness of the line used to draw the grid.

UMAGNITUDE out optional type=float

The magnitude of the vector in the U direction.

UVCOORDS out optional type=boolean default=0

Set this keyword if the LONS and LATS are specified in UV (XY) coordinates, rather than longitude and latitude coordinates.

VMAGNITUDE out optional type=float

The magnitude of the vector in the V direction.

ZVALUE out optional type=float default=0.0

Set this keyword to the ZVALUE where the output should be drawn.

_REF_EXTRA in optional

Any keywords appropriate for superclass objects are also permitted.

top cgMapVector::SetProperty

cgMapVector::SetProperty [, /ADDCMD] [, CLIP=fltarr(4)] [, COLOR=string] [, HSIZE=float] [, LATS=float], LENGTH=LENGTH [, LINESTYLE=integer] [, LONS=float] [, MAPCOORD=object] [, /NOCLIP] [, PALETTE=byte] [, /SOLID] [, /T3D] [, THICK=integer] [, UMAGNITUDE=float] [, /UVCOORDS] [, VMAGNITUDE=float] [, ZVALUE=float] [, _EXTRA=_EXTRA]

This method allows the user to set various properties of the object. The same keywords that are used for the INIT method can be used here.

Keywords

ADDCMD in optional type=boolean default=0

If this keyword is set, the object is added to the resizeable graphics window, cgWindow. The DRAW method of the object is called in cgWindow.

CLIP in optional type=fltarr(4)

The coordinates of a rectangle used to clip the graphics output. The rectangle is specified as a vector of the form [X0, Y0, X1, Y1], giving coordinates of the lower left and upper right corners, respectively. The default clipping rectangle is the plot window set up by the cgMap object.

COLOR in optional type=string default=opposite

The name of the color to draw the grid lines in.

HSIZE in optional type=float default=0.35

The value of this keyword sets the length of the arrowhead. See the documenation for the ARROW command ind IDL for further explanation.

LATS in optional type=float

The latitude values where the vector is to be drawn.

LENGTH

The U and V vectors are mutiplied by LENGTH before they are used to calculate the (x1,y1) endpoint of the vector. By default, the length is set to 1/100th of the XRANGE of the MapCoord object. This means that the maximum length of a vector will be approximately LENGTH * SQRT(2).

LINESTYLE out optional type=integer default=1

Set this keyword to the type of linestyle desired. See Graphics Keywords in the on-line help for additional information.

LONS in optional type=float

The longitude values where the vector is to be drawn.

MAPCOORD in optional type=object

The map coordinate for the object.

NOCLIP in optional type=boolean default=0

Set this keyword to supress clipping of the plot.

PALETTE in optional type=byte

A (256x3) color palette containing the RGB color vectors to use for coloring the vectors according to the magitude of the vectors. If the color palette is not 256 colors in length then the magitude is scaled into the number of colors available. If a color palette is used, then the Color keyword is ignored.

SOLID in optional type=boolean default=0

Set this keyword to draw solid arrow heads.

T3D in optional type=boolean default=0

Set this graphics keyword if you wish to draw using the T3D transformation matrix.

THICK in optional type=integer default=1

Set this keyword to the thickness of the line used to draw the grid.

UMAGNITUDE in optional type=float

The magnitude of the vector in the U direction.

UVCOORDS in optional type=boolean default=0

Set this keyword if the LONS and LATS are specified in UV (XY) coordinates, rather than longitude and latitude coordinates.

VMAGNITUDE in optional type=float

The magnitude of the vector in the V direction.

ZVALUE in optional type=float default=0.0

Set this keyword to the ZVALUE where the output should be drawn.

_EXTRA in optional

Any keywords appropriate for superclass objects are also permitted.

top cgMapVector::CLEANUP

cgMapVector::CLEANUP

This is the clean-up routine for the object.

top cgMapVector__DEFINE

cgMapVector__DEFINE [, class]

This is the class definition module.

Parameters

class out optional type=structure

Occasionally, it is useful to have an object class definition as a structure variable. Using this output keyword will allow that.

File attributes

Modification date: Fri Mar 27 11:07:38 2015
Lines: 772
Docformat: rst rst