Functions List (Python)#

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

Colormap#

Function

Description

scientimate.gencolormap

Generate a colormap from input colors

scientimate.seqcolormap

Generate sequential colormap for drawing lines

scientimate.topocolormap

Export a topographic colormap

Data Downloading#

Function

Description

scientimate.downloadndbcdata

Download meteorological data from NOAA National Data Buoy Center

scientimate.downloadtidecurrentdata

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

Data Manipulating#

Function

Description

scientimate.downsamplex

Downsample x data and retain given ratio

scientimate.downsamplexy

Downsample x and y data and retain given ratio

scientimate.downsamplexyz

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

scientimate.interpgrid2xyz

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

scientimate.interpxyz2grid

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

scientimate.interpxyz2xyz

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

scientimate.replacemissing1d

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

scientimate.replacemissing2d

Replace missing data points in 2d array

scientimate.replaceoutlier

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

scientimate.replacespike3dps

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

scientimate.replacespikediff

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

scientimate.replacespikeenvelope

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

Data Reading#

Function

Description

scientimate.readasciitable

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

scientimate.readdatafile

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

scientimate.readtimeseriesfile

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

scientimate.readxyzfile

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

Hurricane#

Function

Description

scientimate.hurricanebackgroundwind

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

scientimate.hurricanedpcpt

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

scientimate.hurricanepressureh80

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

scientimate.hurricanetranslationvel

Calculate hurricane center translational (forward motion) velocity

scientimate.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)

scientimate.hurricanewavecontourh16

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

scientimate.hurricanewavecontoury88

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

scientimate.hurricanewavemax

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

scientimate.hurricanewindh08

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

scientimate.hurricanewindh80

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

scientimate.hurricanewindinflowangle

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

scientimate.hurricanewindvel

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

scientimate.hurricanewindvelmax

Calculate hurricane maximum wind velocity at the surface level

scientimate.hurricanewindvelmaxh08

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

scientimate.hurricanewindvelmaxh80

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

scientimate.readnhchurricane

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

scientimate.stormsurge1d

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

Mapping#

Function

Description

scientimate.convertdir

Convert direction from one system to another one

scientimate.distancecart

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

scientimate.distancegc

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

scientimate.endpointcart

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

scientimate.globalrelief

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

scientimate.gridgenerator

Generate 2d x-y grid

scientimate.intersectgc

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

scientimate.intersectlineedge

Find intersection point between two line segments (line edges)

scientimate.pointscart

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

scientimate.reckongc

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

scientimate.waypointsgc

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

scientimate.windfetch

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

scientimate.zprofilepath

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

Ocean Wave Data Analysis#

Function

Description

scientimate.diagnostictail

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

scientimate.pressure2surfaceelevfft

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

scientimate.pressure2surfaceelevzcross

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

scientimate.seaswell1d

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

scientimate.velocity2surfaceelevfft

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

scientimate.velocity2surfaceelevzcross

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

scientimate.wavefrompressurepsd

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

scientimate.wavefrompressurezcross

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

scientimate.wavefromsurfaceelevpsd

Calculate wave properties from water surface elevation power spectral density

scientimate.wavefromsurfaceelevzcross

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

scientimate.wavefromvelocitypsd

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

scientimate.wavefromvelocityzcross

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

scientimate.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

scientimate.directionalpsd

Calculate wave directional spectrum using parametric directional spreading function

scientimate.directionalpsdetauv

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

scientimate.directionalpsdpuv

Calculate wave directional spectrum using pressure and horizontal orbital velocity

scientimate.enu2truenorth

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

scientimate.wavediretauv

Calculate wave direction using water surface elevation and horizontal orbital velocity

scientimate.wavedirpuv

Calculate wave direction using pressure and horizontal orbital velocity

Ocean Wave Parametric Model#

Function

Description

scientimate.asymptlimit

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

scientimate.equivalentfetchdeep

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

scientimate.equivalentfetchshallow

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

scientimate.fullydevwave

Calculate a fully developed condition for wind wave growth

scientimate.mindurationdeep

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

scientimate.mindurationshallow

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

