Jmol/JSmol interactive scripting documentation



Search View Full Database Index

measure or measures or monitor or monitors 


   See examples-11/measure.htm 

Renders a measurement between the specified atoms. See also set (measure). Two general syntaxes are available. In the older syntax, a series of two to four atom numbers are given, and the appropriate measure (distance, angle, or dihedral angle) is then displayed. The newer, more general syntax is as follows:

measure RANGE <minValue> <maxValue> ALL|ALLCONNECTED|DELETE (<atom expression>) (<atom expression>) ...

Using this syntax one can specify a set of measurements to define all at once. Note that these sets are embedded atom expressions that must be enclosed in parentheses. If neither ALL nor ALLCONNECTED is present, only the first matching atom in the entire model set (all frames, so probably the first frame) is matched in each atom expression. When ALL or ALLCONNECTED is specified, all matching criteria in all frames are generated, thus allowing for "animated" measures. In general, this syntax restricts measurements to within the same model. However, measures can also be between two atoms in different frames (different models) as long as each atom expression evaluates to a single, specific atom. (To specify a particular atom in a particular model, use "AND */n", where n is the model number, "ATOMNO=3" by itself, for example, will indicate the third atom in each model/frame, but "ATOMNO=3 and */6" specifies only atom 3 in model 6). If a measurement is made between atoms in different models, both models must be displayed in order for the measurement to appear. A simple way to display two specific models is to use display */i or */j, where i and j are two model numbers.

Thus, for example, measure (*) (*) will measure nothing, because both expressions will simply match the first atom in the first frame. measure allconnected (*/3) (*/3) (*/3) will measure every angle associated with bonds for model 3; measure allconnected (*) (*) will measure every bonded distance in every loaded model; measure all (*) (*) measures all possible interatomic distances in all models (not recommended!).

For the applet, using getProperty measurementInfo will then deliver full information relating to all measurements.

The format of the label that accompanies the measurement line can be set for previously created measurements using measure "n:labelFormat", described below. In addition, the default format (affecting only future-created labels) for measurement labels can be set using set defaultDistanceLabel, set defaultAngleLabel, and set defaultTorsionLabel. The font of measurements can be set, for example, using font measure 20.

You can specify units for a specific label using "//" at the end of the format followed by a unit designation such as A or nm. Special units are available for NMR data arising from Magres files: "2://dc_hz" or "2://dc_khz" or "2://khz" for calculated dipolar constant in Hz or kHz and "2://isc_hz" or "2://hz" for calculated J-coupling constants. These units are also available for the measure() function as, for example, x = measure({a},{b},"isc_hz").

 measure ON/OFF{default: ON}

