CTD Plotter

Overview

     This is a stand alone program written in python with the function of simply and quickly visualizing common CTD data during an expedition. The main window is set up in a manner similar to TPFit, the user should start at the top and work their way down the buttons in order. This is very much a work in progress. Please add any feedback in the Bugs/Comments/Requests section below, or email marone@iodp.tamu.edu and you may pester me about it directly. 

     The program is already located on the PC in DHML on the desktop as this is where the CTD log files will initially be exported to and it will most likely be used. The executable is located in the IODP server at DML\labsystems\CTD_Plotter because it is getting too big to link to this page.

              

Steps to make a plot:

  1. Click on 'Browse Files' and use the file navigation window to choose the up/down log files to import. This program reads the unedited default .csv log files that are created when exporting a cast from the SeaCast software. Once a file is selected the file path will be displayed in the window.

  2. Click on 'Enter Metadata' and a window will appear asking for the EXP, SITE, and HOLE, as well as if you want to plot the up/down cast or both. These entry fields are used to create a title for the plot.

  3. Click on 'Process Data' and a window will appear with a couple different options to choose from. If choosing to smooth the data you must also specify an integer to be used as the window of the running average. Below this you must also specify which axis the depth will be plotted on. 

  4. Click on 'Plot Data' and a window will appear containing your figure. On this figure there are four graphs that can be manipulated independently of each other using the tool bar located on the lower left side of the window. Play around with the tools to tailor the plots to the specific log being used. You may change the spacing between plots and margins of the figure in the x and y direction using . As well as rectangle zoom or pan  each plot to focus on a specific area and the axis will auto update. There is a home button  to revert the figure back to its original state so don't worry about messing around with the tools. Once you are satisfied with the graphs click on the save button and a window will appear allowing you to name the figure, choose where you want to save it, and what file type you want to save it as(.PNG, .JPEG, .pdf, etc...). The image that is saved will only include the white part of the window and will not include the toolbar or file path that are located in the gray part of the window.

Screenshots:

  1. Browse Files

       

2.  Enter Metadata                                                                                                   3. Process Data

                             

4. Plot Data

  

 

Bugs/Comments/Requests:

-X395, I think I may have a way to link all four plots together so when you zoom on one it matches with the others. Need to test and implement.

Can you currently trace up and and down in the same plot? I am not sure if this is yet programmed (Moogy). Jul 6, 2021

-You can now plot both up and down together on the same plot. As far as 'trace' goes on the bottom right of the plot window it shows X, Y coordinates of the cursor. By zooming in to the desired area and tracing with the cursor you can see the exact values for any given point along each line.

Changelog

400T

  • Graphs are now linked together, meaning when user zooms in on one graph all the rest will scale to the same area of interest. This messes up the axis labeling a bit so I am still working on getting it to look nice again.

  • Fixed parsing errors with NaN values in file. Now plotting will ignore these values and leave gaps in the graphs instead for these points.

  • MAC version not created at this time.

  • Added new processing method 'convert pressure (dBar) to depth (m)' using this formula found in the SeaCast documentation: 

    Appendix D – Converting dBar to m in SeaCast
    This formula is found in UNESCO Technical Papers in Marine Science No. 44. This is an empirical
    formula that takes compressibility (that is, density) into account. An ocean water column at 0 °C (t =
    0) and 35 PSU (s = 35) is assumed.
    The gravity variation with latitude and pressure is computed as:
    g (m/sec2) = 9.780318 * [ 1.0 + ( 5.2788x10 -3 + 2.36x10 -5 * x) * x ] + 1.092x10 -6 * p
    where
    x = [sin (latitude / 57.29578) ] 2
    p = pressure (decibars)
    Then, depth is calculated from pressure:
    depth (meters) = [(((-1.82x10 -15 * p + 2.279x10 -10 ) * p - 2.2512x10 -5 ) * p + 9.72659) * p] / g
    where
    p = pressure (decibars)
    g = gravity (m/sec2)

    This allows you to convert to depth for plotting in you only have a pressure export of the data.

395

  • Added automatic header removal of any header size and automatic column sorting so script can now handle more formats of custom exported files from SeaCast. NOTE: Do not rename the column headers. Example: 'Calc SV (m/s)' works but not 'SV (m/s)' 

  • Fixed issue with depth on X axis not working when plotting up/down data together.