User Tools

Site Tools


microprofiling:mprplotter_howto

MPR-plotter

An open source application (written in Scilab) for the analysis of concentration profiles and times-series. It consists of several files that can be executed in Scilab and that provide functions listed below:

  • User-defined signal calibration.
  • Rapid visualization of measured profiles, calculation of spatial gradients, fluxes and arel contents (getdSdz.sci)
  • Rapid visualization of concentration time-series, calculation of rates of change of analyte concentrations (getdSdt.sci).
  • Conversion of data files generated by DOMS to the mpr-plotter compatible format (diverlogger2mpr.sci, diverlogger2dat.sci).
  • Conversion of data files generated by Unisense' Profix to the mpr-plotter compatible format (unisense2mpr.sci, unisense2dat.sci).

Note: The mprplotter program was written to make the viewing and analysis of profiles and time-series faster, more convenient and (to some extend) standardized. You can, naturally, use any other program. This program was written basically because many users may find the “excel-spreadsheet-approach” rather cumbersome, and especially unsuitable for large data-sets. Thus, one will probably appreciate the real power of the program only when dealing with large data-sets, because one may initially get an impression that plotting and analyzing only a few profiles could be done much faster in spreadsheet programs such as excel.


getdSdz.sci

getdSdz.sci allows rapid analysis of mpr files (e.g., those generated by m-Profiler or the conversion utilities listed here), including profile visualization and calculation of spatial gradients, fluxes and areal contents, as shown in this schematic diagram and instructed below:

