Re: [Jmol-users] Best way to access getproperty with JSmol

2016-10-22 Thread Kubasik, Matthew A.
Mark,

One other thing.  You wrote that "when you load the model it prints all the 
vibrational energies out”. 

But here’s the thing…I think that, technically, the “names” of the models 
containing vibrations are printed, i.e., what you would get from 
x = getproperty("modelinfo.models.name”)

The file reader seems to be set up to name the models containing vibrational 
modes according to the energy of the vibration.

To get vibrational energies in cm^-1, use 
getproperty(“modelinfo.models.modelproperties.Frequency”)

To get only the value of the energy, use 
getproperty(“modelinfo.models.modelproperties.FreqValue”)

The Gaussian file reader seems to be coded to print model numbers with the 
model name/frequency value, while the GAMESS reader seems not to.  These seem 
to be arbitrary decisions of the authors of the file reading code.  

Matt Kubasik




--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Best way to access getproperty with JSmol

2016-10-22 Thread Mark Perri
Dear Bob and Matt,

Thanks for the advice.  I couldn't get 
jmolApplet0._applet.viewer.getAuxiliaryInfo(6).get("moData") to work (I also 
tried .ms and .ms.am and various frames with MO Data) -- I got errors about 
a.get() not being a function and other things.

Matt's suggestion works well.  I was just extracting the MO energies, so I used 
getPropertyAsArray to only get an array of the energies, which was much much 
faster than what I was doing.  I then iterated through the frames to get the 
vibrational frequencies as well.  I thought there should be a faster way -- 
when you load the model it prints all the vibrational energies out, but I 
wasn't sure how to associate them with their particular frame so that I could 
animate them. But iterating frame by frame works out OK.

I have a feeling I could optimize it even more, but it's definitely improved 
now.

Thanks,
Mark




From: Kubasik, Matthew A. 
Sent: Saturday, October 22, 2016 8:51 AM
To: jmol-users@lists.sourceforge.net
Subject: Re: [Jmol-users] Best way to access getproperty with JSmol

Dear Mark and Bob,

Perhaps getting a large quantity of “auxiliarydata” is slowing things down?

Maybe, Mark, you could drill down a bit to get the specific auxiliary data that 
you want.  So, for example, maybe instead of

var x = Jmol.getPropertyAsArray(jmolApplet0,"auxiliaryInfo");

You could use

var x = Jmol.getPropertyAsArray(jmolApplet0, 
“auxiliaryinfo.models[1].modata.mos.coefficients”)  // where [1] is the model # 
with the mo data

I’m not sure exactly what properties of the mos that you want, and I am not 
familiar with GAMESS.  However, the above line might get you a 2D array 
containing mo coefficients.  So, for example, the coefficients of the first mo 
would be in (x[1])[1], the second set of coefficients would be in (x[1])[2], 
etc.

Also, the frequencies can be obtained from

x=Jmol.getPropertyAsArray(jmolApplet0, 
"modelinfo.models.modelproperties.frequency”)

That’s how I understand it, but I’m not 100% sure this will work.

Matt Kubasik

On Oct 22, 2016, at 8:30 AM, Robert Hanson 
> wrote:

If you are interested in just getting one model's auxiliary info, you can use _M

$ load c:/temp/t.gamess
7 models
46 molecular orbitals in model 1.2
17 molecular orbitals in model 1.7

$ frame 1.7
$ print _M.keys
Energy
EnergyString
dipole
fileName
fileType
initialAtomCount
initialBondCount
moData
modelFileNumber
modelName
modelNumber
modelNumberDotted
modelProperties


>From JavaScript you would use:


info = Jmol.evaluateVar(jmolApplet0, "_M")

Should be relatively efficient.

Alternatively, if you want instantaneous direct access to that Java object you 
can use

info = 
jmolApplet0._applet.viewer.ms.am[0].auxiliaryInfo

But two caveats:

1) You are bypassing the interfaces and tapping in to officially "nonpublic" 
objects. Sometimes those underlying objects get name changes or are otherwise 
refactored.

2) You are working with a transpiled Java Object. In this case, 
java.util.Hashtable. You  have to use .get(key) to access its information:

