● Preparing data sets ● CTD Data from Tomales Bay ● Clean up ● Binning ● Combined Temperature-Depth plots ● T-S scatter plots ● Multiple plots on a single.

Slides:



Advertisements
Similar presentations
Working with Profiles in IX1D v 3 – A Tutorial © 2006 Interpex Limited All rights reserved Version 1.0.
Advertisements

Lab # 03- SS Basic Graphic Commands. Lab Objectives: To understand M-files principle. To plot multiple plots on a single graph. To use different parameters.
Introduction to Engineering MATLAB – 11 Plotting - 4 Agenda Multiple curves Multiple plot.
2D Plots 1 ENGR 1181 MATLAB 12.
Excel Charts – Basic Skills Creating Charts in Excel.
DATA RETRIEVAL AND GUI CREATION DAVID COOPER SUMMER 2014.
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved. Office Excel 2003 Lab 2 Charting Worksheet Data.
1 Introduction to MatLab MatLab stands for Matrix Laboratory. As the name suggests most of the programming operations have as input or output a matrix.
MATLAB Week 3 17 November Outline Graphics – Basic plotting – Editing plots from GUI – Editing plots from m-file – Advanced plotting commands.
NU Data Excel Orientation Graphing of Screening Data and Basic Graphing Functions.
Python plotting for lab folk Only the stuff you need to know to make publishable figures of your data. For all else: ask Sourish.
Introduction to Matlab Jianguo Wang CSSCR September 2009.
An introduction to Plotting in MATLAB Rikard Johansson Department of Biomedical Engineering (IMT) Linköping University
Objectives Understand what MATLAB is and why it is widely used in engineering and science Start the MATLAB program and solve simple problems in the command.
06. Excel Charts. File -> Open -> 06b-datastart.xlsx.
1 Functions 1 Parameter, 1 Return-Value 1. The problem 2. Recall the layout 3. Create the definition 4. "Flow" of data 5. Testing 6. Projects 1 and 2.
Chapter 9 Creating and Designing Graphs. Creating a Graph A graph is a diagram of data that shows relationship among a set of numbers. Data can be represented.
MATLAB Tutorial EE 327 Signals and Systems 1. What is MATLAB? MATLAB – Matrix Laboratory The premier number-crunching software Extremely useful for signal.
Getting Started with MATLAB 1. Fundamentals of MATLAB 2. Different Windows of MATLAB 1.
Advanced Stata Workshop FHSS Research Support Center.
Session 9 Managerial Spreadsheet Modeling -- Prof. Juran1.
Introduction to Matlab  Matlab is a software package for technical computation.  Matlab allows you to solve many numerical problems including - arrays.
EGR 115 Introduction to Computing for Engineers Designing The Battleship Game in MATLAB Monday 22 Sept 2014 EGR 115 Introduction to Computing for Engineers.
Data Analysis GUI Documentation guide. Terminology GUI – Graphical User Interface Log-File – File containing data of interest which is generated by user’s.
Advanced Charts Lesson 9. Objectives 1. Create charts by using data from other applications. 2. Modify chart types. 3. Add and modify chart options. 4.
Curve Fitting the Calibration Data of a Thermistor Voltage Divider Portland State University Department of Mechanical Engineering ME 121: Engineering Problem.
How to use MATLAB (using M-files) Double click this icon To start Matlab 6.5.
Reading and Writing Image Files
EMPA Statistical Analysis
Multi-Axis Tabular Loads in ANSYS Workbench
Physics 114: Supplemental
Release Numbers MATLAB is updated regularly
Examples, examples: Outline
Downloading and Preparing a StudentVoice File for SPSS
Computer Application in Engineering Design
Loops BIS1523 – Lecture 10.
Event loops 16-Jun-18.
Lecture 25.
Computer 4 JEOPARDY Bobbie, Sandy, Trudy.
Statistical Analysis with Excel
Microsoft Excel A Spreadsheet Program.
Ch3 Graphics Overview of Plotting Editing Plots
Intro to PHP & Variables
Outline Matlab tutorial How to start and exit Matlab Matlab basics.
MATLAB DENC 2533 ECADD LAB 9.
User Defined Functions
Cookies BIS1523 – Lecture 23.
ECONOMETRICS ii – spring 2018
Macrosystems EDDIE: Getting Started + Troubleshooting Tips
Statistical Analysis with Excel
Advanced Data Import & Export Jeff Henrikson
Statistical Analysis with Excel
MATLAB How to use (using M-files) Double click this icon
MATLAB Tutorial Dr. David W. Graham.
Event loops.
Using Charts in a Presentation
MATLAB How to use (using M-files) Double click this icon
MatLab – 2D Plots 2 MATLAB has many built-in functions and commands to create various types of plots. Instructor notes: We start with an example of some.
Microsoft Office Access 2003
Tutorial 2 SEG7550 Introduction to MATLAB II
Microsoft Office Access 2003
Introduction to TouchDevelop
Exercise 1 Modify some parameters in the histogram.js and see what would happen (one by one) 20 in Line 2  in Line 3  in Line 15  .9.
Event loops 17-Jan-19.
funCTIONs and Data Import/Export
Notes about Homework #4 Professor Hugh C. Lauer CS-1004 — Introduction to Programming for Non-Majors (Slides include materials from Python Programming:
Event loops 8-Apr-19.
Event loops.
Event loops.
Event loops 19-Aug-19.
Presentation transcript:

