Jump to content
Geochemist's Workbench Support Forum

Drew

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by Drew

  1. Hi Brian, I've done some more work on my code to make it more general to detect both the left and right edge of a mineral solubility area from GWB. I edited the post to reflect this. Drew
  2. Hi Brian, I was able to figure this out yesterday using Igor Pro programming. Yes, you are right on how Visual Minteq works to make a similar plot. Thanks for the other suggestions. It will be an interesting challenge to figure it out for a multi-mineral plot. Then on to an E-pH diagram... I'm not sure if many folks use Igor Pro in the geochemistry world or not beyond our little bubble, but if so, here is my code. It isn't terribly pretty and I am sure there are things wrong with it, but I get the same graph out of the data as GWB. Best, Drew Function findAssemblageLine(arrayData, xData, yData, nameOfOutputYWave, nameOfOutputXWave) WAVE arrayData //array data is an i row by j column table from the output of Geochemists Workbench "color map" outpu WAVE yData Wave xData String nameOfOutputYWave //Y data, usually concentration or activity of the y variable String nameOfOutputXWave //X data, pH int arrayRow // i rows in array data int arrayCol // j columns in array data int waveOutYDimSize = DimSize(arrayData, 0) // waveOutYDimSize is the number of points in the Y direction int waveOutXDimSize = DimSize(arrayData, 0) // waveOutXDimSize has to be the number of points in the Y direction of the MAKE /O/N=(waveOutYDimSize) $nameOfOutputYWave //Make output Y wave (overwrites an existing wave) MAKE /O/N=(waveOutXDimSize) $nameOfOutputXWave //Make output X wave (overwrites an existing wave) WAVE waveOutY = $nameOfOutputYWave //Tie local wave to global wave names WAVE waveOutX = $nameOfOutputXWave //step through rows for loop for(arrayRow = 0; arrayRow < DimSize(arrayData, 0);arrayRow++) //ROW For loop for(arrayCol = 0; arrayCol < DimSize(arrayData, 1); arrayCol++) //INNER Column For loop if(arrayData[arrayRow][arrayCol] != 0 && arrayData[arrayRow][arrayCol+1] == 0) //Evaluate if point at (Row,Column) is not equil to zero and the next column in the row is equal to zero. waveOutY[arrayRow] = yData[arrayRow] //Take the value of yData at arrayRow and put it into a new wave waveOutX[arrayRow] = xData[arrayCol+1] //Take the value of xData at the next column over (i.e., the point where the value is 0) in put it into a new wave endif endfor endfor End
  3. Hi Brian, I am guessing that the y-axis (staging path) step size is not fixed? Is there a way to fix it, even if it computationally a bit expensive? The reason I ask is that Igor uses a data structure called a "wave" which can be defined as a y-axis variable with a fixed x-axis step size. A 2-D array could have a scale (step size) for x- and y-axes. It looks like to me that the x-axis (scanning path) is to be fixed - for example a pH step size of 0.1. I'm not fluent at programming in anything, but I guess I would need to write a function that steps through an array of Q/K for each x- and y-axis value and assigns the first instance of Q/K = 0 for each column (pH value) to a row value (Fe(II) concentration). This can be done in Igor or any other programming language. I was just hoping that GWB could output this for me, since it is already doing something nearly close to this to plot a assemblage map. Best, Drew
  4. Hi GWB folks, I'm using Phase2 and P2plot to make solubility plots for several Fe(II) minerals, and am wondering if there is a way to output the data from an assemblage map or a predominance area plot to Excel or another plotting program. It appears to me that the "Edit->Copy As -> text (space delimited)" option is greyed out for P2plot. In the past I've used output from Visual Minteq and our plotting program of choice (Igor Pro) to make plots like this. We recently published several of these in a paper. I've attached a figure to show what I'm talking about. These plots represent equilibrium Fe(II) solubility in the presence of Fe(OH)2 and thus are not a true predominance area or assemblage map. Ideally I'd like to be able to run a Phase2 calculation and export traces from a P2plot of the assemblage map to Igor Pro. There are many reasons I have for this, but probably greatest among them is that that program allows much finer control over fine tuning of plot styles. (For example a major pet peeve of mine is that the y-axis of a P2plot has value labels of ".01, .1, etc." rather than "0.01, 0.1" etc. Is this a planned feature? Is there any way to kluge a work around for the time being? I've tried running a similar calculation in React, but it doesn't do predominance area or assemblage maps. Thanks, Drew Latta University of Iowa Dept. Civil & Environmental Eng.
×
×
  • Create New...