htrdrPy.helperFunctions module

htrdrPy.helperFunctions.cart2sphere(vec)[source]

Convert cartesian to spherical coordinates. # Input: - vec (1-D array (shape=(3), float [m,m,m])): [x, y, z] # Output: - 1-D array (shape=(3), float [m,°,°]): [altitude, latitude, longitude]

htrdrPy.helperFunctions.combineEstimates(sumX, sumXsquare, numbers)[source]

Calculate the mean, the variance and the standard deviation of a set of values # Input: - sumX (1-D array, shape=(N), float): sum of the values - sumXsquare (1-D array, shape=(N), float): sum of the square of the values - numbers (int): number of realizations for each estimate # Output: - mean (float): mean of the values - variance (float): variance of the values - std (float): standard deviation of the values

htrdrPy.helperFunctions.dplanck_dT(T, wvl, r_d=False)[source]
Calculate derivative of the planck emission regarding the temperature in

W/m2/sr/m/K for a surface T at wavelengths wvl # Input - T (float or N-D array of float [K]): temperature of the surface - wvl (float or 1-D array (shape=(nWavelength), float [m])): wavelengths - r_d (optional, 1-D array (shape=(2), float [m])): the source radius and

distance, respectively.

If not given, returns the surface radiance, if

given, returns the radiance received at that distance from the source

# Output float of 1-D array (shape=(nWavelength), float [W/m2/sr/m])) according to the shape of wvl

htrdrPy.helperFunctions.integral(X, Y, low, up)[source]
htrdrPy.helperFunctions.interpolate(dataPoints, dataValues, nodes, flagNearest=False)[source]
htrdrPy.helperFunctions.planck(T, wvl, r_d=False)[source]

Calculate planck emission in W/m2/sr/m for a surface T at wavelengths wvl # Input - T (float or N-D array of float [K]): temperature of the surface - wvl (float or 1-D array (shape=(nWavelength), float [m])): wavelengths - r_d (optional, 1-D array (shape=(2), float [m])): the source radius and distance, respectively. If not given, returns the surface radiance, if given, returns the radiance received at that distance from the source # Output float of 1-D array (shape=(nWavelength), float [W/m2/sr/m])) according to the shape of wvl

htrdrPy.helperFunctions.plotVector(ax, origin, vector, color='k', arrow_length_ratio=0.01, zorder=0)[source]
htrdrPy.helperFunctions.readRadianceKurucz(file, radius)[source]
htrdrPy.helperFunctions.set_axes_equal(ax)[source]

Make axes of 3D plot have equal scale so that spheres appear as spheres, cubes as cubes, etc.

Input

ax: a matplotlib axis, e.g., as output from plt.gca().

htrdrPy.helperFunctions.sphere2cart(vec)[source]

Convert spherical to cartesian coordinates. # Input: - vec (1-D array (shape=(3), float [m,°,°])): [altitude, latitude, longitude] # Output: - 1-D array (shape=(3), float [m,m,m]): [x, y, z]

htrdrPy.helperFunctions.toSI(value, unit)[source]

Return the given metric in SI unit Input: - value: value of the metric in the original units - unit: original units of value. Must follow the form: <unit>int.<unit>int….<unit>int/<unit>int.<unit>int….<unit>int The unit are separated by a space. The exposant of the unit is given right after the unit and must be positive. All units with positive exposant are proviede before “/” and all negatives after (omiting the “-”) The character “/” must not be repeated. Angstrom is given as A°. Output: - value in SI units