jmolApplet0._applet.viewer.ms.getAuxiliaryInfo(6).__CLASS_NAME__
"java.util.Hashtable"

modata = jmolApplet0._applet.viewer.getAuxiliaryInfo(6).get("moData")
modata.__CLASS_NAME__
"java.util.Hashtable"

and deal with all of those values appropriately as well.








On Fri, Oct 21, 2016 at 7:54 PM, Mark Perri 
> wrote:


Dear users list,


I'm trying to get MO energies and vibrational frequencies from a GAMESS output 
file that I read into JSmol.  Right now I use:

var x = Jmol.getPropertyAsArray(jmolApplet0,"auxiliaryInfo");


Then I iterate over every frame and look at x.models[i].moData.mos and 
x.models[i].modelProperties.Frequency


But for a large file the getPropertyAsArray takes > 10 seconds and freezes 
Firefox while it's loading.  Reading the manual it seems that I can use 
getProperty asynchronously, but I don't understand how to use it properly.


I set a message callback function to handle getProperty, but I'm not sure how 
to actually read in the moData.  It appears to be in arguments[1], but 
everything I try is undefined.  Here's an example of what I've tried.


Thanks,

Mark


var Info = {
width: 450,
height: 450,
debug: false,
color: "white",
addSelectionOptions: false,
serverURL: "http://chemapps.stolaf.edu/jmol/jsmol/php/jsmol.php;,
use: "HTML5",
j2sPath: "/jsmol/j2s",
readyFunction: jmol_isReady,
script: script,
loadStructCallback: "onJSmolLoad",
messageCallback: "processFrames",
disableInitialConsole: true
}


