cf.DomainAncillary.tanh

DomainAncillary.tanh(bounds=True, inplace=False)[source]

Take the hyperbolic tangent of the data element-wise.

Units are accounted for in the calculation. If the units are not equivalent to radians (such as Kelvin) then they are treated as if they were radians. For example, the the hyperbolic tangent of 90 degrees_east is 0.91715234, as is the hyperbolic tangent of 1.57079632 radians.

The output units are changed to ‘1’ (nondimensional).

The “standard_name” and “long_name” properties are removed from the result.

New in version 3.1.0.

See also

arctanh, sinh, cosh, tan

Parameters
inplace: bool, optional

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

Returns

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

Examples:

>>> f.Units
<Units: degrees_north>
>>> print(f.array)
[[-90 0 90 --]]
>>> g = f.tanh()
>>> g.Units
<Units: 1>
>>> print(g.array)
[[-0.9171523356672744 0.0 0.9171523356672744 --]]
>>> f.Units
<Units: m s-1>
>>> print(f.array)
[[1 2 3 --]]
>>> f.tanh(inplace=True)
>>> f.Units
<Units: 1>
>>> print(f.array)
[[0.7615941559557649 0.9640275800758169 0.9950547536867305 --]]