[CHNOSZ-commits] r187 - in pkg/CHNOSZ: . R data inst

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Apr 25 13:19:56 CEST 2017


Author: jedick
Date: 2017-04-25 13:19:56 +0200 (Tue, 25 Apr 2017)
New Revision: 187

Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/R/diagram.R
   pkg/CHNOSZ/data/refs.csv
   pkg/CHNOSZ/inst/NEWS
Log:
diagram(): draw blank areas for NaN values from equilibrate() 


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2017-03-20 12:46:58 UTC (rev 186)
+++ pkg/CHNOSZ/DESCRIPTION	2017-04-25 11:19:56 UTC (rev 187)
@@ -1,6 +1,6 @@
-Date: 2017-03-20
+Date: 2017-04-25
 Package: CHNOSZ
-Version: 1.0.8-75
+Version: 1.0.8-76
 Title: Chemical Thermodynamics and Activity Diagrams
 Author: Jeffrey Dick
 Maintainer: Jeffrey Dick <j3ffdick at gmail.com>

Modified: pkg/CHNOSZ/R/diagram.R
===================================================================
--- pkg/CHNOSZ/R/diagram.R	2017-03-20 12:46:58 UTC (rev 186)
+++ pkg/CHNOSZ/R/diagram.R	2017-04-25 11:19:56 UTC (rev 187)
@@ -142,14 +142,18 @@
   predominant <- NA
   if(plotvar %in% c("loga.equil", "alpha", "A/2.303RT")) {
     pv <- plotvals
-    for(i in 1:length(pv)) {
-      # change any NAs in the plotvals to -Inf, so that 
-      # they don't get on the plot, but permit others to
-      pv[[i]][is.na(pv[[i]])] <- -Inf
-      # TODO: see vignette for an explanation for how this is normalizing
-      # the formulas in a predominance calculation
-      if(normalize & eout.is.aout) pv[[i]] <- (pv[[i]] + eout$species$logact[i] / n.balance[i]) - log10(n.balance[i])
-      else if(as.residue & eout.is.aout) pv[[i]] <- pv[[i]] + eout$species$logact[i] / n.balance[i]
+    # some additional steps for affinity values, but not for equilibrated activities
+    if(eout.is.aout) {
+      for(i in 1:length(pv)) {
+        # change any NAs in the plotvals to -Inf, so that 
+        # they don't get on the plot, but permit others to
+        # (useful for making mineral stability diagrams beyond transition temperatures of one or more minerals)
+        pv[[i]][is.na(pv[[i]])] <- -Inf
+        # TODO: see vignette for an explanation for how this is normalizing
+        # the formulas in a predominance calculation
+        if(normalize) pv[[i]] <- (pv[[i]] + eout$species$logact[i] / n.balance[i]) - log10(n.balance[i])
+        else if(as.residue) pv[[i]] <- pv[[i]] + eout$species$logact[i] / n.balance[i]
+      }
     }
     predominant <- which.pmax(pv)
   }

Modified: pkg/CHNOSZ/data/refs.csv
===================================================================
--- pkg/CHNOSZ/data/refs.csv	2017-03-20 12:46:58 UTC (rev 186)
+++ pkg/CHNOSZ/data/refs.csv	2017-04-25 11:19:56 UTC (rev 187)
@@ -105,7 +105,7 @@
 SLOP15.4,"E. L. Shock et al.",2015,"slop15.dat computer data file","adipic acid and n-dodecanoate: "Gibbs free energy corrected to be compatible with the equation ΔG=ΔH-TΔS for the formation reaction from elements. See footnote y in table 4 of @Sho95."",http://geopig.asu.edu/?q=tools
 SLOP15.5,"E. L. Shock et al.",2015,"slop15.dat computer data file","n-octanoate: "Enthalpy corrected to be compatible with the equation ΔG=ΔH-TΔS for the formation reaction from elements. See footnote ab in table 4 of @Sho95."",http://geopig.asu.edu/?q=tools
 SLOP15.6,"E. L. Shock et al.",2015,"slop15.dat computer data file",""Enthalpy corrected to be compatible with the equation ΔG=ΔH-TΔS for the formation reaction from elements."",http://geopig.asu.edu/?q=tools
-SLOP15.7,"E. L. Shock et al.",2015,"slop15.dat computer data file","heptanol, hexanol, and octanol: "Minor differences in Gibbs energy, entropy, omega, a1, a2, a3, a4 and c1 values compared to @SH90."",http://geopig.asu.edu/?q=tools
+SLOP15.7,"E. L. Shock et al.",2015,"slop15.dat computer data file","hexanol, heptanol, and octanol: "Minor differences in Gibbs energy, entropy, omega, a<sub>1</sub>, a<sub>2</sub>, a<sub>3</sub>, a<sub>4</sub> and c<sub>1</sub> values compared to @SH90."",http://geopig.asu.edu/?q=tools
 CS16,"P. A. Canovas III and E. L. Shock",2016,"Geochim. Cosmochim. Acta 195, 293-322","citric acid cycle metabolites",http://dx.doi.org/10.1016/j.gca.2016.08.028
 CS16.1,"P. A. Canovas III and E. L. Shock",2016,"Geochim. Cosmochim. Acta 195, 293-322","citric acid species HKF a<sub>1</sub>--a<sub>4</sub> parameters",http://dx.doi.org/10.1016/j.gca.2016.08.028
 CHNOSZ.1,"J. M. Dick",2017,"CHNOSZ package documentation","GHS (T<sub>r</sub>) of the phase that is stable at 298.15 K was combined with H<sub>tr</sub> and the Cp coefficients to calculate the metastable GHS (T<sub>r</sub>) of the phases that are stable at higher temperatures.",http://chnosz.net

Modified: pkg/CHNOSZ/inst/NEWS
===================================================================
--- pkg/CHNOSZ/inst/NEWS	2017-03-20 12:46:58 UTC (rev 186)
+++ pkg/CHNOSZ/inst/NEWS	2017-04-25 11:19:56 UTC (rev 187)
@@ -1,4 +1,4 @@
-CHANGES IN CHNOSZ 1.0.8-75 (2017-03-20)
+CHANGES IN CHNOSZ 1.0.8-76 (2017-04-25)
 ---------------------------------------
 
 DOCUMENTATION:
@@ -109,13 +109,13 @@
   were first present in sprons92.dat from SUPCRT, slop98.dat, or later
   versions of the slop data files (http://geopig.asu.edu/?q=tools).
 
-- Canovas_aq.csv: Add data for citric acid cycle metabolites from
+- biotic_aq.csv: Add data for citric acid cycle metabolites from
   Canovas and Shock, 2016.
 
 - CHNOSZ_aq.csv: Add H4SiO4 pseudospecies (pseudo-H4SiO4); see
   calculations in eos-regress.Rmd.
 
-- Dick_aq.csv: Add data for aqueous phenanthrene and methylphenanthrene
+- organic_aq.csv: Add data for aqueous phenanthrene and methylphenanthrene
   from Dick et al., 2013.
 
 - Remove superseded data previously in OBIGT-2.csv: citric acid cycle
@@ -149,7 +149,7 @@
 
 BUG FIXES:
 
-- Correct charge (-2) of NAD(red)-2 in LaRowe_aq.csv. Thanks to Peter
+- Correct charge (-2) of NAD(red)-2 in biotic_aq.csv. Thanks to Peter
   Canovas.
 
 - Also correct charge (-2) of MgATP-2.
@@ -160,6 +160,10 @@
   noted for the first example in ?nonideal. Thanks to David T. Wang for
   the bug report and test.
 
+- NaN values from equilibrate() are now preserved by diagram(),
+  producing unlabeled blank (white) fields rather than being
+  mistakenly labeled with the first species.
+
 OTHER CHANGES:
 
 - Remove msgout(), and replace previous calls to that function with



More information about the CHNOSZ-commits mailing list