pyharm.shs#

Module to perform solid spherical harmonic synthesis of point and mean values.

Note

This documentation is written for double precision version of PyHarm.

pyharm.shs.point(pnt, shcs, nmax)#

Performs spherical harmonic synthesis of point values from shcs at pnt up to maximum degree nmax. Refer to charm_shs for the full documentation.

Parameters:
Returns:

out – Point values synthesized from shcs at pnt

Return type:

numpy array of floating points

pyharm.shs.point_grad1(pnt, shcs, nmax)#

Performs the synthesis of point values of the first-order gradient in LNOF from shcs at pnt up to maximum degree nmax. Refer to charm_shs for the full documentation.

Parameters:
Returns:

  • fx (numpy array of floating points) – The x element

  • fy (numpy array of floating points) – The y element

  • fz (numpy array of floating points) – The z element

pyharm.shs.point_grad2(pnt, shcs, nmax)#

Performs the synthesis of point values of the second-order gradient in LNOF from shcs at pnt up to maximum degree nmax. Refer to charm_shs for the full documentation.

Parameters:
Returns:

  • fxx (numpy array of floating points) – The xx element

  • fxy (numpy array of floating points) – The xy element

  • fxz (numpy array of floating points) – The xz element

  • fyy (numpy array of floating points) – The yy element

  • fyz (numpy array of floating points) – The yz element

  • fzz (numpy array of floating points) – The zz element

pyharm.shs.point_guru(pnt, shcs, nmax, dr, dlat, dlon)#

Performs the synthesis of point values of

\[\frac{1}{r^{j + k} \, \cos^k\varphi} \, \frac{\partial^{i + j + k} f}{\partial r^i \, \partial \varphi^j \, \lambda^k}\]

for \(i = 0, 1, 2\) (dr), \(j = 0, 1, 2\) (dlat) and \(k = 0, 1, 2\) (dlon) satisfying \(i + j + k \leq 2\) from shcs at pnt up to maximum degree nmax. Refer to charm_shs_point_guru in charm_shs for the full documentation.

Parameters:
  • pnt (PointGrid, PointGridDH1, PointGridDH2, PointGridGL or PointSctr) – Evaluation points

  • shcs (Shc) – Spherical harmonic coefficients

  • nmax (integer) – Maximum degree of the synthesis

  • dr (integer) – Order of the radial derivative (variable \(i\) in the equation above)

  • dlat (integer) – Order of the latitudinal derivative (variable \(j\) in the equation above)

  • dlon (integer) – Order of the longitudinal derivative (variable \(k\) in the equation above)

Returns:

f – Output quantity depending on dr, dlat and dlon

Return type:

numpy array of floating points

pyharm.shs.cell(cell, shcs, nmax)#

Performs spherical harmonic synthesis of area-mean values from shcs at cell up to maximum degree nmax. Refer to charm_shs for the full documentation.

Parameters:
  • cell (CellSctr, CellGrid) – Evaluation cells

  • shcs (Shc) – Spherical harmonic coefficients

  • nmax (integer) – Maximum degree of the synthesis

Returns:

out – Area-mean values synthesized from shcs at cell

Return type:

numpy array of floating points

pyharm.shs.cell_isurf(cell, shcs1, nmax1, shcs2, nmax2, nmax3, nmax4)#

Performs spherical harmonic synthesis of area-mean values from shcs1 at cell residing on an irregular surface defined by shcs2. The synthesis of area-mean values is done up to degree nmax1 and the irregular surface is expanded up to degree nmax2. nmax3 and nmax4 represent the maximum harmonic degrees to synthesize and analyze the (shcs1.r / r)^(n + 1) terms, where r stands for the spherical radius of the irregular surface defined by shcs2. Refer to charm_shs for the full documentation.

Parameters:
  • cell (CellGrid) – Evaluation cells

  • shcs1 (Shc) – Spherical harmonic coefficients of the function, the area-mean values of which are synthesized

  • nmax1 (integer) – Maximum degree of the synthesis of the area-mean values

  • shcs2 (Shc) – Spherical harmonic coefficients of the irregular surface, on which the area-mean values are synthesized

  • nmax2 (integer) – Maximum degree of the synthesis of the irregular surface

  • nmax3 (integer) – Maximum degree of the synthesis of (shcs1.r / r)^(n + 1)

  • nmax4 (integer) – Maximum degree of the analysis of (shcs1.r / r)^(n + 1)

Returns:

out – Area-mean values synthesized from shcs1 at cell residing on the surface defined by shcs2

Return type:

numpy array of floating points