Calibrate, display and export profiles

  1. Double-click on getdSdz.sci to start the program. This will open the main Scilab window, where any messages generated by the program will be later displayed, plus the SciPad editor window, showing the executable source code of the program.
  2. In SciPad, choose Execute→Load into Scilab from the menu or press Ctrl+l to start the getdSdz program. This will open the graphical user interface (GUI) window through which all the available functions can be executed.
    • Note: always keep an eye on the main Scilab window for messages. They are useful!
  3. Choose Action→Define input file preferences, and
    • define the total number of channels recorded in the mpr file,
    • define the name of the analyte you want to display (e.g., O2, NO3-),
    • define the number of the channel containing the data for this analyte (i.e., ch=1 for the first data-column, ch=2 for the second, etc.).
    • Then, define the z-tolerance dz. This number is used when averaging the values recorded at each depth during micro-profiling. The program goes through the data-set, and averages all subsequent readings whose depths (z) do not differ by more than dz. For example, if your depths vary by +/- 2 um, such as because of the motor “wiggling” during the measurement, and you want to consider these values to represent readings at one depth, set z-tolerance to 2. If you don’t want to average readings, set z-tolerance to 0.
  4. Choose Action→Load input file and select the input mpr file containing your micro-profile data.
  5. Choose Action→Define calculation preferences, and
    • define the diffusion coefficient in cm2 s-1,
    • define the z-factor, which is the ratio between the units of depth in your profiles and cm (for example, if your depth is in um, i.e., um=10^{-6} m, cm=10^{-2} m, set z-factor to um/cm=1e-4),
    • define the surface offset (in cm), which is the difference between the sediment surface (i.e., z=0) in your profiles and the real sediment surface.
  6. Choose Action→Define calibration to define calibration for the particular analyte you are going to display and analyze. The calibration can be defined in two ways:
    • By explicitly writing the formula expressing concentration, c, as a function of signal, s, e.g., c=0.1+2*s, or c=0.2*ln(s.^2-0.01). In this case, you will also need to enter the formula for the standard deviation of concentration, dc, calculated from the standard deviation of the signal, ds, e.g., dc=2*ds, or dc=0.4*ds.*s./(s.^2-0.01). Note the dot (.) before the multiplication (*), division (/) and exponent (^) signs. This is a Scilab notation, and must be used to avoid syntax errors!
    • In case the calibration function is linear, it can be specified by entering two concentration values, c1 and c2, and the corresponding two signal values, s1 and s2. These values are used when c=f(s) and dc=f(ds) are empty. Note that the use of c1=0, s1=0, c2=1, s2=1 corresponds to no calibration, i.e., the raw data will be plotted (default).
  7. Choose Action→Display preferences to verify that all your preferences are set correctly.
  8. Choose Action→Save preferences to save the currently set preferences in an *.ini file. You can load them anytime, e.g., at the beginning of your next mprplotter session, by selecting Action→Load preferences. (Note: if you share this file, along with the *.mpr file containing your raw data-set, with your colleague, you can both view and analyze the profiles in the same way without the need of transferring huge and complex spread sheet files.)
  9. Once all the necessary program preferences have been set, you can display the profiles through the Profiles menu. Choose Profiles→Profile_1 to display the 1st profile, Profiles→Profile_2 to display the 2nd profile, Profiles→ALL to display all profiles in the mpr file. If you want to display only selected profiles, e.g., profile 1, 3, 4, 5, then choose Profiles→Specify and set range to [1,3:5], which is the Scilab syntax for 1, 3, 4, 5. After the profiles have been displayed, place the legend with the times at which the profiles were taken somewhere in the graph window.
  10. Choose Action→Define graph scaling to define min/max range of the x/y axes.
  11. Choose File→Export, select Postcript, Color, Portrait, and click OK to export the graph into an encapsulated postscript file (EPS). This file can be viewed by Ghostview (freeware, see http://pages.cs.wisc.edu/~ghost/), printed directly by a postscript printer, or included in a LaTeX, Word, or PowerPoint document. Alternatively, select Enhanced Meta File, Color, Portrait, and click OK to export the graph into an enhanced metafile file (EMF), which is, however, of lower quality, although perhaps friendlier with the Microsoft Office programs.
  12. Sometimes, due to the drift in sensor off-set or sensitivity, the calibration applied to the sensor signal changes and thus needs to be dynamically corrected. For example, the off-set of the pH sensor signal is known to drift with time. Also, the drift in sensitivity, i.e., the range of the sensor signal corresponding to a range in concentration, is possible for some sensors. The mpr-plotter enables you to correct for these drifts through the Action→Define correction menu. Learn more about corrections here.
  13. Choose Save→Save displayed profiles in the mprplotter GUI window to export all displayed profiles, e.g., calibrated and corrected, as DAT files. The first, second and third columns correspond to depth, concentration and standard deviation of concentration, respectively. The directory where these profiles are saved is displayed in the main Scilab window during export. These profiles can be imported into a third-party program such as Origin or SigmaPlot to produce graphs ready for publication. Also, they can be directly loaded by calfluxrate for fitting and calculating spatial distribution of rates.
  14. Choose Save→Export all profiles for L@MP in the mprplotter GUI window to export all profiles in the format ready for the analysis using L@MP.

Calculate fluxes and areal inventory from profiles

Once a profile or several profiles are displayed, and the diffusion coefficient is defined, the fluxes and areal contents are calculated as follows.

  1. Click on ADD_LEFT in the menu. Then click with a left mouse button on the graph of the profile in the left end of the interval in which you wish to calculate the flux. The selected point(s) will be highlighted by a red symbol(s). Right-click with the mouse to confirm the currently selected point(s).
  2. Click on ADD_RIGHT in the menu. Then click with a left mouse button on the graph of the profile in the right end of the interval in which you wish to calculate the flux. The selected point(s) will be highlighted by a blue symbol(s). Right-click with the mouse to confirm the currently selected point(s).
  3. Click on Get_SLOPE. Gradients and fluxes will be calculated for each shown profile and displayed in the main Scilab window, as shown below. This is done by fitting the profile in the interval between the left and right boundary points by a linear function.
  4. Click on Integrate_c. Areal content of the analyte in the interval specified by the left and right boundary points will be calculated for each shown profile and displayed in the main Scilab window, as shown below.

Calculate fluxes and rates

As of version 1.02 of mprplotter, the calculation of depth profiles of fluxes and volumetric rates for individual profiles is done through the menu Calculation → Calculate rates (R(z) = -D d^2c/dz^2) for all depths.

Parameters required for successful execution of this feature are defined through the menu Settings → Calculation settings. Read the older version of the calfluxrate manual to get an idea about the algorithm used and the meaning of the parameters.


getdSdt.sci

getdSdt.sci allows rapid analysis of dat files (e.g., those generated by m-Profiler, DAQ-server or the conversion utilities listed here), including time-series visualization and calculation of rates of change, as shown in this schematic diagram and instructed below:

View time series

  1. Double-click on getdSdt.sci to start the program that enables you to view time-series. This will open the main Scilab window, where any messages generated by the program will be later displayed, plus the SciPad editor window, showing the executable source code of the program. In SciPad, choose Execute→Load into Scilab from the menu or press Ctrl+l to start the getdSdt program. This will open the graphical user interface (GUI) window through which all the available functions can be executed.
  2. Note: always keep an eye on the main Scilab window for messages. They are useful!
  3. Choose Action→Define input file preferences, and
    • define the total number of channels recorded in the dat file,
    • define the name of the analyte you want to display (e.g., O2, NO3-),
    • define the number of the channel containing the data for this analyte (i.e., ch=1 for the first data-column, ch=2 for the second, etc.).
  4. Choose Action→Load input file and select the input files *.dat, *.0, *.1, etc., containing the time-series data. Hold Ctrl to select multiple files.
  5. Choose Action→Plot channel to plot the channel readings as a function of time.
  6. Choose Action→Define calibration to define calibration for the particular analyte you are going to display and analyze. The calibration can be defined in two ways:
    • By explicitly writing the formula expressing concentration, c, as a function of signal, s, e.g., c=0.1+2*s, or c=0.2*ln(s.^2-0.01). In this case, you will also need to enter the formula for the standard deviation of concentration, dc, calculated from the standard deviation of the signal, ds, e.g., dc=2*ds, or dc=0.4*ds.*s./(s.^2-0.01). Note the dot (.) before the multiplication (*), division (/) and exponent (^) signs. This is a Scilab notation, and must be used to avoid syntax errors!
    • In case the calibration function is linear, it can be specified by entering two concentration values, c1 and c2, and the corresponding to two signal values, s1 and s2. These values are used when c=f(s) and dc=f(ds) are empty. Note that the use of c1=0, s1=0, c2=1, s2=1 corresponds to no calibration, i.e., the raw data will be plotted (default).
  7. Choose Action→Plot channel to plot the concentrations as a function of time.
  8. Use Zoom→In and Zoom→Out to view regions of interest in more or less detail, respectively.
  9. As mentioned here or here, one can enter comments during data-recording measurements. These are written into the output file as text lines preceded by a hash (#) character. During processing of the input file by getdSdt, these comments lines are gathered in one file (tmp\*-datcom.txt; check the main Scilab window for exact filename), which makes it easier to view all the comments written during the experiment and associate them with the time-progress of the sensor signal.

Calculate rates of change

Once the time-series are displayed, the rates of change in the analyte concentration with time are calculated as follows.

  1. Click on ADD_LEFT in the menu. Then click with the left mouse button on the graph in the left end of the time-interval in which you wish to calculate the rate. The selected point will be highlighted by a red symbol. Right-click with the mouse to confirm the currently selected point.
  2. Click on ADD_MIDDLE in the menu. Then click with the left mouse button on the graph in the middle point of the time-interval in which you wish to calculate the rate. The selected point will be highlighted by a green symbol. Right-click with the mouse to confirm the currently selected point.
  3. Click on ADD_RIGHT in the menu. Then click with the left mouse button on the graph of the profile in the right end of the interval in which you wish to calculate the rate. The selected point will be highlighted by a blue symbol. Right-click with the mouse to confirm the currently selected point.
  4. Click on Get_SLOPES. Slopes of the time-series will be calculated by fitting the data points between the left and middle (left slope) and middle and right (right slope) points. These slopes, together with the difference (left – right) are displayed in the main Scilab window, as shown in figure below.


Convert DOMS data to MPRPLOTTER format

  1. Open the DOMS-generated TXT file in a text editor (e.g. notepad, but not Word or the likes!) and visually inspect it to check whether the data are formatted consistently.
  2. Open the diverlogger2mpr.sci or diverlogger2dat.sci file, depending whether you want to view and analyze the DOMS data as profiles or time-series, in the Scilab editor.
  3. Execute the program by selecting Execute→Load in Scilab from the editor menu.
  4. Specify the necessary parameters and the input filename.
  5. The converted file will be stored in the same directory and will have an extension dat or mpr.

Convert Unisense Profix data to MPRPLOTTER format

  1. Open the unisense2mpr.sci or unisense2dat.sci file, depending whether you want to view and analyze the Profix data as profiles or time-series, in the Scilab editor.
  2. Change the filenames of the input and output data files.
  3. Modify the parameters according to the comments available in the unisense2mpr.sci or unisense2dat.sci files (comments = lines starting with forward slashes).
  4. Execute the program by selecting Execute→Load in Scilab from the editor menu. This will create the output file with the specified filename.

Convert data to L@MP format

Choose Save→Export all profiles for L@MP in the mprplotter/getdSdz GUI window to export all profiles in the format ready for the analysis using L@MP.


Download mprplotter

Download the Scilab source files from the Download center.

microprofiling/mprplotter_howto.txt · Last modified: 2013/10/22 10:40 by lpolerec

Page Tools