Turns on and off the distance, angle, dihedral measurement labels and measurement lines. (To turn off just the labels, use set measurement OFF

 measure "n:labelFormat"

Changes all previously defined measurement labels of a given type (n = 2, 3, or 4) to the indicated format. The default label is "%VALUE %UNITS" for all types. Specifically for distances, the suffix //A will use angstroms for the default label for distance measurements. Other suffixes include //nm, //pm, and //vdw. Also available is %#(percent number-sign), which gives the 1-based number of the measurement. Atom information can be included as for labels, adding 1 or 2 to the format code to indicate which atom. So, for example, measure "2:%a1 -- %a2 distance = %0.0VALUE" delivers the two atom names along with the value of the measurement rounded to the nearest integer with no units indicated. Specific units for the measurements can be given after two slashes: measure "2:%a1 -- %a2 distance = %0.1VALUE //A" would display the distance rounded to the nearest 0.1 Angstrom.

 measure (two to four atom expressions, each in parentheses) "labelFormat"

Show the distance, angle, or dihedral angle formed by the FIRST atom in each atom expression. The format is optional.

 measure (integer) (integer) "labelFormat"

Two atoms specify a distance measurement with an optionally given format. This syntax selects the first atom in the current frame set.

 measure (integer) (integer) (integer) "labelFormat"

Three atoms specify an angle measurement. The format is optional. This syntax selects the first atom in the current frame set.

 measure (integer) (integer) (integer) (integer) "labelFormat"

Four atoms specify a dihedral angle measurement. The format is optional. This syntax selects the first atom in the current frame set.

 measure ALL (two to four atom expressions) "labelFormat"

Show the distance, angle, or dihedral angle formed by ALL atoms in the first expression with ALL atoms of each additional atom expression. The format is optional.

 measure ALLCONNECTED (two to four atom expressions) "labelFormat"

Show the distance, angle, or dihedral angle formed by ALL atoms in the first expression with ALL atoms of each additional atom expression, provided they form a connected set. The format is optional.

 measure DELETE

Deletes all measurements.

 measure DELETE (integer)

Deletes a specific measurement, in order of their creation, starting with 1.

 measure DELETE (two to four atom expressions)

Deletes all matching distance, angle, or dihedral angle measurements that are currently defined based on the atom expressions.

 measure LIST

Lists all measurements. (Same as show measurements.)

 measure RANGE (decimal) (decimal) ALL|ALLCONNECTED|DELETE (two to four atom expressions, each in parentheses)

Adding RANGE and two decimal numbers modifies the above commands to limit the measurements created or deleted to only those within this specific range of values in Angstroms (distance) or degrees (angles). The word "RANGE" itself is optional but recommended.

 measure SEARCH "SMARTstring"

The SEARCH (or SMARTS) option for MEASURE allows powerful atom selection using Jmol SMARTS, particularly involving braces { } to designate the desired two, three, or four atoms. For example, set measurementUnits HZ; measure SEARCH "{[H]}CC{[H]}" will display all three-bond coupling constants calculated for a compound, because { } indicates that we want to do the full match but then only return these specific atoms from that search.

 measure SELECT ..

Selects the specified measures for actions without creating or removing it; if the described measure does not exist, the command is ignored; for example:

load $caffeine
measure {_N} {_O} all

measure SELECT 4.5 {_N} {_O}
color measures yellow
measure SELECT 3.5 4.5 {_N} {_O} color green

 measure SELECT ALL

Selects all measures

 measure SELECTED

List the currently selected measures

 measure SELECTED ..

Carry out the change only on the currently selected measures; "default" (quoted) parameter sets the format string and units to default values; for example:

load $caffeine
measure {_N} {_O} all
measure SELECT 4.5 {_N} {_O} color orange
measure SELECT 4.5 {_N} {_O} "pm"
measure SELECT 4.5 {_N} {_O} color orange "pm"
measure SELECT 4.5 {_N} {_O}
measure SELECTED color orange
measure SELECTED delete

 measure .. DEFAULT

For a given set of selected measurements, resets units and label format to null (indicating default units and format)

 measure TICKS X|Y|Z {major,minor,subminor} FORMAT [%0.2f, ...] SCALE {scaleX, scaleY, scaleZ} | x.xx FIRST x.xx {point1} {point2}

Creates a measure line with ticks along it. There are three levels of ticks - major, minor, and "subminor." Only the major ticks have labels. Which of these tick levels are displayed and the distance between ticks depends upon the parameter that takes the form of a point. The optional keyword FORMAT allows formating of the labels for the major ticks. These are based on an array of strings given after the FORMAT keyword. If the array is shorter than the number of ticks, the formats in the array are repeated. Following that, the optional keyword SCALE allows setting the scale either for each axis direction independently {scaleX, scaleY, scaleZ} or overall (as a decimal number). An optional keyword FIRST allows setting of the initial value of the measure. Finally, two points must be indicated.


Examples:

   See examples-11/measure.htm 


See also:

undefined



top search index

Index (full)


measure or measures or monitor or monitors 
measure ON/OFF{default: ON}
measure "n:labelFormat"
measure (two to four atom expressions, each in parentheses) "labelFormat"
measure (integer) (integer) "labelFormat"
measure (integer) (integer) (integer) "labelFormat"
measure (integer) (integer) (integer) (integer) "labelFormat"
measure ALL (two to four atom expressions) "labelFormat"
measure ALLCONNECTED (two to four atom expressions) "labelFormat"
measure DELETE
measure DELETE (integer)
measure DELETE (two to four atom expressions)
measure LIST
measure RANGE (decimal) (decimal) ALL|ALLCONNECTED|DELETE (two to four atom expressions, each in parentheses)
measure SEARCH "SMARTstring"
measure SELECT ..
measure SELECT ALL
measure SELECTED
measure SELECTED ..
measure .. DEFAULT
measure TICKS X|Y|Z {major,minor,subminor} FORMAT [%0.2f, ...] SCALE {scaleX, scaleY, scaleZ} | x.xx FIRST x.xx {point1} {point2}


last updated: May 04, 2025 11:01:10

html

xml docbook