From: Bob H. <ha...@st...> - 2007-05-24 13:10:43
|
Aidan Heerdegen wrote: >Bob, > >I can convert fractional coords to cartesian with a simple > >a = {1/1 0 0} > >is there (or could there be) a simple way to do the same in reverse? >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. >I am trying to do something similar to Alan Hewat, i.e. only show >atoms defined by fractional unit cell extents, e.g -1.2 < h < 1.8, >-0.8 < k < 0.8, -0.2 < l < 1.4. I can achieve something akin to this >with a series of select within statements, > right; we could make that easier, but I agree, you can do that already. >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. Let's see.... You can find the center with: centerm = {molecule=1}.xyz Or the individual coordinates: centerx = {molecule=1}.x centery = {molecule=1}.y centerz = {molecule=1}.z And although you cannot express that in fractional coordinates, you can certainly express some fractional coordinate in cartesians: coordxyz = {1/2 1/2 1/2} coordx = 0.0 + {1/2 0 0} coordy = 0.0 + {0 1/2 0} coordz = 0.0 + {0 0 1/2} But, no, I guess you cannot do that. Seems to me your best bet is something like this: set scriptReportingLevel -1 # hmm, undocumented.... nMolecules = {*}.molecule.max; n = 1; select none; message _loop; mx = {molecule=n}.x my = {molecule=n}.y mz = {molecule=n}.z if (mx < 30 ... etc.); select selected or molecule=n # prior to 11.1.43, use "select n_set" endif; n = n + 1; if (n <= nMolecules); goto _loop; endif; set scriptReportingLevel 0 Sorry if that looks complicated, but selecting atoms based on criteria that are not strictly atomic is rather tricky. Bob >Thanks > >Aidan > > >------------------------------------------------------------------------- >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 >Jmo...@li... >https://lists.sourceforge.net/lists/listinfo/jmol-users > > |