function processFrames()
{

 for (i=0; i

Re: [Jmol-users] Best way to access getproperty with JSmol

2016-10-22 Thread Kubasik, Matthew A.
Dear Mark and Bob,

Perhaps getting a large quantity of “auxiliarydata” is slowing things down?

Maybe, Mark, you could drill down a bit to get the specific auxiliary data that 
you want.  So, for example, maybe instead of

var x = Jmol.getPropertyAsArray(jmolApplet0,"auxiliaryInfo");

You could use

var x = Jmol.getPropertyAsArray(jmolApplet0, 
“auxiliaryinfo.models[1].modata.mos.coefficients”)  // where [1] is the model # 
with the mo data

I’m not sure exactly what properties of the mos that you want, and I am not 
familiar with GAMESS.  However, the above line might get you a 2D array 
containing mo coefficients.  So, for example, the coefficients of the first mo 
would be in (x[1])[1], the second set of coefficients would be in (x[1])[2], 
etc.

Also, the frequencies can be obtained from

x=Jmol.getPropertyAsArray(jmolApplet0, 
"modelinfo.models.modelproperties.frequency”)

That’s how I understand it, but I’m not 100% sure this will work.

Matt Kubasik

On Oct 22, 2016, at 8:30 AM, Robert Hanson 
> wrote:

If you are interested in just getting one model's auxiliary info, you can use _M

$ load c:/temp/t.gamess
7 models
46 molecular orbitals in model 1.2
17 molecular orbitals in model 1.7

$ frame 1.7
$ print _M.keys
Energy
EnergyString
dipole
fileName
fileType
initialAtomCount
initialBondCount
moData
modelFileNumber
modelName
modelNumber
modelNumberDotted
modelProperties


From JavaScript you would use:


info = Jmol.evaluateVar(jmolApplet0, "_M")

Should be relatively efficient.

Alternatively, if you want instantaneous direct access to that Java object you 
can use

info = 
jmolApplet0._applet.viewer.ms.am[0].auxiliaryInfo

But two caveats:

1) You are bypassing the interfaces and tapping in to officially "nonpublic" 
objects. Sometimes those underlying objects get name changes or are otherwise 
refactored.

2) You are working with a transpiled Java Object. In this case, 
java.util.Hashtable. You  have to use .get(key) to access its information:

jmolApplet0._applet.viewer.ms.getAuxiliaryInfo(6).__CLASS_NAME__
"java.util.Hashtable"

modata = jmolApplet0._applet.viewer.getAuxiliaryInfo(6).get("moData")
modata.__CLASS_NAME__
"java.util.Hashtable"

and deal with all of those values appropriately as well.








On Fri, Oct 21, 2016 at 7:54 PM, Mark Perri 
> wrote:


Dear users list,


I'm trying to get MO energies and vibrational frequencies from a GAMESS output 
file that I read into JSmol.  Right now I use:

var x = Jmol.getPropertyAsArray(jmolApplet0,"auxiliaryInfo");


Then I iterate over every frame and look at x.models[i].moData.mos and 
x.models[i].modelProperties.Frequency


But for a large file the getPropertyAsArray takes > 10 seconds and freezes 
Firefox while it's loading.  Reading the manual it seems that I can use 
getProperty asynchronously, but I don't understand how to use it properly.


I set a message callback function to handle getProperty, but I'm not sure how 
to actually read in the moData.  It appears to be in arguments[1], but 
everything I try is undefined.  Here's an example of what I've tried.


Thanks,

Mark


var Info = {
width: 450,
height: 450,
debug: false,
color: "white",
addSelectionOptions: false,
serverURL: "http://chemapps.stolaf.edu/jmol/jsmol/php/jsmol.php;,
use: "HTML5",
j2sPath: "/jsmol/j2s",
readyFunction: jmol_isReady,
script: script,
loadStructCallback: "onJSmolLoad",
messageCallback: "processFrames",
disableInitialConsole: true
}


function processFrames()
{

 for (i=0; i! http://sdm.link/slashdot
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users




--
Robert M. Hanson
Larson-Anderson 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

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! 
http://sdm.link/slashdot___

Re: [Jmol-users] Best way to access getproperty with JSmol

2016-10-22 Thread Robert Hanson
If you are interested in just getting one model's auxiliary info, you can
use _M

$ load c:/temp/t.gamess
7 models
46 molecular orbitals in model 1.2
17 molecular orbitals in model 1.7

$ frame 1.7
$ print _M.keys
Energy
EnergyString
dipole
fileName
fileType
initialAtomCount
initialBondCount
moData
modelFileNumber
modelName
modelNumber
modelNumberDotted
modelProperties


>From JavaScript you would use:


info = Jmol.evaluateVar(jmolApplet0, "_M")

Should be relatively efficient.

Alternatively, if you want *instantaneous direct access to that Java object*
you can use

info = jmolApplet0._applet.viewer.ms.am[0].auxiliaryInfo

But two caveats:

1) You are bypassing the interfaces and tapping in to officially
"nonpublic" objects. Sometimes those underlying objects get name changes or
are otherwise refactored.

2) You are working with a transpiled Java Object. In this case,
java.util.Hashtable. You  have to use .get(key) to access its information:

jmolApplet0._applet.viewer.ms.getAuxiliaryInfo(6).__CLASS_NAME__
"java.util.Hashtable"

modata = jmolApplet0._applet.viewer.getAuxiliaryInfo(6).get("moData")
modata.__CLASS_NAME__
"java.util.Hashtable"

and deal with all of those values appropriately as well.








On Fri, Oct 21, 2016 at 7:54 PM, Mark Perri  wrote:

> Dear users list,
>
>
> I'm trying to get MO energies and vibrational frequencies from a GAMESS
> output file that I read into JSmol.  Right now I use:
>
>
> var x = Jmol.getPropertyAsArray(jmolApplet0,"auxiliaryInfo");
>
>
> Then I iterate over every frame and look at x.models[i].moData.mos and
> x.models[i].modelProperties.Frequency
>
>
> But for a large file the getPropertyAsArray takes > 10 seconds and freezes
> Firefox while it's loading.  Reading the manual it seems that I can
> use getProperty asynchronously, but I don't understand how to use it
> properly.
>
>
> I set a message callback function to handle getProperty, but I'm not sure
> how to actually read in the moData.  It appears to be in arguments[1], but
> everything I try is undefined.  Here's an example of what I've tried.
>
>
> Thanks,
>
> Mark
>
>
> var Info = {
> width: 450,
> height: 450,
> debug: false,
> color: "white",
> addSelectionOptions: false,
> serverURL: "http://chemapps.stolaf.edu/jmol/jsmol/php/jsmol.php;,
> use: "HTML5",
> j2sPath: "/jsmol/j2s",
> readyFunction: jmol_isReady,
> script: script,
> loadStructCallback: "onJSmolLoad",
> messageCallback: "processFrames",
> disableInitialConsole: true
> }
>
>
> function processFrames()
> {
>
>  for (i=0; i  {
> console.log(arguments[i])  // I see the model data here, but I
> can't figure out how to access it.
>
>  }
>  console.log ("I've tried a few things here");
> console.log(arguments[1].auxiliaryInfo.models[1]);
> console.log ("But nothing's worked");
> }
>
>
> Jmol.script(jmolApplet0,'getProperty auxiliaryInfo')
>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>


-- 
Robert M. Hanson
Larson-Anderson 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
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] JSmol submenus not working in iOS

2016-10-22 Thread Robert Hanson
Actually, I have neither. My old iPad (kindly donated by Art Cox) finally
bit the dust, and my ancient iPhone got replaced with a Windows phone. So I
have no interest in an iPhone and, for development, I'd much prefer an
iPad.

Otis has offered to loan me an iPad. Thank you, Otis!

Bob


On Sat, Oct 22, 2016 at 4:44 AM, Greeves, Nick 
wrote:

> All Bob needs is an iPhone to test this (although an iPad would be
> better). He certainly used to have one but may have “upgraded”...
>
> All the best
> Nick
> --
> 3D Organic Animations http://www.chemtube3d.com
> Tel: +44 (0)151-794-3506 (3526 Student Support Office)
>
>
> On 22 Oct 2016, at 01:54, jmol-users-requ...@lists.sourceforge.net wrote:
>
> Date: Thu, 20 Oct 2016 12:05:07 -0500
> From: Otis Rothenberger 
> Subject: Re: [Jmol-users] JSmol submenus not working in iOS
> To: jmol-users@lists.sourceforge.net
> Message-ID: <0dd060df-cfcd-4084-a4a6-f5fcf7f79...@icloud.com>
> Content-Type: text/plain; charset="utf-8"
>
> Nick,
>
> I ?buttonize" everything I need in my app, so I never brought the iPad
> Jmol menu issue up, but I agree. It would be nice if it worked in an iPad.
>
> Bob, you were probably joking, but I have a iPad up for grabs! The problem
> I have is it?s in Florida, and I?m in Normal IL for an ISU Chemistry
> Department anniversary celebration. Were you even partly serious in your
> note? If so, I?ll pack it up when I get home.
>
> Otis
>
> --
> Otis Rothenberger
> o...@chemagic.org
> http://chemagic.org
>
>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>


-- 
Robert M. Hanson
Larson-Anderson 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
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] JSmol submenus not working in iOS

