Utilities for translating between different units and other useful functions.
More...
Go to the source code of this file.
|
| double | RAVEMAX (double a, double b) |
| | Returns the maximum value of a and b.
|
| |
| double | RAVEMIN (double a, double b) |
| | Returns the minimum value of a and b.
|
| |
| double | dBZ2Z (double dbz) |
| | Converts dBZ to Z.
|
| |
| double | dBZ2R (double dbz, double A, double b) |
| | Converts dBZ to mm/h, given an input dBZ and Z-R constants A and b.
|
| |
| double | Z2dBZ (double Z) |
| | Converts Z to dBZ.
|
| |
| double | R2dBZ (double R, double A, double b) |
| | Converts mm/h to dBZ, given an input dBZ and Z-R constants A and b.
|
| |
| double | raw2dbz (double raw, double gain, double offset) |
| | Converts raw to dBZ using linear gain and offset.
|
| |
| double | dbz2raw (double dbz, double gain, double offset) |
| | Converts dBZ to raw and makes sure it fits within an 8-bit word using gain and offset.
|
| |
| double | raw2R (double raw, double gain, double offset, double A, double b) |
| | Converts raw to R (mm/h) using linear gain and offset, and Z-R coefficients A and b.
|
| |
| double | R2raw (double R, double gain, double offset, double A, double b) |
| | Converts R (mm/h) to raw using linear gain and offset, and Z-R coefficients A and b.
|
| |
| int | mytrunc (double d) |
| | Truncates a double to an integer.
|
| |
| int | myround_int (double d, double minlimit, double maxlimit) |
| | Rounds a double to an integer.
|
| |
Utilities for translating between different units and other useful functions.
- Author
- Anders Henja (Swedish Meteorological and Hydrological Institute, SMHI)
- Date
- 1998-
◆ dBZ2R()
| double dBZ2R |
( |
double | dbz, |
|
|
double | A, |
|
|
double | b ) |
Converts dBZ to mm/h, given an input dBZ and Z-R constants A and b.
- Parameters
-
| [in] | dbz | the dbz value to be converted |
| [in] | A | the A value |
| [in] | b | the b value |
- Returns
- mm/h
◆ dbz2raw()
| double dbz2raw |
( |
double | dbz, |
|
|
double | gain, |
|
|
double | offset ) |
Converts dBZ to raw and makes sure it fits within an 8-bit word using gain and offset.
- Parameters
-
| [in] | dbz | the dBZ value |
| [in] | gain | the gain value, May NOT be 0.0 |
| [in] | offset | the offset |
- Returns
- the 8 bit raw ((dbz - offset)/gain)
◆ dBZ2Z()
| double dBZ2Z |
( |
double | dbz | ) |
|
Converts dBZ to Z.
- Parameters
-
| [in] | dbz | the dbz value to be converted |
- Returns
- the Z value
◆ myround_int()
| int myround_int |
( |
double | d, |
|
|
double | minlimit, |
|
|
double | maxlimit ) |
Rounds a double to an integer.
- Parameters
-
| [in] | d | the double v |
| [in] | minlimit | the minumim allowed value. if the rounded value becomes lower than this, the minlimit is used. |
| [in] | maxlimit | the maximum allowed value. if the rounded value becomes higher than this, the maxlimit is used. |
- Returns
- the rounded int value
◆ mytrunc()
Truncates a double to an integer.
- Parameters
-
- Returns
- the truncated int value
◆ R2dBZ()
| double R2dBZ |
( |
double | R, |
|
|
double | A, |
|
|
double | b ) |
Converts mm/h to dBZ, given an input dBZ and Z-R constants A and b.
- Parameters
-
| [in] | R | mm/h |
| [in] | A | the A value |
| [in] | b | the b value |
- Returns
- dBZ
◆ R2raw()
| double R2raw |
( |
double | R, |
|
|
double | gain, |
|
|
double | offset, |
|
|
double | A, |
|
|
double | b ) |
Converts R (mm/h) to raw using linear gain and offset, and Z-R coefficients A and b.
- Parameters
-
| [in] | R | mm/h |
| [in] | gain | the gain |
| [in] | offset | the offset |
| [in] | A | the A coefficient |
| [in] | b | the b coefficient |
- Returns
- the raw value
◆ RAVEMAX()
| double RAVEMAX |
( |
double | a, |
|
|
double | b ) |
Returns the maximum value of a and b.
- Parameters
-
- Returns
- the maximum value of a and b
◆ RAVEMIN()
| double RAVEMIN |
( |
double | a, |
|
|
double | b ) |
Returns the minimum value of a and b.
- Parameters
-
- Returns
- the mainimum value of a and b
◆ raw2dbz()
| double raw2dbz |
( |
double | raw, |
|
|
double | gain, |
|
|
double | offset ) |
Converts raw to dBZ using linear gain and offset.
- Parameters
-
| [in] | raw | the raw value |
| [in] | gain | the gain |
| [in] | offset | the offset |
- Returns
- dBZ (raw * gain + offset)
◆ raw2R()
| double raw2R |
( |
double | raw, |
|
|
double | gain, |
|
|
double | offset, |
|
|
double | A, |
|
|
double | b ) |
Converts raw to R (mm/h) using linear gain and offset, and Z-R coefficients A and b.
- Parameters
-
| [in] | raw | the raw value |
| [in] | gain | the gain |
| [in] | offset | the offset |
| [in] | A | the A coefficient |
| [in] | b | the b coefficient |
- Returns
- mm/h
◆ Z2dBZ()
Converts Z to dBZ.
- Parameters
-
- Returns
- dBZ