Algorithms
-
group
harp_algorithm
The collection of scientific/mathematical algorithms as used internally by HARP.
Defines
-
CONST_NUM_AVOGADRO
-
CONST_SPEED_OF_LIGHT
-
CONST_GRAVITATIONAL_CONSTANT
-
CONST_PLANCKS_CONSTANT_H
-
CONST_PLANCKS_CONSTANT_HBAR
-
CONST_ELECTRON_VOLT
-
CONST_MASS_ELECTRON
-
CONST_MASS_MUON
-
CONST_MASS_PROTON
-
CONST_MASS_NEUTRON
-
CONST_RYDBERG
-
CONST_BOLTZMANN
-
CONST_BOHR_MAGNETON
-
CONST_NUCLEAR_MAGNETON
-
CONST_ELECTRON_MAGNETIC_MOMENT
-
CONST_PROTON_MAGNETIC_MOMENT
-
CONST_MOLAR_GAS
-
CONST_STANDARD_GAS_VOLUME
-
CONST_MINUTE
-
CONST_HOUR
-
CONST_DAY
-
CONST_WEEK
-
CONST_INCH
-
CONST_FOOT
-
CONST_YARD
-
CONST_MILE
-
CONST_NAUTICAL_MILE
-
CONST_FATHOM
-
CONST_MIL
-
CONST_POINT
-
CONST_TEXPOINT
-
CONST_MICRON
-
CONST_ANGSTROM
-
CONST_HECTARE
-
CONST_ACRE
-
CONST_BARN
-
CONST_LITER
-
CONST_US_GALLON
-
CONST_QUART
-
CONST_PINT
-
CONST_CUP
-
CONST_FLUID_OUNCE
-
CONST_TABLESPOON
-
CONST_TEASPOON
-
CONST_CANADIAN_GALLON
-
CONST_UK_GALLON
-
CONST_MILES_PER_HOUR
-
CONST_KILOMETERS_PER_HOUR
-
CONST_KNOT
-
CONST_POUND_MASS
-
CONST_OUNCE_MASS
-
CONST_TON
-
CONST_METRIC_TON
-
CONST_UK_TON
-
CONST_TROY_OUNCE
-
CONST_CARAT
-
CONST_UNIFIED_ATOMIC_MASS
-
CONST_GRAM_FORCE
-
CONST_POUND_FORCE
-
CONST_KILOPOUND_FORCE
-
CONST_POUNDAL
-
CONST_CALORIE
-
CONST_BTU
-
CONST_THERM
-
CONST_HORSEPOWER
-
CONST_BAR
-
CONST_PASCAL
-
CONST_TORR
-
CONST_METER_OF_MERCURY
-
CONST_INCH_OF_MERCURY
-
CONST_INCH_OF_WATER
-
CONST_PSI
-
CONST_POISE
-
CONST_STOKES
-
CONST_FARADAY
-
CONST_ELECTRON_CHARGE
-
CONST_GAUSS
-
CONST_STILB
-
CONST_LUMEN
-
CONST_LUX
-
CONST_PHOT
-
CONST_FOOTCANDLE
-
CONST_LAMBERT
-
CONST_FOOTLAMBERT
-
CONST_CURIE
-
CONST_ROENTGEN
-
CONST_RAD
-
CONST_SOLAR_MASS
-
CONST_BOHR_RADIUS
-
CONST_NEWTON
-
CONST_DYNE
-
CONST_JOULE
-
CONST_ERG
-
CONST_STEFAN_BOLTZMANN_CONSTANT
-
CONST_THOMSON_CROSS_SECTION
-
CONST_VACUUM_PERMITTIVITY
-
CONST_VACUUM_PERMEABILITY
-
CONST_DEBYE
-
CONST_MOLAR_MASS_BrO
-
CONST_MOLAR_MASS_C2H2
-
CONST_MOLAR_MASS_C2H6
-
CONST_MOLAR_MASS_CCl2F2
-
CONST_MOLAR_MASS_CCl3F
-
CONST_MOLAR_MASS_CF4
-
CONST_MOLAR_MASS_CH2O
-
CONST_MOLAR_MASS_CH3Cl
-
CONST_MOLAR_MASS_CH4
-
CONST_MOLAR_MASS_CHF2Cl
-
CONST_MOLAR_MASS_ClNO
-
CONST_MOLAR_MASS_ClONO2
-
CONST_MOLAR_MASS_ClO
-
CONST_MOLAR_MASS_CO2
-
CONST_MOLAR_MASS_COF2
-
CONST_MOLAR_MASS_CO
-
CONST_MOLAR_MASS_H2O_161
-
CONST_MOLAR_MASS_H2O_162
-
CONST_MOLAR_MASS_H2O_171
-
CONST_MOLAR_MASS_H2O_181
-
CONST_MOLAR_MASS_H2O2
-
CONST_MOLAR_MASS_H2O
-
CONST_MOLAR_MASS_HCl
-
CONST_MOLAR_MASS_HCN
-
CONST_MOLAR_MASS_HCOOH
-
CONST_MOLAR_MASS_HF
-
CONST_MOLAR_MASS_HO2NO2
-
CONST_MOLAR_MASS_HO2
-
CONST_MOLAR_MASS_HOCl
-
CONST_MOLAR_MASS_HNO3
-
CONST_MOLAR_MASS_N2O
-
CONST_MOLAR_MASS_N2O5
-
CONST_MOLAR_MASS_N2
-
CONST_MOLAR_MASS_NO2
-
CONST_MOLAR_MASS_NO3
-
CONST_MOLAR_MASS_NO
-
CONST_MOLAR_MASS_O2
-
CONST_MOLAR_MASS_O3_666
-
CONST_MOLAR_MASS_O3_667
-
CONST_MOLAR_MASS_O3_668
-
CONST_MOLAR_MASS_O3_686
-
CONST_MOLAR_MASS_O3
-
CONST_MOLAR_MASS_O4
-
CONST_MOLAR_MASS_OBrO
-
CONST_MOLAR_MASS_OClO
-
CONST_MOLAR_MASS_OCS
-
CONST_MOLAR_MASS_OH
-
CONST_MOLAR_MASS_SF6
-
CONST_MOLAR_MASS_SO2
-
CONST_MOLAR_MASS_DRY_AIR
-
CONST_MEAN_MOLAR_MASS_WET_AIR
-
CONST_DOBSON_UNIT
-
CONST_STD_AIR_DENSITY
-
CONST_STD_PRESSURE
-
CONST_STD_TEMPERATURE
-
CONST_GAS_SPECIFIC_WET_AIR
-
CONST_GAS_SPECIFIC_DRY_AIR
-
CONST_TOA_ALTITUDE
-
CONST_ASTRONOMICAL_UNIT
-
CONST_LIGHT_YEAR
-
CONST_PARSEC
-
CONST_GRAV_ACCEL
-
CONST_EARTH_RADIUS_WGS84_SPHERE
-
CONST_GRAV_ACCEL_45LAT_WGS84_SPHERE
-
CONST_GRAVITATIONAL_CONSTANT_WGS84_ELLIPSOID
-
CONST_ANGULAR_VELOCITY_WGS84_ELLIPSOID
-
CONST_SEMI_MAJOR_AXIS_WGS84_ELLIPSOID
-
CONST_SEMI_MINOR_AXIS_WGS84_ELLIPSOID
-
CONST_FLATTENING_WGS84_ELLIPSOID
-
CONST_LINEAR_ECCENTRICITY_WGS84_ELLIPSOID
-
CONST_ECCENTRICITY_WGS84_ELLIPSOID
-
CONST_GRAV_ACCEL_POLAR_WGS84_ELLIPSOID
-
CONST_GRAV_ACCEL_EQUATOR_WGS84_ELLIPSOID
-
CONST_SOMIGLIANA_WGS84_ELLIPSOID
-
CONST_GRAV_RATIO_WGS84_ELLIPSOID
Functions
-
double
harp_fraction_of_day_from_datetime
(double datetime) Calculate the fraction of the day
- Return
- the fraction of the day [1]
- Parameters
datetime
-Datetime [s since 2000-01-01]
-
double
harp_fraction_of_year_from_datetime
(double datetime) Calculate the fraction of the year
- Return
- the fraction of the year [1]
- Parameters
datetime
-Datetime [s since 2000-01-01]
-
static double
get_equation_of_time_angle_from_datetime
(double datetime) Calculate the equation of time (EOT) angle
- Return
- the equation of time angle [degree]
- Parameters
datetime
-Datetime [s since 2000-01-01]
-
static double
get_solar_declination_angle_from_datetime
(double datetime) Calculate the solar declination angle
- Return
- the solar declination angle [degree]
- Parameters
datetime
-Datetime [s since 2000-01-01]
-
const char *
harp_daytime_ampm_from_datetime_and_longitude
(double datetime, double longitude) Determine whether measurement was taken during day or during night based on solar zenith angle.
- Return
AM
, The measurement was taken between 00:00 and 12:00.PM
, The measurement was taken between 12:00 and 24:00.
- Parameters
datetime
-Datetime [s since 2000-01-01] (using UTC timezone)
longitude
-Longitude [degree_east]
-
int
harp_daytime_from_solar_zenith_angle
(double solar_zenith_angle) Determine whether measurement was taken during day or during night based on solar zenith angle.
- Return
1
, The measurement was taken during the day.0
, The measurement was taken during the night.
- Parameters
solar_zenith_angle
-Solar zenith angle [degree]
-
double
harp_frequency_from_wavelength
(double wavelength) Convert (electromagnetic wave) wavelength to (electromagnetic wave) frequency
- Return
- the frequency [Hz]
- Parameters
wavelength
-Wavelength [nm]
-
double
harp_frequency_from_wavenumber
(double wavenumber) Convert (electromagnetic wave) wavenumber to (electromagnetic wave) frequency
- Return
- the frequency [Hz]
- Parameters
wavenumber
-Wavenumber [1/cm]
-
double
harp_gravity_at_surface_from_latitude
(double latitude)
-
double
harp_gravity_at_surface_from_latitude_and_height
(double latitude, double height)
-
const char *
harp_illumination_condition_from_solar_zenith_angle
(double solar_zenith_angle) Determine whether measurement was taken during day, during twilight or during night based on solar zenith angle.
- Return
- the illumination condition as string “day”, “twilight”, or “night”
- Parameters
solar_zenith_angle
-Solar zenith angle [degree]
-
double
harp_local_curvature_radius_at_surface_from_latitude
(double latitude)
-
double
harp_normalized_radiance_from_radiance_and_solar_irradiance
(double radiance, double solar_irradiance) Convert radiance to normalized radiance
- Return
- the normalized radiance [1]
- Parameters
radiance
-Radiance [mW m-2 sr-1]
solar_irradiance
-Solar irradiance [mW m-2]
-
double
harp_normalized_radiance_from_reflectance_and_solar_zenith_angle
(double reflectance, double solar_zenith_angle) Convert reflectance to normalized radiance
- Return
- the normalized radiance [1]
- Parameters
reflectance
-Reflectance [1]
solar_zenith_angle
-Solar zenith angle [degree]
-
double
harp_radiance_from_normalized_radiance_and_solar_irradiance
(double normalized_radiance, double solar_irradiance) Convert normalized radiance to radiance
- Return
- the radiance [mW m-2 sr-1]
- Parameters
normalized_radiance
-Normalized radiance [1]
solar_irradiance
-Solar irradiance [mW m-2]
-
double
harp_radiance_from_reflectance_solar_irradiance_and_solar_zenith_angle
(double reflectance, double solar_irradiance, double solar_zenith_angle) Convert reflectance to radiance
- Return
- the radiance [mW m-2 sr-1]
- Parameters
reflectance
-Reflectance [1]
solar_irradiance
-Solar irradiance [mW m-2]
solar_zenith_angle
-Solar zenith angle [degree]
-
double
harp_reflectance_from_radiance_solar_irradiance_and_solar_zenith_angle
(double radiance, double solar_irradiance, double solar_zenith_angle) Convert radiance to reflectance
- Return
- the reflectance [1]
- Parameters
radiance
-Radiance [mW m-2 sr-1]
solar_irradiance
-Solar irradiance [mW m-2]
solar_zenith_angle
-Solar zenith angle [degree]
-
double
harp_reflectance_from_normalized_radiance_and_solar_zenith_angle
(double normalized_radiance, double solar_zenith_angle) Convert normalized radiance to reflectance
- Return
- the reflectance [1]
- Parameters
normalized_radiance
-Normalized radiance [mW m-2 sr-1]
solar_zenith_angle
-Solar zenith angle [degree]
-
double
harp_scattering_angle_from_solar_angles_and_viewing_angles
(double sza, double saa, double vza, double vaa) Convert viewing and solar angles into scattering angle
- Return
- the scattering angle [degree]
- Parameters
sza
-Solar Zenith Angle [degree]
saa
-Solar Azimuth Angle [degree]
vza
-Viewing Zenith Angle [degree]
vaa
-Viewing Azimuth Angle [degree]
-
double
harp_solar_azimuth_angle_from_datetime_longitude_and_latitude
(double datetime, double longitude, double latitude) Calculate the solar azimuth angle for the given time and location
- Return
- the solar azimuth angle [degree]
- Parameters
datetime
-Datetime [s since 2000-01-01]
longitude
-Longitude [degree_east]
latitude
-Latitude [degree_north]
-
double
harp_solar_elevation_angle_from_datetime_longitude_and_latitude
(double datetime, double longitude, double latitude) Calculate the solar elevation angle for the given time and location
- Return
- the solar elevation angle [degree]
- Parameters
datetime
-Datetime [s since 2000-01-01]
latitude
-Latitude [degree_north]
longitude
-Longitude [degree_east]
-
double
harp_elevation_angle_from_zenith_angle
(double zenith_angle) Convert zenith angle to elevation angle
- Return
- the elevation angle [degree]
- Parameters
zenith_angle
-Zenith angle[degree]
-
double
harp_zenith_angle_from_elevation_angle
(double elevation_angle) Convert zenith angle to elevation angle
- Return
- the zenith angle [degree]
- Parameters
elevation_angle
-elevation angle [degree]
-
int
harp_viewing_geometry_angles_at_altitude_from_other_altitude
(double source_altitude, double source_solar_zenith_angle, double source_viewing_zenith_angle, double source_relative_azimuth_angle, double target_altitude, double *new_target_solar_zenith_angle, double *new_target_viewing_zenith_angle, double *new_target_relative_azimuth_angle) Convert the solar zenith angle, the viewing zenith angle and relative azimuth angle at one height to another height
- Parameters
source_altitude
-Source altitude [m]
source_solar_zenith_angle
-Solar zenith angle at source altitude [degree]
source_viewing_zenith_angle
-Viewing zenith angle at source altitude [degree]
source_relative_azimuth_angle
-Relative azimuth angle at source altitude [degree]
target_altitude
-Target altitude [m]
new_target_solar_zenith_angle
-Solar zenith angle at target altitude [degree]
new_target_viewing_zenith_angle
-Viewing zenith angle at target altitude [degree]
new_target_relative_azimuth_angle
-Relative azimuth angle at target altitude [degree]
-
int
harp_viewing_geometry_angle_profiles_from_viewing_geometry_angles
(double altitude, double solar_zenith_angle, double viewing_zenith_angle, double relative_azimuth_angle, long num_levels, const double *altitude_profile, double *solar_zenith_angle_profile, double *viewing_zenith_angle_profile, double *relative_azimuth_angle_profile) Calculate the solar zenith angle, the viewing zenith angle, and the relative azimuth angle for the requested altitudes
- Parameters
altitude
-Height corresponding to the input angles (reference altitude) [m]
solar_zenith_angle
-Solar zenith angle at reference altitude [degree]
viewing_zenith_angle
-Viewing zenith angle at reference altitude [degree]
relative_azimuth_angle
-Relative azimuth angle at reference altitude [degree]
num_levels
-Number of levels
altitude_profile
-Altitude profile [m]
solar_zenith_angle_profile
-Solar zenith angles at profile altitudes [degree]
viewing_zenith_angle_profile
-Viewing zenith angles at profile altitudes [degree]
relative_azimuth_angle_profile
-Relative azimuth angles at profile altitudes [degree]
-
double
harp_wavelength_from_frequency
(double frequency) Convert (electromagnetic wave) frequency to (electromagnetic wave) wavelength
- \(\lambda\) : wavelength [1/cm]
- \(f\) : frequency [Hz]
- \(c\) : speed of light [m/s]
- Return
- Wavelength [nm]
- Parameters
frequency
-Frequency [Hz]
-
double
harp_wavelength_from_wavenumber
(double wavenumber) Convert (electromagnetic wave) wavenumber to (electromagnetic wave) wavelength
- \(\nu\) : wavenumber [1/cm]
- \(\lambda\) : wavelength [nm]
- Return
- Wavelength [nm]
- Parameters
wavenumber
-Wavenumber [1/cm]
-
double
harp_wavenumber_from_frequency
(double frequency) Convert (electromagnetic wave) frequency to (electromagnetic wave) wavenumber
- \(\nu\) : wavenumber [1/cm]
- \(f\) : frequency [Hz]
- \(c\) : speed of light [m/s]
- Return
- Wavenumber [1/cm]
- Parameters
frequency
-Frequency [Hz]
-
double
harp_wavenumber_from_wavelength
(double wavelength) Convert (electromagnetic wave) wavelength to (electromagnetic wave) wavenumber
- \(\nu\) : wavenumber [1/cm]
- \(\lambda\) : wavelength [nm]
- Return
- Wavenumber [1/cm]
- Parameters
wavelength
-Wavelength [nm]
-
static double
get_water_vapour_saturation_pressure_from_temperature
(double temperature) Calculate water vapour saturation pressure. Formula from Bolton 1980.
- Return
- the water vapour saturation pressure [hPa]
- Parameters
temperature
-Temperature [K]
-
static double
get_saturation_density_from_temperature
(double temperature) Calculate water water vapour saturation density
- Return
- the water vapour saturation density [molec/m3]
- Parameters
temperature
-Temperature [K]
-
const char *
harp_chemical_species_name
(harp_chemical_species species) Return species name
- Return
- string with name of the species
- Parameters
species
-species enumeration value
-
harp_chemical_species
harp_chemical_species_from_variable_name
(const char *variable_name) Determine species from variable name
- Return
- species enum identifier
- Parameters
variable_name
-variable name
-
double
harp_density_from_partial_column_and_altitude_bounds
(double partial_column, const double *altitude_bounds) Convert a partial column profile to a density profile using the altitude boundaries as provided This is a generic routine to convert partial columns to a densitity profile. It works for all cases where the conversion is a matter of dividing the partial column value by the altitude height to get the density value.
- Return
- the density profile [?/m]
- Parameters
partial_column
-Partial column [?]
altitude_bounds
-Lower and upper altitude [m] boundaries [2]
-
double
harp_mass_density_from_number_density
(double number_density, harp_chemical_species species)
-
double
harp_mass_mixing_ratio_from_volume_mixing_ratio
(double volume_mixing_ratio, harp_chemical_species species)
-
double
harp_mass_mixing_ratio_wet_from_volume_mixing_ratio_and_humidity
(double volume_mixing_ratio, double h2o_mass_mixing_ratio, harp_chemical_species species)
-
double
harp_molar_mass_for_species
(harp_chemical_species species) Get molar mass of species of interest
- Return
- the molar mass [g/mol]
- Parameters
species
-Species enum
-
double
harp_molar_mass_for_wet_air
(double h2o_mass_mixing_ratio) Get molar mass of wet air from H2O mass mixing ratio (humidity)
- Return
- the molar mass of moist air [g/mol]
- Parameters
h2o_mass_mixing_ratio
-Humidity (q) [ug/g]
-
double
harp_number_density_from_mass_density
(double mass_density, harp_chemical_species species) Convert mass density to number_density
- Return
- the number density [molec/m3]
- Parameters
mass_density
-Mass density [ug/m3]
species
-Species enum
-
double
harp_number_density_from_mass_mixing_ratio_pressure_and_temperature
(double mass_mixing_ratio, double pressure, double temperature, harp_chemical_species species) Convert mass mixing ratio to number density
- Return
- the number density [molec/m3]
- Parameters
mass_mixing_ratio
-mass mixing ratio [ug/g]
temperature
-Temperature [K]
pressure
-Pressure [hPa]
species
-Species enum
-
double
harp_number_density_from_partial_pressure_pressure_and_temperature
(double partial_pressure, double pressure, double temperature) Convert partial pressure to number_density
- Return
- the number density [molec/m3]
- Parameters
partial_pressure
-Partial pressure [hPa]
pressure
-Pressure [hPa]
temperature
-Temperature [K]
-
double
harp_number_density_from_volume_mixing_ratio_pressure_and_temperature
(double volume_mixing_ratio, double pressure, double temperature) Convert volume mixing ratio to number_density
- Return
- the number density [molec/m3]
- Parameters
volume_mixing_ratio
-volume mixing ratio [ppmv]
pressure
-Pressure [hPa]
temperature
-Temperature [K]
-
double
harp_partial_column_from_density_and_altitude_bounds
(double density, const double *altitude_bounds) Convert a density to a partial column using the altitude boundaries This is a generic routine to convert adensitity to a partial column. It works for all cases where the conversion is a matter of multiplying the density by the altitude height to get the partial column value.
- Return
- the partial column [?]
- Parameters
density
-Density profile [?/m]
altitude_bounds
-Lower and upper altitude [m] boundaries [2]
-
double
harp_partial_pressure_from_mass_mixing_ratio_and_pressure
(double mass_mixing_ratio, double pressure, harp_chemical_species species) Convert mass mixing ratio to partial pressure
- Return
- the partial pressure [hPa]
- Parameters
mass_mixing_ratio
-Mass mixing ratio [ug/g]
pressure
-Pressure [hPa]
species
-The chemical species for which the mmr was provided
-
double
harp_partial_pressure_from_number_density_pressure_and_temperature
(double number_density, double pressure, double temperature) Convert number density to partial pressure
- Return
- the partial pressure [hPa]
- Parameters
number_density
-Number density [molec/m3]
pressure
-Pressure [hPa]
temperature
-Temperature [K]
-
double
harp_partial_pressure_from_volume_mixing_ratio_and_pressure
(double volume_mixing_ratio, double pressure) Convert volume mixing ratio to partial pressure
- Return
- the partial pressure [hPa]
- Parameters
volume_mixing_ratio
-volume mixing ratio [ppmv]
pressure
-Pressure [hPa]
-
double
harp_pressure_from_gph
(double gph) Convert a geopotential height value value to a pressure value using model values This is a rather inaccurate way of calculating the pressure, so only use it when you can’t use any of the other approaches.
- Return
- pressure value [hPa]
- Parameters
gph
-geopotential height to be converted [m]
-
double
harp_relative_humidity_from_h2o_number_density_and_temperature
(double number_density_h2o, double temperature) Calculate the relative humidity from the given water vapour number density and temperature. The relative humidity is the ratio of the partial pressure of water vapour in a gaseous mixture of air and water vapour to the saturated vapour pressure of water at a given temperature.
- Return
- the relative humidity [%]
- Parameters
number_density_h2o
-Water vapour number density [molec/m3]
temperature
-Temperature [K]
-
double
harp_virtual_temperature_from_pressure_temperature_and_relative_humidity
(double pressure, double temperature, double relative_humidity) Calculate the virtual temperature
- Return
- the virtual temperature [K]
- Parameters
pressure
-Pressure [hPa]
temperature
-Temperature [K]
relative_humidity
-Relative humidity [%]
-
double
harp_volume_mixing_ratio_from_mass_mixing_ratio
(double mass_mixing_ratio, harp_chemical_species species) Convert mass mixing ratio to volume mixing ratio
- Return
- the volume mixing ratio [ppmv]
- Parameters
mass_mixing_ratio
-Mass mixing ratio [ug/g]
species
-Molecular species
-
double
harp_volume_mixing_ratio_from_mass_mixing_ratio_wet_and_humidity
(double mass_mixing_ratio, double h2o_mass_mixing_ratio, harp_chemical_species species) Convert mass mixing ratio w.r.t moist air to volume mixing ratio
- Return
- the volume mixing ratio [ppmv]
- Parameters
mass_mixing_ratio
-Mass mixing ratio of species [ug/g]
h2o_mass_mixing_ratio
-Mass mixing ratio of H2O [ug/g]
species
-Molecular species
-
double
harp_volume_mixing_ratio_from_number_density_pressure_and_temperature
(double number_density, double pressure, double temperature) Convert number density to volume mixing ratio
- Return
- the volume mixing ratio [ppmv]
- Parameters
number_density
-Number density [molec/m3]
temperature
-Temperature [K]
pressure
-Pressure [hPa]
-
double
harp_volume_mixing_ratio_from_partial_pressure_and_pressure
(double partial_pressure, double pressure) Convert partial pressure to volume mixing ratio
- Return
- the volume mixing ratio [ppmv]
- Parameters
partial_pressure
-Partial pressure of constituent [hPa]
pressure
-Pressure of air [hPa]
-
double
harp_ocean_frequency_from_ocean_period
(double ocean_period) Convert ocean wave period to ocean wave frequency
- Return
- the ocean frequency [Hz]
- Parameters
ocean_period
-Ocean wave period [s]
-
double
harp_ocean_frequency_from_ocean_wavelength
(double ocean_wavelength) Convert ocean wave wavelength to ocean wave frequency
- Return
- the ocean wave frequency f [Hz]
- Parameters
ocean_wavelength
-Wavelength [m]
-
double
harp_ocean_frequency_from_ocean_wavenumber
(double ocean_wavenumber) Convert ocean wave wavenumber to ocean wave frequency using the deep water dispersion relation (the depth of the ocean is much greater than the ocean wave’s wavelength)
- Return
- the ocean wave frequency f [Hz]
- Parameters
ocean_wavenumber
-Wavenumber [m]
-
double
harp_ocean_period_from_ocean_frequency
(double ocean_frequency) Convert ocean wave frequency to ocean wave period
- Return
- the ocean wave period T [s]
- Parameters
ocean_frequency
-Frequency [Hz]
-
double
harp_ocean_period_from_ocean_wavelength
(double ocean_wavelength) Convert ocean wave wavelength to ocean wave period using the deep water dispersion relation
- Return
- the ocean wave period T [s]
- Parameters
ocean_wavelength
-Wavelength [m]
-
double
harp_ocean_period_from_ocean_wavenumber
(double ocean_wavenumber) Convert ocean wave wavenumber to ocean wave period using the deep water dispersion relation
- Return
- the ocean wave period T [s]
- Parameters
ocean_wavenumber
-Wavenumber [m]
-
double
harp_ocean_wavelength_from_ocean_frequency
(double ocean_frequency) Convert ocean wave frequency to ocean wave wavelength, using the deep water dispersion relation
- Return
- the ocean wave wavelength [m]
- Parameters
ocean_frequency
-Frequency [Hz]
-
double
harp_ocean_wavelength_from_ocean_period
(double ocean_period) Convert ocean wave period to ocean wave wavelength using the deep water dispersion relation
- Return
- the ocean wave wavelength [m]
- Parameters
ocean_period
-Ocean wave period T [s]
-
double
harp_ocean_wavelength_from_ocean_wavenumber
(double ocean_wavenumber) Convert ocean wave wavenumber to ocean wave wavelength
- Return
- the ocean wave wavelength [m]
- Parameters
ocean_wavenumber
-Wavenumber k [1/m]
-
double
harp_ocean_wavenumber_from_ocean_frequency
(double ocean_frequency) Convert ocean wave frequency to ocean wave wavenumber, using the deep water dispersion relation
- Return
- the ocean wave wavenumber k [1/m]
- Parameters
ocean_frequency
-Frequency f [Hz]
-
double
harp_ocean_wavenumber_from_ocean_period
(double ocean_period) Convert ocean wave period to ocean wave wavelength using the deep water dispersion relation
- Return
- the ocean wave wavenumber [1/m]
- Parameters
ocean_period
-Ocean wave period T [s]
-
double
harp_ocean_wavenumber_from_ocean_wavelength
(double ocean_wavelength) Convert ocean wave wavelength to ocean wave wavenumber
- Return
- the ocean wave wavenumber k [1/m]
- Parameters
ocean_wavelength
-Wavelength [Hz]
-
double
harp_sea_surface_temperature_skin_from_subskin_wind_speed_and_solar_zenith_angle
(double sst_subskin, double wind_speed, double solar_zenith_angle) Convert subskin to skin sea surface temperature
- Return
- the skin sea surface temperature [K]
- Parameters
sst_subskin
-Subskin sea surface temperature [K]
wind_speed
-Wind speed [m/s]
solar_zenith_angle
-Solar zenith angle [degree]
-
double
harp_sea_surface_temperature_subskin_from_skin_wind_speed_and_solar_zenith_angle
(double sst_skin, double wind_speed, double solar_zenith_angle) Convert skin to subskin sea surface temperature
- Return
- the subskin sea surface temperature [K]
- Parameters
sst_skin
-Skin sea surface temperature [K]
wind_speed
-Wind speed [m/s]
solar_zenith_angle
-Solar zenith angle [degree]
-
int
harp_profile_altitude_bounds_from_altitude
(long num_levels, const double *altitude_profile, double *altitude_bounds_profile) Construct an altitude boundaries profile from an altitude profile
- Return
0
, Success.-1
, Error occurred (check harp_errno).
- Parameters
num_levels
-Number of levels
altitude_profile
-Altitude vertical profile
altitude_bounds_profile
-variable in which the altitude boundaries profile with dimensions [num_levels, 2] will be stored
-
double
harp_altitude_from_gph_and_latitude
(double gph, double latitude) Convert geopotential height to geometric height (= altitude)
- Return
- the altitude [m]
- Parameters
gph
-Geopotential height [m]
latitude
-Latitude [degree_north]
-
void
harp_profile_altitude_from_pressure_temperature_h2o_mmr_and_latitude
(long num_levels, const double *pressure_profile, const double *temperature_profile, const double *h2o_mmr_profile, double surface_pressure, double surface_height, double latitude, double *altitude_profile) Convert a pressure profile to an altitude profile If the h2o_mmr_profile variable is set to NULL a constant mean molar mass for wet air will be used for the conversion (instead of a calculated molar mass of humid air). If the temperature_profile variable is set to NULL the standard temperature will be used for the conversion.
- Return
0
, Success.-1
, Error occurred (check harp_errno).
- Parameters
num_levels
-Length of vertical axis
pressure_profile
-Pressure vertical profile [hPa]
temperature_profile
-Temperature vertical profile [K]
h2o_mmr_profile
-Humidity (q) vertical profile [ug/g] (optional)
surface_pressure
-Surface pressure [hPa]
surface_height
-Surface height [m]
latitude
-Latitude [degree_north]
altitude_profile
-variable in which the vertical profile will be stored [m]
-
double
harp_gph_from_altitude_and_latitude
(double altitude, double latitude) Convert geometric height (= altitude) to geopotential height
- Return
- the geopotential height [m]
- Parameters
altitude
-Altitude [m]
latitude
-Latitude [degree_north]
-
double
harp_gph_from_pressure
(double pressure) Convert a pressure value to a geopotential height value using model values This is a rather inaccurate way of calculating the geopotential height, so only use it when you can’t use any of the other approaches.
- Return
- geopotential height [m]
- Parameters
pressure
-Pressure value to be converted [hPa]
-
void
harp_profile_gph_from_pressure_temperature_and_h2o_mmr
(long num_levels, const double *pressure_profile, const double *temperature_profile, const double *h2o_mmr_profile, double surface_pressure, double surface_height, double *gph_profile) Convert a pressure profile to a geopotential height profile If the h2o_mmr_profile variable is set to NULL a constant mean molar mass for wet air will be used for the conversion (instead of a calculated molar mass of humid air). If the temperature_profile variable is set to NULL the standard temperature will be used for the conversion.
- Parameters
num_levels
-Length of vertical axis
pressure_profile
-Pressure vertical profile [hPa]
temperature_profile
-Temperature vertical profile [K]
h2o_mmr_profile
-Humidity (q) vertical profile [ug/g] (optional)
surface_pressure
-Surface pressure [hPa]
surface_height
-Surface height [m]
gph_profile
-Variable in which the vertical profile will be stored [m]
-
double
harp_profile_column_from_partial_column
(long num_levels, const double *partial_column_profile) Integrate the partial column profile to obtain the column
- Return
- column the integrated column [molec/m2]
- Parameters
num_levels
-Number of levels of the partial column profile
partial_column_profile
-Partial column profile [molec/m2]
-
double
harp_profile_column_uncertainty_from_partial_column_uncertainty
(long num_levels, const double *partial_column_uncertainty_profile) Integrate the partial column uncertainty profile to obtain the column uncertainty
- Return
- the integrated column uncertainty [molec/m2]
- Parameters
num_levels
-Number of levels of the partial column profile
partial_column_uncertainty_profile
-Partial column profile [molec/m2]
-
void
harp_profile_nd_cov_from_vmr_cov_pressure_and_temperature
(long num_levels, const double *volume_mixing_ratio_covariance_matrix, const double *pressure_profile, const double *temperature_profile, double *number_density_covariance_matrix) Convert a volume mixing ratio covariance matrix to a number density covariance matrix
- Parameters
num_levels
-Number of levels of the profile
volume_mixing_ratio_covariance_matrix
-volume mixing ratio covariance [(ppmv)^2]
pressure_profile
-Pressure [hPa]
temperature_profile
-Temperature [K]
number_density_covariance_matrix
-variable in which the number density covariance [(molec/m3)^2] will be stored
-
int
harp_profile_partial_column_cov_from_density_cov_and_altitude_bounds
(long num_levels, const double *altitude_boundaries, const double *density_covariance_matrix, double *partial_column_covariance_matrix) Convert a density uncertainty profile to a partial column covariance matrix using the altitude boundaries as provided
- Return
0
, Success.-1
, Error occurred (check harp_errno).
- Parameters
num_levels
-Number of levels of the profile
altitude_boundaries
-Lower and upper altitude [m] boundaries for each level [num_levels,2]
density_covariance_matrix
-Density covariance [(?/m)^2]
partial_column_covariance_matrix
-variable in which the partial column covariance matrix [(?)^2] will be stored
-
int
harp_partial_column_profile_regridded_from_density_profile_and_altitude_boundaries
(long source_num_levels, const double *source_altitude_boundaries, const double *source_density_profile, long target_num_levels, const double *target_altitude_boundaries, double *target_partial_column_profile) Regrid the density profile to obtain the partial column profile, using interval interpolation
- Return
0
, Success.-1
, Error occurred (check harp_errno).
- Parameters
source_num_levels
-Number of levels of the source altitude profile
source_altitude_boundaries
-Lower and upper boundaries [source_num_levels,2] of source altitude layers [m]
source_density_profile
-Density profile [?/m3] on source altitude grid
target_num_levels
-Number of levels of the target partial column profile
target_altitude_boundaries
-Lower and upper boundaries [target_num_levels,2] of target altitude layers [m]
target_partial_column_profile
-The partial column profile [?/m2]
-
int
harp_partial_column_covariance_matrix_regridded_from_density_covariance_matrix_and_altitude_boundaries
(long source_num_levels, const double *source_altitude_boundaries, const double *source_density_covariance_matrix, long target_num_levels, const double *target_altitude_boundaries, double *target_partial_column_covariance_matrix) Regrid the density profile covariance matrix to obtain the partial column profile covariance matrix, using interval interpolation
- Return
0
, Success.-1
, Error occurred (check harp_errno).
- Parameters
source_num_levels
-Number of levels of the source altitude profile
source_altitude_boundaries
-Lower and upper boundaries [source_num_levels,2] of source altitude layers [m]
source_density_covariance_matrix
-Density profile covariance matrix [(?/m3)^2] on source altitude grid
target_num_levels
-Number of levels of the target partial column profile
target_altitude_boundaries
-Lower and upper boundaries [target_num_levels,2] of target altitude layers [m]
target_partial_column_covariance_matrix
-The partial column profile covariance matrix [(?/m2)^2]
-
int
harp_profile_pressure_from_altitude_temperature_h2o_mmr_and_latitude
(long num_levels, const double *altitude_profile, const double *temperature_profile, const double *h2o_mmr_profile, double surface_pressure, double surface_height, double latitude, double *pressure_profile) Convert an altitude profile to a pressure profile If the h2o_mmr_profile variable is set to NULL a constant mean molar mass for wet air will be used for the conversion (instead of a calculated molar mass of humid air). If the temperature_profile variable is set to NULL the standard temperature will be used for the conversion.
- Return
0
, Success.-1
, Error occurred (check harp_errno).
- Parameters
num_levels
-Length of vertical axis
altitude_profile
-Altitude profile [m]
temperature_profile
-Temperature vertical profile [K]
h2o_mmr_profile
-Humidity (q) vertical profile [ug/g] (optional)
surface_pressure
-Surface pressure [hPa]
surface_height
-Surface height [m]
latitude
-Latitude [degree_north]
pressure_profile
-variable in which the vertical profile will be stored [hPa]
-
int
harp_profile_pressure_from_gph_temperature_and_h2o_mmr
(long num_levels, const double *gph_profile, const double *temperature_profile, const double *h2o_mmr_profile, double surface_pressure, double surface_height, double *pressure_profile) Convert a geopotential height profile to a pressure profile If the h2o_mmr_profile variable is set to NULL a constant mean molar mass for wet air will be used for the conversion (instead of a calculated molar mass of humid air). If the temperature_profile variable is set to NULL the standard temperature will be used for the conversion.
- Return
0
, Success.-1
, Error occurred (check harp_errno).
- Parameters
num_levels
-Length of vertical axis
gph_profile
-Geopotential height profile [m]
temperature_profile
-Temperature vertical profile [K]
h2o_mmr_profile
-Humidity (q) vertical profile [ug/g] (optional)
surface_pressure
-Surface pressure [hPa]
surface_height
-Surface height [m]
pressure_profile
-Variable in which the vertical profile will be stored [hPa]
-
int
harp_profile_vmr_cov_from_nd_cov_pressure_and_temperature
(long num_levels, const double *number_density_covariance_matrix, const double *pressure_profile, const double *temperature_profile, double *volume_mixing_ratio_covariance_matrix) Convert a number density covariance matrix to a volume mixing ratio covariance matrix
- Return
0
, Success.-1
, Error occurred (check harp_errno).
- Parameters
num_levels
-Length of vertical axis
number_density_covariance_matrix
-number density covariance [(molec/m3)^2]
pressure_profile
-Pressure [hPa]
temperature_profile
-Temperature [K]
volume_mixing_ratio_covariance_matrix
-variable in which the volume mixing ratio covariance [(ppmv)^2] will be stored
-