2016-10-22 Thread Greeves, Nick
All Bob needs is an iPhone to test this (although an iPad would be better). He 
certainly used to have one but may have “upgraded”...

All the best
Nick
--
3D Organic Animations http://www.chemtube3d.com
Tel: +44 (0)151-794-3506 (3526 Student Support Office)


On 22 Oct 2016, at 01:54, 
jmol-users-requ...@lists.sourceforge.net
 wrote:

Date: Thu, 20 Oct 2016 12:05:07 -0500
From: Otis Rothenberger >
Subject: Re: [Jmol-users] JSmol submenus not working in iOS
To: jmol-users@lists.sourceforge.net
Message-ID: 
<0dd060df-cfcd-4084-a4a6-f5fcf7f79...@icloud.com>
Content-Type: text/plain; charset="utf-8"

Nick,

I ?buttonize" everything I need in my app, so I never brought the iPad Jmol 
menu issue up, but I agree. It would be nice if it worked in an iPad.

Bob, you were probably joking, but I have a iPad up for grabs! The problem I 
have is it?s in Florida, and I?m in Normal IL for an ISU Chemistry Department 
anniversary celebration. Were you even partly serious in your note? If so, I?ll 
pack it up when I get home.

Otis

--
Otis Rothenberger
o...@chemagic.org
http://chemagic.org

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users