This is a toolkit/collection of scripts, functions, bits of files that help to make the lab work go smoothly in the Geophysical Fluid Dynamics lab in Newcastle University.
The lab data primarily comes in 2 forms, the recorded videos from cameras, processed initially in DigiFlow, and the density data from microconductivity probes (which run on an Arduino system). The scripts contain the main functions to run the systems, read this data into MATLAB and analyse, as well as in places scripts that interface into other software (primarily here DigiFlow). A couple of the MATLAB scripts help in the basic day-to-day running of the lab, e.g. copycamfiles.m
, Camera_parallelisation.m
.
First off,
git clone --recurse-submodules https://github.com/HartharnSam/ISWLabToolkit
Then you'll want to add this whole ordeal to your MATLAB path, which can be done:
- temporarily with
addpath(genpath('path/to/the/toolkit'));
- permanently by adding the addpath... code to
startup.m
. startup.m should be found in the file you find by typing userpath into the matlab command window - if it is not, create one.
/Cameras
This directory should contain files needed for camera operation in DigiFlow. More detailed README within/DigiFlow_read
This directory should contain files needed for reading & processing DigiFlow data in MATLAB. More detailed README within/DJLES
DJL Solver for MATLAB. Submodule only - so links directly to the GitHub repository./Probes
More detailed README within/ProbeDrivers
Drivers This directory should contain files needed for operating the probes using the arduino software../
Main directory contains files needed for processing probe data in MATLAB
/extras
* Just some helper functions that are called by other functions here*
calc_DJL.m
Calculates a DJL wave to match a given lab setup (e.g. actual densities, layer depths & wave amplitude)calc_DJL_fromAPE.m
* As above, but with input of APE, not amplitude*calc_kdv.m
Same as calc_DJL but for a kdv wave
camera_parallelisation.m
helps in the task of parallelising the cameras to the tankcopycamfiles.m
* Copies the day's data from local D: drives to a central OneDrive - always needs modifications to new systems*setup.sh
Sets up folder structures each day, makes sure copies of relevant scripts are where they'll need to be later on
LabWaveProperties.m
New method of picking points on the pycnocline using MATLAB GUI, and saves/outputs amplitudes and wave velocity. Crucially, saves the picked points for replicability. Now also does wavelength measurementsdfconf_add.m
* Adds variables (or initialises) a df.conf file in the current directory to store experiment-specific data in a way that is readable by dfconf_params *dfconf_params.m
* Reads in the variables in a df.conf file to a MATLAB structure *
Two scripts are included here (plus the entire DJLES package) which provide analytical solutions to ISWs. This is the Weakly Nonlinear Korteweg de Vries theory, and the fully nonlinear Dubreil-Jacotin-Long (DJL) equation.
We get:
Where
Further discussion on the KdV equation can be found in Lamb & Yan 1996.
Fully nonlinear equation from the steady, incompressible Euler equations. In a constant background current:
This really is a collection of projects and scripts from various authors. The project overall was created by Sam Hartharn-Evans. The initial dfireadvel package, which became digiflow_read was created by [email protected]. The initial dissipation package within DigiFlow_read was created by Peter Sutherland. There are also contributions from Marek Stastna (University of Waterloo), Magda Carr (Newcastle University) and the DJLES package is the Dunphy et al. (2011) package. Where possible, individual acknowledgements have been made within scripts.
The package is licenced under the MIT licence, see LICENSE
for more information.
Things I found useful in this code writing:
- MatPIV: A package which does the same PIV and PTV calculations in MATLAB. Helped me understand what's going on.
- ISW_ParticleTrackModel : A Package for tracking particles at the surface as part of the ISW in Ice Covered Waters Project (ONE Planet PhD Studentship)
Versioning Tool for GitHub is provided using the following guide