tmdsimpy.utils.harmonic.Nhc

tmdsimpy.utils.harmonic.Nhc(h)

Function to calculate the number of harmonic components.

Parameters:
h(H,) numpy.ndarray

Harmonics that should be included. E.g., numpy.array(range(5)). Must not include any repeated entries.

Returns:
Nhcint

Number of harmonic components (1 for zeroth, 2 for rest).

Notes

If harmonic 0 is included in h, then Nhc = 2*H-1. If harmonic 0 is not included, then Nhc = 2*H

Examples

>>> import numpy as np
... h_max = 5 # include 0th and first 5 harmonics
... h = np.arange(h_max+1)
... Nhc(h)
11