htrdrPy.helperFunctions module
- htrdrPy.helperFunctions.cart2sphere(vec)[source]
Convert cartesian to spherical coordinates.
- Parameters:
vec (
numpy.ndarray) – Cartesian coordinate array (x [m], y [m], z [m]).- Returns:
Spherical coordinate array (altitude [m], latitude [°], longitude [°]).
- Return type:
numpy.ndarray
- htrdrPy.helperFunctions.combineEstimates(sumX, sumXsquare, numbers)[source]
Calculate the mean, the variance and the standard deviation of a set of estimates.
- Parameters:
sumX (
numpy.ndarray) – Array containing the sum of the Monte Carlo weights of a list of estimates.sumXsquare (
numpy.ndarray) – Array containing the sum of the square of the Monte Carlo weights of a list of estimates.numbers (
numpy.ndarray) – Array containing the number of realizations for each estimate.
- Returns:
float – Mean of the combined estimates.
float – Variance of the combined estimates.
float – Standard deviation of the combined estimates.
- htrdrPy.helperFunctions.dplanck_dT(T, wvl, r_d=False)[source]
Calculate the derivative of the planck emission regarding the temperature in W/m2/sr/m/K for a surface at temperature T and at wavelengths wvl.
- Parameters:
T (float or
numpy.ndarray) – Temperature or N-D array of temperatures [K] of the emiting surface.wvl (float or
numpy.ndarray) – Wavelength or 1-D array of wavelengths.(optional (r_d) – Shape 2 array containing the source radius and distance, respectively. If not provided, returns the surface radiance, if given, returns the radiance received at that distance from the source.
(shape=(2) (1-D array) – Shape 2 array containing the source radius and distance, respectively. If not provided, returns the surface radiance, if given, returns the radiance received at that distance from the source.
[m])) (float) – Shape 2 array containing the source radius and distance, respectively. If not provided, returns the surface radiance, if given, returns the radiance received at that distance from the source.
- Returns:
Radiance either at the surface of the source (if
r_dnot provided) or at the given distance from the source. The shape depends on the shape of the parameters provided. If both theTandwvlare floats, the result is a float. IfTis a flaot andwvlan array, the result has the length ofwvl. IfTis an array andwvlis a float, the result has the shape ofT. Finally, if bothTandwvlare arrays (Thas dimension N andwvlhas dimension 1), the result has the N+1 dimensions (the N dimensions ofTplus the dimension ofwvl).- Return type:
float or M-D array (shape=(nWavelength), float [W/m2/sr/m]))
- htrdrPy.helperFunctions.planck(T, wvl, r_d=False)[source]
Calculate planck emission in W/m2/sr/m for a surface at temperature T and at wavelengths wvl.
- Parameters:
T (float or
numpy.ndarray) – Temperature or N-D array of temperatures [K] of the emiting surface.wvl (float or
numpy.ndarray) – Wavelength or 1-D array of wavelengths.(optional (r_d) – Shape 2 array containing the source radius and distance, respectively. If not provided, returns the surface radiance, if given, returns the radiance received at that distance from the source.
(shape=(2) (1-D array) – Shape 2 array containing the source radius and distance, respectively. If not provided, returns the surface radiance, if given, returns the radiance received at that distance from the source.
[m])) (float) – Shape 2 array containing the source radius and distance, respectively. If not provided, returns the surface radiance, if given, returns the radiance received at that distance from the source.
- Returns:
Radiance either at the surface of the source (if
r_dnot provided) or at the given distance from the source. The shape depends on the shape of the parameters provided. If both theTandwvlare floats, the result is a float. IfTis a flaot andwvlan array, the result has the length ofwvl. IfTis an array andwvlis a float, the result has the shape ofT. Finally, if bothTandwvlare arrays (Thas dimension N andwvlhas dimension 1), the result has the N+1 dimensions (the N dimensions ofTplus the dimension ofwvl).- Return type:
float or M-D array (shape=(nWavelength), float [W/m2/sr/m]))