cf.DomainAncillary.tan

DomainAncillary.tan(*args, **kwargs)[source]

Take the trigonometric tangent of the data element-wise.

Units are accounted for in the calculation, so that the tangent of 180 degrees_east is 0.0, as is the tangent of 3.141592653589793 radians. If the units are not equivalent to radians (such as Kelvin) then they are treated as if they were radians.

The Units are changed to ‘1’ (nondimensional).

See also

arctan, cos, sin, tanh

Parameters
bounds: bool, optional

If False then do not alter any bounds. By default any bounds are also altered.

inplace: bool, optional

If True then do the operation in-place and return None.

Returns
DomainAncillary or None

The construct with the tangent of data values. If the operation was in-place then None is returned.

Examples

>>> f.Units
<Units: degrees_north>
>>> print(f.array)
[[-45 0 45 --]]
>>> g = f.tan()
>>> g.Units
<Units: 1>
>>> print(g.array)
[[-1.0 0.0 1.0 --]]
>>> f.Units
<Units: m s-1>
>>> print(f.array)
[[1 2 3 --]]
>>> f.tan(inplace=True)
>>> f.Units
<Units: 1>
>>> print(f.array)
[[1.55740772465 -2.18503986326 -0.142546543074 --]]