Functions List (MATLAB)#

Here is a list of the ScientiMate functions (MATLAB):

Colormap#

Function

Description

gencolormap

Generate a colormap from input colors

seqcolormap

Generate sequential colormap for drawing lines

topocolormap

Export a topographic colormap

Data Downloading#

Function

Description

downloadndbcdata

Download meteorological data from NOAA National Data Buoy Center

downloadtidecurrentdata

Download meteorological data from NOAA’s Center for Operational Oceanographic Products and Services (CO-OPS)

Data Manipulating#

Function

Description

downsamplex

Downsample x data and retain given ratio

downsample2d

Downsample x and y data and retain given ratio

downsamplexyz

Downsample x, y, and z data and retain given ratio

interpgrid2xyz

Interpolate 2d gridded data on given scatter point(s) using nearest neighbor method

interpxyz2grid

Interpolate x (longitude), y (latitude) and z (elevation) data into a defined mesh

interpxyz2xyz

Interpolate 2d scattered data on given point(s) by down-sampling the input data

replacemissing1d

Replace missing data points in 1d data such as time series

replacemissing2d

Replace missing data points in 2d array

replaceoutlier

Remove outliers in the time series using moving z-score window

replacespike3dps

Remove spikes in the time series based on 3D phase space method by Goring and Nikora (2002)

replacespikediff

Remove spikes in the time series using a local difference of data respect to a moving average window

replacespikeenvelope

Remove spikes in the time series that are outside a defined envelope

Data Reading#

Function

Description

readasciitable

Read and extract data from ASCII, text, Comma Separated Values (CSV), and spreadsheet (xlsx, xls, ods) file

readdatafile

Read and extract data from ASCII, text, Comma Separated Values (CSV), Matlab .mat file

readtimeseriesfile

Read and extract time-series data from ASCII, text, Comma Separated Values (CSV), and spreadsheet (xlsx, xls, ods) file

readxyzfile

Read and extract x (longitude), y (latitude) and z (elevation) data from ASCII gridded (tabular) xyz file

Hurricane#

Function

Description

hurricanebackgroundwind

Calculate and add background wind velocity due to hurricane front motion to hurricane rotational wind velocity

hurricanedpcpt

Calculate hurricane central pressure (Pc) intensity change over time (dPc/dt)

hurricanepressureh80

Generate hurricane pressure data on given (x,y) points using method from Holland (1980)

hurricanetranslationvel

Calculate hurricane center translational (forward motion) velocity

hurricanewavecontourcem

Calculates hurricane wave height field (contours) on given mesh using method from Shore Protection Manual (SPM), U.S. Army Corps of Engineers (1984), and Young (1988)

hurricanewavecontourh16

Calculates hurricane wave height and wave period field (contours) on given mesh using method from Hwang (2016) and Hwang & Walsh (2016)

hurricanewavecontoury88

Calculate hurricane wave height field (contours) on given mesh using method from Young (1988)

hurricanewavemax

Calculate hurricane maximum wave height and wave period at a location of maximum wind

hurricanewindh08

Generate hurricane wind and pressure data on (x,y) points using method from Holland (2008)

hurricanewindh80

Generate hurricane wind and pressure data on given (x,y) points using method from Holland (1980)

hurricanewindinflowangle

Calculate hurricane velocity tangential and inflow angle and inflow velocity in x (East) and y (North) directions

hurricanewindvel

Generate hurricane wind velocity data on given (x,y) points

hurricanewindvelmax

Calculate hurricane maximum wind velocity at the surface level

hurricanewindvelmaxh08

Calculate hurricane maximum wind velocity at the gradient level using Holland (2008) method

hurricanewindvelmaxh80

Calculate hurricane maximum wind velocity at the gradient level using Holland (1980) method

readnhchurricane

Read and extracts hurricane data from National Hurricane Center (NHC) HURDAT2 file

stormsurge1d

Calculate one dimensional storm surge using Dean Dalrymple (1991) method

Mapping#

Function

Description

convertdir

Convert direction from one system to another one

distancecart

Calculate distance from (x1,y1) to (x2,y2) on cartesian coordinate

distancegc

Calculate distance and azimuth (bearing) between (Latitude,Longitude) points using Great Circle

endpointcart

Find an end point of the straight line segment from its starting point (x1,y1) and its angle on cartesian coordinate

globalrelief

Return x (longitude), y (latitude) and z (elevation) data from ETOPO1 Global Relief Model (Amante & Eakins, 2009) interpolated on 0.08 degree grid

gridgenerator

Generate 2d x-y grid

intersectgc

