This is a followup so that others who search this list can find this
information.
On 24/05/2007, at 11:10 PM, Bob Hanson wrote:
> Aidan Heerdegen wrote:
>> I wish to obtain the fractional coordinates of my molecule (which I
>> currently do like so {molecule=1}.xyz). Can I get the same
>> information but in fractional coordinates?
> First, "get the same information but in fractional coordinates." Yes:
>
> x = {molecule=1}.label("%X %Y %Z")
>
> Now, that gets you a STRING that looks like this:
>
> ...
> 0.46969998 1.0 1.0
> 0.14659995 0.73309994 0.8809
> 1.4697001 0.0 0.0
> 1.4135001 0.2669 0.11910001
> 1.2669002 0.4135 0.54756665
> ....
>
> From which you could extract the information.
Works like a charm. Thanks Bob. I am using javascript to make an
"application" of sorts, so I suck that information out and use
javascript to get the average fractional position.
I noticed 11.2.1 now has a 'FX', 'FY' and 'FZ' comparison operators
so now most of this is redundant.
I can now do:
fracx = {molecule=1}.FX
to get the average fractional x position of molecule 1. Nice!
For completeness you might want to be able to do this:
fracxyz = {molecule=1}.FXYZ
(but personally I don't need it)
>> but I really want to
>> include/exclude whole molecules based on the location of their
>> centre.
>
> Ah, this is another question entirely. If you want say, "display only
> molecules for which the center is within the following space...,"
> that's
> not trivial.
Well I now do it by assigning to each atom three properties, the
fractional x, y and z positions of the molecule to which they belong.
Then I can do things like:
display property_comfracx >= -1.5 AND property_comfracx <= 2 AND
property_comfracy >= -1.2 AND property_comfracy <= 2.2 AND
property_comfracz >= -0.1 AND property_comfracz <= 1.1
where (obviously) property_comfracx, property_comfracy and
property_comfracz are the three components of the molecule centroid
in fractional coordinates.
I use properties for other things too. I have my own unitcell
definitions so that I can select whole molecules based on the
unitcell in which their centroid lies. That sort of thing. This is a
very nice feature, thanks Bob.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users