Jump to content
Geochemist's Workbench Support Forum

Search the Community

Showing results for tags 'python'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • The Geochemist's Workbench
    • The Geochemist's Workbench
  • The Geochemist's Workbench Community
    • The Geochemist's Workbench Community

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Location


Interests

Found 2 results

  1. I am trying to write the log10 total molality of Np(V) to file using python. The present line looks like this: fobj_ResultFile.write(Testcase + '\t' + '1180' + '\t' + 'log10(conc_oxidationstate(NpO2<+>))' + '\t'+ str(math.log10(myGWB.results('concentration "NpO2+"', 'molal')[0])) + '\n') A normal export for a single species looks like this fobj_ResultFile.write(Testcase + '\t' + '1181' + '\t' + 'log10(conc_solute(Ca[NpO2(OH)2]<+>))' + '\t'+ str(math.log10(myGWB.results('concentration aqueous "Ca[NpO2(OH)2]+"', 'molal')[0])) + '\n') My opinion was that by omitting the "aqueous" behind "concentration" would cause GWB to export the total molality of the given oxidationstate, as defined by the redox species (NpO2+ in this case). Instead, what I observe, is that the concentration of the species NpO2+ is exported. What I would like to have is the total sum of all Np(V)-species in solution. Any ideas appreciated. Helge
  2. Hello everybody, in the attached test case I can retrieve all concentrations with species = myGWB.results("species") conc = myGWB.results("concentration aqueous", "mol/kg") print "\nThere are" , len(species) , "aqueous species.\n" for i in range(len(species)): print "%-4s = %10.4g mol/kg" % (species[i], conc[i]) However, if I export the results to file with ResultFile = Testcase + '_mod.out' fobj_ResultFile = open(ResultFile,'w') fobj_ResultFile.write(Testcase + '\t' + 'pcH' + '\t' + str(-(math.log10(myGWB.results('concentration aqueous H+', 'molal')[0]))) + '\n') fobj_ResultFile.write(Testcase + '\t' + 'conc_element(Nd)' + '\t' + str(myGWB.results('concentration Neodymium', 'molal')[0]) + '\n') fobj_ResultFile.write(Testcase + '\t' + 'conc_solute(Nd(OH)2<+>)' + '\t' + str(myGWB.results('concentration aqueous Nd(OH)2+', 'molal')[0]) + '\n') fobj_ResultFile.write(Testcase + '\t' + 'conc_solute(Nd(OH)<2+>)' + '\t' + str(myGWB.results('concentration aqueous Nd(OH)++', 'molal')[0]) + '\n') fobj_ResultFile.write(Testcase + '\t' + 'conc_solute(Nd<3+>)' + '\t' + str(myGWB.results('concentration aqueous Nd+++', 'molal')[0]) + '\n') fobj_ResultFile.write(Testcase + '\t' + 'conc_solute(Nd(OH)3<0>)' + '\t' + str(myGWB.results('concentration aqueous Nd(OH)3', 'molal')[0]) + '\n') fobj_ResultFile.write(Testcase + '\t' + 'conc_solute(Nd(OH)4<->)' + '\t' + str(myGWB.results('concentration aqueous Nd(OH)4-', 'molal')[0]) + '\n') fobj_ResultFile.write(Testcase + '\t' + 'conc_solute(NdCl<2+>)' + '\t' + str(myGWB.results('concentration aqueous NdCl++', 'molal')[0]) + '\n') fobj_ResultFile.write(Testcase + '\t' + 'conc_solute(NdCl2<+>)' + '\t' + str(myGWB.results('concentration aqueous NdCl2+', 'molal')[0]) + '\n') fobj_ResultFile.write(Testcase + '\t' + 'conc_solute(Ca[Nd(OH)3]<2+>)' + '\t' + str(myGWB.results('concentration aqueous Ca[Nd(OH)3]++', 'molal')[0]) + '\n') fobj_ResultFile.write(Testcase + '\t' + 'conc_solute(Ca2[Nd(OH)4]<3+>)' + '\t' + str(myGWB.results('concentration aqueous Ca2[Nd(OH)4]+++', 'molal')[0]) + '\n') fobj_ResultFile.write(Testcase + '\t' + 'conc_solute(Ca3[Nd(OH)6]<3+>)' + '\t' + str(myGWB.results('concentration aqueous Ca3[Nd(OH)6]+++', 'molal')[0]) + '\n') fobj_ResultFile.close() concentrations for species whose name contains [ and ] are exported as -999999.0. I fail to locate my mistake. Best regards, Helge Helge 0043.rea Nd.dat 0043_mod.py 0043_mod.out
×
×
  • Create New...