Find intersection point between two line segments (line edges) on Great Circle

intersectlineedge

Find intersection point between two line segments (line edges)

pointscart

Generate points between point (x1,y1) and (x2,y2) on cartesian coordinate

reckongc

Calculate end point (Latitude,Longitude) from start point (Latitude,Longitude) and distance and azimuth (bearing) using Great Circle

waypointsgc

Generate (Latitude,Longitude) points between two (Latitude,Longitude) points using Great Circle

windfetch

Calculate a wind fecth and z (elevation) profile along a path over water for a given 2d x-y domain (map, image, …)

zprofilepath

Calculate z (elevation, …) profile along a path over a given 2d x-y domain (map, image, …)

Ocean Wave Data Analysis#

Function

Description

diagnostictail

Replace a spectrum tail with JONSWAP (Hasselmann et al., 1973) or TMA Spectrum (Bouws et al., 1985)

pressure2surfaceelevfft

Calculate water surface elevation time series from water pressure time series by using Fast Fourier Transform

pressure2surfaceelevzcross

Calculate water surface elevation time series from water pressure time series by using an upward zero crossing method

seaswell1d

Partition (separate) wind sea from swell in a power spectral density using an one dimensional method

velocity2surfaceelevfft

Calculate water surface elevation time series from wave orbital velocity time series by using Fast Fourier Transform

velocity2surfaceelevzcross

Calculate wave properties from wave orbital velocity by using an upward zero crossing method

wavefrompressurepsd

Calculate wave properties from water pressure by converting it to water surface elevation power spectral density

wavefrompressurezcross

Calculate wave properties from water pressure by using an upward zero crossing method

wavefromsurfaceelevpsd

Calculate wave properties from water surface elevation power spectral density

wavefromsurfaceelevzcross

Calculate wave properties from water surface elevation by using an upward zero crossing method

wavefromvelocitypsd

Calculate wave properties from wave orbital velocity by converting it to water surface elevation power spectral density

wavefromvelocityzcross

Calculate wave properties from wave orbital velocity by using an upward zero crossing method

wavepropfrompsd

Calculate wave properties from a power spectral density

For ocean wave data analysis, you may use OCEANLYZ toolbox as well.
OCEANLYZ, Ocean Wave Analyzing Toolbox, is a toolbox for analyzing the wave time series data collected by sensors in open body of water such as ocean, sea, and lake or in a laboratory.
For more information, visit akarimp/Oceanlyz

Ocean Wave Directional Analysis#

Function

Description

directionalpsd

Calculate wave directional spectrum using parametric directional spreading function

directionalpsdetauv

Calculate wave directional spectrum using water surface elevation and horizontal orbital velocity

directionalpsdpuv

Calculate wave directional spectrum using pressure and horizontal orbital velocity

enu2truenorth

Convert mathematical direction (angle) from ENU (East North Up) coordinate system to compass direction with respect to true north

wavediretauv

Calculate wave direction using water surface elevation and horizontal orbital velocity

wavedirpuv

Calculate wave direction using pressure and horizontal orbital velocity

Ocean Wave Parametric Model#

Function

Description

asymptlimit

Calculate dimensionless asymptotic limits of wind wave growth in shallow and intermediate water

equivalentfetchdeep

Calculate an equivalent wind fetch for duration limited wave growth in deep water

equivalentfetchshallow

Calculate an equivalent wind fetch for duration limited wave growth in shallow and intermediate water

fullydevwave

Calculate a fully developed condition for wind wave growth

mindurationdeep

Calculate a minimum required wind duration for wave to be fetch limited in deep water

mindurationshallow

Calculate a minimum required wind duration for wave to be fetch limited in shallow and intermediate water

parametricwavedeep

Calculate wave properties using parametric wave models in deep water

parametricwaveshallow

Calculate wave properties using parametric wave models in shallow and intermediate water

wavedim2dimless

Calculate dimensionless numbers from dimensional numbers

wavedimless2dim

Calculate dimensional numbers from dimensionless numbers

Ocean Wave Properties#

Function

Description

incidentreflectedwave

Separate incident and reflected waves

linearwavegenerator

Generate linear waves

linearwavesuperposition

Superposition linear waves

pressureresponse

Calculate a pressure response factor

stokeswavegenerator

Generate second order stokes’ waves

stokeswavesuperposition

Superposition second order stokes’ waves

wavebedstress

Calculate the bottom shear velocity and shear stress from current velocity and wave

wavedispersion

Solve water wave dispersion relation

wavedispersionds

Solve water wave dispersion relation with presence of current (Doppler shift)