● Preparing data sets ● CTD Data from Tomales Bay ● Clean up ● Binning ● Combined Temperature-Depth plots ● T-S scatter plots ● Multiple plots on a single figure ● What haven't you learned in this class? Outline

Preparing Data ● Data needs to be prepped for loading into matlab. – Comment out all extraneous (usually non-number) material that matlab can't use. – Make sure there are no empty elements – fill with missing data. – Use a consistent symbol or marker for problem data ● If you are using excel, I suggest looking into the Matlab Excel Toolbox, particularly for time series data. – Lets you pull and push data from excel to matlab – Converts times and dates to matlab format for you – You will still need to have relatively clean and organized data

Example: CTD data from Tomales Bay ● CTD stands for conductivity, temperature, depth. ● Measures temperature and salinity (as well as other things) as a function of depth underwater. ● Lowered into water from a boat on a rope down to a certain depth and then raised. ● Take a look at a data file in z:\Pkg\WFCB\class5\data\tomales to see format. ● I have modified the files somewhat so they can easily be loaded. ● Meanings of each column are specified in the header of the files.

Basic plot ● A standard and interesting plot from a CTD is temperature (along the x-axis) vs. depth (along the y- axis) ● Exercise: Do this plot for the data file 13Oct2005_2108.cnv ● Hint: You will probably want to reverse the direction of the depth so that deeper is at the bottom. ● Correct plot is on next slide.

Depth / Temperature plot (1) Calibration (2) Downcast (3) Upcast (4) Surface Stratification (5) At surface

Cleaning up data ● Typically, only downcast is used as it is generally more accurate and has quicker response time. ● Also, need to remove calibration data near surface. ● Manufacturer has lots of GOOD programs to do this, but basic stuff can be done in matlab. ● Exercise: Remove upcast data and data within 0.5 meters of surface. Put code in a script so that you can later do it for all data files. Finally replot. ● Hint: Use the maximum depth to define split between down and up. ● Exercise 2: Make a function that would do this data cleanup for an arbitrary data matrix.

Binning data ● The next step is to bin data into depth bins. ● Again, manufacturer has programs for this. ● Exercise: Bin data so by the average value over every 0.5 meters starting at 0.5 meters depth. Then replot. ● Hint: Make a list of bin starting and ending points and then step through the list and compute average values. ● Hint: You will need to check to see if a bin actually has data. If not, then use NaN. continue might be useful for doing this. ● Exercise 2: Make a function that would do the binning for an arbitrary data matrix.

Loading in all the data ● So now that we know how to process one dataset, how about all of them. ● Files are numbered: “06” is at Tomales mouth, “08” is 2 km from mouth,..., “15” is 18 km from mouth. ● Exercise: Load and process all of the data files. As there are only ten, you could do each one separately. Or, you could use a more advanced approach and load them all using iteration. ● Hint: If doing each separately, cut & paste in a script. ● Hint: If using iteration, you might use a cell array to store filenames. ● Hint: Use a 3-D array to store all the results.

Combined Temperature-Depth Plots ● Exercise: Plot all the Temp-Depth curves on a single figure with a different color for each curve. Add a legend. ● Hint: This can be done with a single plot command if you pull out the appropriate data. The squeeze command might be useful. Or, you can use a for loop. ● Hint: You might want to use the jet command to get nice color. ● Exercise: Do the same thing for Salinity-Depth and Fluorescence-Depth. Do you see any patterns?

T-S Scatter Plot ● Exercise: Using very similar techniques to the previous exercises, you can make a scatter plot of temperature vs. salinity. ● Hint: Use a 'linestyle' of '.'

Multiple axes on a single figure ● You can use the subplot command to put more than one set of plots on a single figure window. An example is: » clf » subplot( 1, 2, 1 ) » plot( 1:10 ) » subplot( 1, 2, 2 ) » plot( (1:10).^2 ) ● Exercise: Can you use this model to place the T-Depth figures on the left and the S-Depth figures on the right.

What haven't you learned? ● I just want to point out a few things I haven't really taught in this class that might be of interest: – Strings and cell arrays: These are quite important for dealing with text information – Structures in more depth – Debugging: Really important. There are some notes in class 4 related to this. – 3D Graphics – Exporting Figures to files – Graphical User Interfaces (GUI): You can make interactive graphs. Look at guidetemplate for an example. – Object-oriented Programming: Often useful for modeling.