scientimate.parametricwavedeep

Calculate wave properties using parametric wave models in deep water

scientimate.parametricwaveshallow

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

scientimate.wavedim2dimless

Calculate dimensionless numbers from dimensional numbers

scientimate.wavedimless2dim

Calculate dimensional numbers from dimensionless numbers

Ocean Wave Properties#

Function

Description

scientimate.incidentreflectedwave

Separate incident and reflected waves

scientimate.linearwavegenerator

Generate linear waves

scientimate.linearwavesuperposition

Superposition linear waves

scientimate.pressureresponse

Calculate a pressure response factor

scientimate.stokeswavegenerator

Generate second order stokes’ waves

scientimate.stokeswavesuperposition

Superposition second order stokes’ waves

scientimate.wavebedstress

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

scientimate.wavedispersion

Solve water wave dispersion relation

scientimate.wavedispersionds

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

scientimate.waveorbitalvelocity

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

scientimate.wavepower

Calculate wave power

scientimate.wavepowerfrompsd

Calculate wave energy and wave power from power spectral density

scientimate.wavespectrum2timeseries

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

scientimate.wavevel2wlconvfactor

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

Ocean Wave Spectrum#

Function

Description

scientimate.bretpsd

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

scientimate.donelanpsd

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

scientimate.jonswappsd

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

scientimate.pmpsd

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

scientimate.tmapsd

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

Plotting#

Function

Description

scientimate.plot2d

Plot x and y data in 2-d plot

scientimate.plot2dsubplot

Plot x and y data in 2-d subplots

scientimate.plot2dtimeseries

Plot x data in 2-d timeseries

scientimate.plot3d

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

scientimate.plot3ddem

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

scientimate.plot3dhillshades

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

scientimate.plot3dtopo

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

Signal Processing#

Function

Description

scientimate.bartlettpsd

Calculate power spectral density using Bartlett’s method

scientimate.fftfrequency

Return frequencies for Fast Fourier Transform

scientimate.filtertimeseries

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

scientimate.periodogrampsd

Calculate power spectral density using periodogram method

scientimate.psd2timeseries

Generate random wave data from a given spectrum

scientimate.smoothsignal

Smooth input data using a window function

scientimate.spectrogrampsd

Calculate spectrogram following Welch’s method without averaging

scientimate.welchpsd

Calculate power spectral density using Welch’s method

Statistics#

Function

Description

scientimate.curvefit2d

Fit curve to 2 dimensinal input dataset

scientimate.curvefit3d

Fit curve to 3 dimensinal input dataset

scientimate.dataoverview

Display an overview of the input data

scientimate.findextremum

Find local extremum (minimum and maximum) in data

scientimate.findknn

Find k-nearest neighbors using Euclidean distance

scientimate.fitgoodness

Calculate goodness of fit parameters

scientimate.levelcrossing

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

scientimate.movingwindow

Calculate statistics of moving window through 1-d x data

scientimate.probability1d

Calculate 1D probability density distribution for a given dataset

scientimate.probability2d

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

scientimate.similaritymeasure

Measure similarity between two arrays

SWAN Wave Model#

Function

Description

scientimate.swandepthgrid

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

scientimate.swanvectorvarspconst

Generate SWAN file for spatially constant vector variable

scientimate.swanvectorvarspvariedgrid

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

scientimate.swanvectorvarspvariedsct

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

scientimate.swanwaterlevelspconst

Generate SWAN water level file for spatially constant water level

scientimate.swanwaterlevelspvariedgrid

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

scientimate.swanwaterlevelspvariedsct

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

scientimate.swanwindspconst

Generate SWAN wind file for spatially constant wind

scientimate.swanwindspvariedgrid

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

scientimate.swanwindspvariedsct

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

Wind Engineering#

Function

Description

scientimate.directionavg

Average direction

scientimate.smoothwind

Smooth wind data using moving average window

scientimate.surfaceroughness

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

scientimate.sustainedwindduration

Calculate the sustained wind duration

scientimate.windavg

Average wind velocity and wind direction

scientimate.winddrag

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

scientimate.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

scientimate.windvelz1toz2

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