waveorbitalvelocity

Calculate maximum wave orbital velocity and maximum wave orbital excursion using linear wave theory

wavepower

Calculate wave power

wavepowerfrompsd

Calculate wave energy and wave power from power spectral density

wavespectrum2timeseries

Generate random water wave data from a given water wave spectrum using wave superposition

wavevel2wlconvfactor

Calculate a water particle horizontal orbital velocity to the water surface elevation conversion factor

Ocean Wave Spectrum#

Function

Description

bretpsd

Calculate Bretschneider spectrum (power spectral density), (Bretschneider, 1959), ITTC spectrum

donelanpsd

Calculate Donelan spectrum (power spectral density), (Donelan et al. 1985)

jonswappsd

Calculate JONSWAP spectrum (power spectral density), (Hasselmann et al. 1973)

pmpsd

Calculate Pierson-Moskowitz spectrum (power spectral density), (Pierson and Moskowitz 1964)

tmapsd

Calculate TMA spectrum (power spectral density), (Bouws et al. 1985)

Plotting#

Function

Description

plot2d

Plot x and y data in 2-d plot

plot2dsubplot

Plot x and y data in 2-d subplots

plot2dtimeseries

Plot x data in 2-d timeseries

plot3d

Plot x , y, and z data in 2-d/3-d contour/surface plot

plot3ddem

Plot x (longitude), y (latitude) and z (elevation) data into a defined mesh

plot3dhillshades

Plot hillshades (shaded relief) of x (longitude), y (latitude) and z (elevation) data

plot3dtopo

Plot x (longitude), y (latitude) and z (elevation) data into a defined mesh

Signal Processing#

Function

Description

bartlettpsd

Calculate power spectral density using Bartlett’s method

fftfrequency

Return frequencies for Fast Fourier Transform

filtertimeseries

Filter time-series to retain signals with frequencies of fcL <= f <= fcH

periodogrampsd

Calculate power spectral density using periodogram method

psd2timeseries

Generate random wave data from a given spectrum

smoothsignal

Smooth input data using a window function

spectrogrampsd

Calculate spectrogram following Welch’s method without averaging

welchpsd

Calculate power spectral density using Welch’s method

Statistics#

Function

Description

curvefit2d

Fit curve to 2 dimensinal input dataset

curvefit3d

Fit curve to 3 dimensinal input dataset

dataoverview

Display an overview of the input data

findextremum

Find local extremum (minimum and maximum) in data

findknn

Find k-nearest neighbors using Euclidean distance

fitgoodness

Calculate goodness of fit parameters

levelcrossing

Calculate crossing point for a given level by using an upward zero crossing method

movingwindow

Calculate statistics of moving window through 1-d x data

probability1d

Calculate 1D probability density distribution for a given dataset

probability2d

Calculate 2D (joint) probability density distribution for two given datasets

similaritymeasure

Measure similarity between two arrays

SWAN Wave Model#

Function

Description

swandepthgrid

Generate SWAN depth file and its associated x-y grid file

swanvectorvarspconst

Generate SWAN file for spatially constant vector variable

swanvectorvarspvariedgrid

Generate SWAN file for spatially varied vector variable from gridded input data

swanvectorvarspvariedsct

Generate SWAN file for spatially varied vector variable from scattered input data

swanwaterlevelspconst

Generate SWAN water level file for spatially constant water level

swanwaterlevelspvariedgrid

Generate SWAN water level file for spatially varied water level from gridded input data

swanwaterlevelspvariedsct

Generate SWAN water level file for spatially varied water level from scattered input data

swanwindspconst

Generate SWAN wind file for spatially constant wind

swanwindspvariedgrid

Generate SWAN wind file for spatially varied wind from gridded input data

swanwindspvariedsct

Generate SWAN wind file for spatially varied wind from scattered input data

Wind Engineering#

Function

Description

directionavg

Average direction

smoothwind

Smooth wind data using moving average window

surfaceroughness

Calculate shear velocity and surface roughness from a given velocity profile using Karimpour et al. (2012) method

sustainedwindduration

Calculate the sustained wind duration

windavg

Average wind velocity and wind direction

winddrag

Calculate wind drag coefficient, wind shear stress, and wind shear velocity

windgustfactor

Convert wind velocity of duration t0 to t

windspectrum

Calculate wind spectrum with 513 frequencies

windspectrum2timeseries

Generate zero-mean wind velocity time series from a given spectrum

windvelz1toz2

Convert wind velocity from first height, z1 (m), to second height, z2 (m), (e.g. 10 (m)) above surface