getProperty can be a very inefficient function. The algorithm is designed to
return the entire property set, then do the selections. So, for example, if
you say:
print getProperty("atomInfo[3]")
and there are 30000 atoms, then first a vector containing 30000 elements is
produced and only after that is one selected.
I'm reminded that I thought of that and had a solution to it but forgot. The
alternative format:
print getProperty("atomInfo", {atomIndex=3})
is far more efficient, as it only creates a single atomInfo entry -- an
array with one element.
I've checked in code now that combines these:
print getProperty("atominfo[1].sym", {atomIndex=3})
creates only one entry and then selects the information about atom symbol
from that single entry. ([0] would work as well, because that means "the
last entry", and there is only one)
In checking through the code, I also noticed that "bondInfo" works
similarly, but both atoms of the bond must be selected. I've now changed
that so that if you specify just one atom, then "bondInfo" gives you what
you think it would -- the bond info for that atom:
print getProperty("bondInfo", {atomno=2})
[[ information about all bonds to atom #2 are displayed ]]
Similarly,
print getProperty("bondInfo[1]", {atomno=2})
give information about just the first bond to atom #2.
In addition, getProperty("modelInfo") was not allowing an atom expression,
but it seems to me that would make sense as well:
print getProperty("modelInfo", {atomIndex=2})
or perhaps
print getProperty("modelInfo", {1.3})
So I have added that.
Finally, getProperty("auxiliaryInfo") also could allow for specifying the
model, so I have added that as well:
print getProperty("auxiliaryInfo", {1.3})
These changes should make for much more efficient extraction of information.
Bob
--
Robert M. Hanson
Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr
If nature does not answer first what we want,
it is better to take what answer we get.
-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users