public class RsMathUtils extends Object
All functions have been implemented with extreme caution in order to provide a maximum performance.
Modifier and Type | Field and Description |
---|---|
static double |
BAROMETRIC_CONST
A constant used for the barometric formula - normalize to input in hPa.
|
static double |
DEG_PER_RAD
A constant used for radian/degree conversions.
|
static double |
GRAVITY_ACC
The earth's gravity acceleration in m / s^2.
|
static float |
KOSCHMIEDER_CONST
The constant in Koschmieder's Formula.
|
static double |
MEAN_EARTH_RADIUS
The Earth's mean radius in meters.
|
static double |
RAD_PER_DEG
A constant used for degree/radian conversions.
|
static double |
SPEC_WEIGHT_AIR
The specific weight of air in kg / m^3 It's value is
1.26895 . |
Constructor and Description |
---|
RsMathUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
applyGeodeticCorrection(GeoPos gp,
double h,
double vz,
double va)
Applies a geodetic correction to the given geographical coordinate.
|
static float |
elevationToZenith(float elevation)
Converts an elevation angle to a zenith angle.
|
static float[] |
elevationToZenith(float[] elevation,
float[] recycle)
Converts a vector of elevation angles to a vector of zenith angles.
|
static float |
koschmieder(float visibility)
Transforms horizontal visibility(km) to aerosol optical depth according to Koschmieder's formula.
|
static float |
koschmiederInv(float opticalDepth)
Transforms aerosol optical depth to horizontal visibility(km) according to Koschmieder's formula.
|
static float[] |
radianceToReflectance(float[] rad,
float[] sza,
float e0,
float[] recycle)
Converts an array of radiance values to an array of reflectance values for given solar spectral flux and sun
zenith angle.
|
static float |
radianceToReflectance(float rad,
float sza,
float e0)
Converts a radiance value to a reflectance value for given solar spectral flux and sun zenith angle.
|
static float |
reflectanceToRadiance(float refl,
float sza,
float e0)
Converts a reflectance value to a radiance value for given solar spectral flux and sun zenith angle.
|
static float[] |
simpleBarometric(float[] seaPress,
float[] height,
float[] recycle)
Calculates the air pressure in a given height given the sea level air pressure.
|
static float |
simpleBarometric(float seaPress,
float height)
Calculates the air pressure in a given height given the sea level air pressure.
|
static float |
zenithToElevation(float zenith)
Converts a zenith angle to an elevation angle.
|
static float[] |
zenithToElevation(float[] zenith,
float[] recycle)
Converts a vector of zenith angles to a vector of elevation angles.
|
public static final double SPEC_WEIGHT_AIR
1.26895
.public static final double GRAVITY_ACC
9.80665
.public static final double BAROMETRIC_CONST
GRAVITY_ACC *
SPEC_WEIGHT_AIR * 1e-2
.public static final float KOSCHMIEDER_CONST
3.92 * 2
.public static final double RAD_PER_DEG
Math.PI / 180.0
.public static final double DEG_PER_RAD
180.0 / Math.PI
.public static final double MEAN_EARTH_RADIUS
public static float reflectanceToRadiance(float refl, float sza, float e0)
radianceToReflectance
.refl
- the reflectancesza
- the sun zenith angle in decimal degreese0
- the solar spectral flux in mW / (m^2 * sr * nm)public static float radianceToReflectance(float rad, float sza, float e0)
rad
- the radiance in mW /(m^2 * sr * nm)sza
- the sun zenith angle in decimal degreese0
- the solar spectral flux in mW / (m^2 * sr * nm)public static float[] radianceToReflectance(float[] rad, float[] sza, float e0, float[] recycle)
If the recycle
parameter is of the same size as the radiance array, this array will be filled with
the results and returned. The returned result may contain reflectances <0 or >1.
The method performs no plausability check on the conversion.
rad
- the radiances in mW /(m^2 * sr * nm)sza
- the sun zenith angle in decimal degreese0
- the solar spectral fluxrecycle
- optional array which will be filled with the results, can be null.public static float zenithToElevation(float zenith)
zenith
- the zenith angle in decimal degreespublic static float[] zenithToElevation(float[] zenith, float[] recycle)
null
and has
the same size as the zenith angle vector, recycle will be filled and returned to minimize the memory
finmgerprint.zenith
- the zenith angle vector in decimal degreesrecycle
- optional array which will be filled with the results. can be null.public static float elevationToZenith(float elevation)
elevation
- the lelevation angle in decimal degreespublic static float[] elevationToZenith(float[] elevation, float[] recycle)
null
and has
the same size as the elevation angle vector, recycle will be filled and returned to minimize the memory
fingerprint. Convenience routine. Does the same as zenithToElevation but for code clarity ...elevation
- a vector of elevation angles (in degree)recycle
- optional array which will be filled with the results. can be null.public static float simpleBarometric(float seaPress, float height)
seaPress
- the sea level air pressure in hPaheight
- the height above sea level in mpublic static float[] simpleBarometric(float[] seaPress, float[] height, float[] recycle)
null
and has the same size
as the sea pressure vector, recycle will be filled and returned to minimize the memory fingerprint.seaPress
- vector of sea level air pressure in hPaheight
- vector of height above sea level in mrecycle
- optional array which will be filled with the results. can be null.public static float koschmieder(float visibility)
visibility
- horizontal visibility in kmIllegalArgumentException
- if the given parameter is 0.fpublic static float koschmiederInv(float opticalDepth)
opticalDepth
- aerosol optical depthIllegalArgumentException
- if the given parameter is 0.fpublic static void applyGeodeticCorrection(GeoPos gp, double h, double vz, double va)
The implementation assumes that the Earth is flat at the given coordinate point at elevetion zero and at the
given elevation. Furthermore the earth is assumed to be a sphere with the fixed radius MEAN_EARTH_RADIUS
.
gp
- the geographical coordinate to be corrected and which will be correctedh
- elevation above the Earth's sphere or ellipsoid surface in metersvz
- satellite viewing zenith angle in degreeva
- satellite viewing azimuth angle in degreeCopyright © 2014–2022 European Space Agency (ESA). All rights reserved.