Jump to content
Geochemist's Workbench Support Forum
Julie

Multiple minerals from multiple analyses in SpecE8

Recommended Posts

Hi there,

 

I'm using SpecE8 in GWB v7.0.6 and running a standard script (p269 of the Reference Manual) to determine saturation indices for multiple analyses. I'm wondering if there's a way to get an output of multiple mineral phases that reach saturation for each set of analyses without specifying what the minerals are in the script. The example on p269 specifies Calcite (and CO2 fugacity) [see script below] but I'm wanting an output of all potential mineral phases that I can export to excel.

 

if {[report success]} {

puts $out_id \

"[report fugacity CO2(g)]\t[report SI Calcite]"

 

Can any one tell me if this is possible and if so what to include in the script to achieve it?

 

Thank you!

Julie

Share this post


Link to post
Share on other sites
Hi there,

 

I'm using SpecE8 in GWB v7.0.6 and running a standard script (p269 of the Reference Manual) to determine saturation indices for multiple analyses. I'm wondering if there's a way to get an output of multiple mineral phases that reach saturation for each set of analyses without specifying what the minerals are in the script. The example on p269 specifies Calcite (and CO2 fugacity) [see script below] but I'm wanting an output of all potential mineral phases that I can export to excel.

 

if {[report success]} {

puts $out_id \

"[report fugacity CO2(g)]\t[report SI Calcite]"

 

Can any one tell me if this is possible and if so what to include in the script to achieve it?

 

Thank you!

Julie

 

Hi Julie:

 

Sorry for the delay- since I'm not much of a programmer, I had to consult the GWB developers on this. I'll relay their advice to the best of my understanding.

 

You can accomplish this in one of two ways. The first is to set up a loop that cycles through all the minerals in the database and report those with saturation index reaching a certain criteria. For example, to report all minerals with SI > -5, use the following code:

 

set minerals [eval report all_minerals]
  foreach min $minerals {
  set si [eval report SI $min]
  if { $si > -5.0 } {
	 puts "$min $si"
  }
  }

 

There is one problem with this- the control script seems to fail for multi-word minerals in the database such as "Sanidine high". One work-around would be to remove spaces from multi-word minerals in the database, but this is tedious and less desirable.

 

A better approach would be to use GWB Professional's Remote Control feature. You can read about the Remote Control feature in the appendices of the GWB v7 Reference Manual. An example Tcl remote control script that accomplishes the same thing, but does not run into the multi-word issue:

 

source RC_helper.tcl
OpenGwbApplic {"/Program Files/gwb/spece8.exe"} SendCommand "read freshwater.sp8"

SendCommand "report all_minerals" minerals
foreach min $minerals {
  SendCommand "report SI \"$min\"" si
  if { $si > -5.0 } {
  puts "$min $si"
  }
}

SendCommand quit

 

There's a higher learning curve involve with the latter approach, but in the long run this will open the door to extremely powerful applications.

 

I hope that gets you going in the right direction!

 

Tom

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×