NCL Index

NCL Index#

NCL Function

Description

Python Equivalent

Notes

abs

Returns the absolute value of numeric data

abs() or numpy.abs()

example notebook

avg

Computes the average of a variable regardless of dimensionality

numpy.average() or numpy.mean()

example notebook

asin

Computes the inverse sine of numeric types

math.asin() or numpy.arcsin()

example notebook

acos

Computes the inverse cosine of numeric types

math.acos() or numpy.arccos()

example notebook

atan

Computes the inverse cosine of numeric types

math.atan() or numpy.arctan()

example notebook

atan2

Computes the inverse tangent of (y/x) for numeric types

math.atan2() or numpy.arctan2()

example notebook

area_poly_sphere

Calculates the area enclosed by an arbitrary polygon on the sphere

pyproj.Geod() and shapely.geometry.polygon.Polygon()

example notebook

cumsum

Calculates the cumulative sum

numpy.cumsum()

example notebook

clmMonTLL

Calculates long-term monthly means (monthly climatology) from monthly data

xarray.DataArray.groupby()

example notebook

clmDayTLL

Calculates long-term daily means (daily climatology) from daily data

xarray.DataArray.groupby()

example notebook

calcMonAnomTLL

Calculates monthly anomalies by subtracting the long-term mean from each point

xarray.DataArray.groupby()

example notebook

calcDayAnomTLL

Calculates daily anomalies from a daily data climatology

xarray.DataArray.groupby()

example notebook

ceil

Returns the smallest integral value greater than or equal to each input value

math.ceil() or numpy.ceil()

example notebook

cosh

Computes the hyperbolic cosine of numeric types

math.cosh() or numpy.cosh()

example notebook

css2c

Converts spherical coordinates (lat/lon) to Cartesian coordinates on a unit sphere

astropy.UnitSphericalRepresentation()

example notebook

cos

Computes the cosine of numeric types

math.cos() or numpy.cos()

example notebook

days_in_month

Calculates the number of days in a month given month and year

cftime.datetime()

example notebook

dewtemp_trh

Calculates the dew point temperature given temperature and relative humidity

geocat.comp.dewtemp()

example notebook

daylight_fao56

Compute maximum number of daylight hours as described in FAO 56

geocat.comp.meteorology.max_daylight()

example notebook

decimalPlaces

Truncates or rounds to the number of decimal places specified

round() or numpy.round()

example notebook

day_of_week

Calculates the day of the week given month, day, and year

cftime.datetime()

example notebook

exp

Computes the value of e (the base of natural logarithms) raised to the power of the input

math.exp() or numpy.exp()

example notebook

fabs

Returns the absolute value of numeric data

abs() or numpy.abs()

example notebook

floor

Returns the largest integral value less than or equal to each input value

math.floor() or numpy.floor()

example notebook

get_pi

Return pi as a type float or double

math.pi or numpy.pi

example notebook

get_d2r

Return a constant that converts degrees to radians

math.pi / 180 or numpy.pi / 180 or numpy.deg2rad()

example notebook

get_r2d

Return a constant that converts radians to degrees

180 / math.pi or 180 / numpy.pi or numpy.rad2deg()

example notebook

log

Computes the natural log of a numeric type

math.log() or numpy.log()

example notebook

log10

Computes the log base 10 of a numeric type

math.log10() or numpy.log10()

example notebook

mod

Remainder function which emulates the Fortran ‘mod’ intrinsic function

% or numpy.mod()

example notebook

month_to_season

Computes a user-specified three-month seasonal mean

geocat.comp.month_to_season()

example notebook

max

Computes the maximum value of a multi-dimensional array

max() or numpy.max()

example notebook

min

Computes the minimum value of a multi-dimensional array

min() or numpy.min()

example notebook

product

Computes the product of the input

math.prod() or numpy.prod()

example notebook

qsort

Sorts a singly dimensioned array of numbers

sorted() or numpy.sort()

example notebook

rmMonAnnCycTLL

Removes the annual cycle from monthly data

xarray.DataArray.groupby()

example notebook

round

Rounds a float or double variable to the nearest whole number

round() or numpy.round()

example notebook

sign_matlab

Mimic the behavior of Matlab’s sign function

numpy.sign()

example notebook

sqrt

Computes the square root of its input

math.sqrt() or numpy.sqrt()

example notebook

sin

Computes the sine of numeric types

math.sin() or numpy.sin()

example notebook

specxy_anal

Calculates the cross-spectra quantities of a series.

scipy.signal.periodogram(), scipy.signal.convolve(), scipy.signal.csd(), scipy.signal.coherence()

example notebook

specx_anal

Calculates the spectra of a series.

scipy.signal.periodogram(), scipy.signal.convolve()

example notebook

sum

Sums the input

sum() or numpy.sum()

example notebook

satvpr_temp_fao56

Compute saturation vapor pressure using temperature as described in FAO 56

geocat.comp.saturation_vapor_pressure()

example notebook

stdMonTLL

Calculates standard deviations of monthly means

xarray.DataArray.groupby()

example notebook

sinh

Computes the hyperbolic sine of numeric types

math.sinh() or numpy.sinh()

example notebook

sqsort

Sorts a singly dimensioned arrays of strings

sorted() or numpy.sort()

example notebook

satvpr_tdew_fao56

Compute actual saturation vapor pressure as described in FAO 56

geocat.comp.actual_saturation_vapor_pressure()

example notebook

tanh

Computes the hyperbolic tangent of numeric types

math.tanh() or numpy.tanh()

example notebook

tan

Computes the tangent of numeric types

math.tan() or numpy.tan()

example notebook

Note

For more information on how we verify these recommendations, see the Receipts List.