Application Programming Interface (APIs)

Documenting the public user interface

Orbital Parameters

Insolation.orbital_paramsMethod
orbital_params(od::OrbitalData, dt::FT) where {FT <: Real}

Parameters are interpolated from the values given in the Laskar 2004 dataset using a cubic spline interpolation.

See OrbitalData.

source
Insolation.OrbitalDataType
OrbitalData

The parameters vary due to Milankovitch cycles.

Orbital parameters from the Laskar 2004 paper are lazily downloaded from Caltech Box to the orbital_parameters_dataset_path(artifact_dir) path where artifact_dir is the path and filename to save the artifacts toml file.

source

Zenith Angle

Insolation.daily_zenith_angleMethod
daily_zenith_angle(date::DateTime,
                   data0::DateTime,
                   od::OrbitalData,
                   latitude::FT,
                   param_set::IP.AIP;
                   eot_correction::Bool=true,
                   milankovitch::Bool=true) where {FT <: Real}

Returns the effective zenith angle corresponding to the diurnally averaged insolation and earth-sun distance at a particular latitude given the date.

param_set is an AbstractParameterSet from ClimaParams.jl.

eot_correction is an optional Boolean keyword argument that defaults to true when set to true the equation of time correction is turned on. This switch functionality is implemented for easy comparisons with reanalyses.

milankovitch is an optional Boolean keyword argument that defaults to true when set to true the orbital parameters are calculated for the given DateTime, when set to false the orbital parameters at the J2000 epoch from ClimaParams are used.

source
Insolation.distance_declination_hourangleMethod
distance_declination_hourangle(
    date::DateTime,
    date0::DateTime,
    (ϖ, γ, e)::Tuple{FT, FT, FT},
    param_set::IP.AIP,
    eot_correction::Bool,
) where {FT}

Returns the earth-sun distance (m), declination angle (radians) and hour angle (radians), at 0ᵒ longitude, given the current datetime, epoch datetime, longitude of the perihelion at epoch, obliquity at epoch, eccentricity at epoch, and eot_correction.

source
Insolation.instantaneous_zenith_angleMethod
instantaneous_zenith_angle(
    d::FT,
    δ::FT,
    η_UTC::FT,
    longitude::FT,
    latitude::FT,
) where {FT}

Returns the zenith angle (radians), azimuthal angle (radians) and Earth-Sun distance (m) at a particular longitude (degrees) and latitude (degrees) given Earth-Sun distance (m), declination angle (radians), and hour angle (radians) at 0ᵒ longitude.

source

Insolation

Insolation.insolationMethod
insolation(θ::FT, d::FT, param_set::IP.AIP) where {FT <: Real}

Returns the insolation given the zenith angle and earth-sun distance param_set is an AbstractParameterSet from ClimaParams.jl.

source
Insolation.solar_flux_and_cos_szaMethod
solar_flux_and_cos_sza(date::DateTime,
                  date0::DateTime,
                  od::OrbitalData,
                  longitude::FT,
                  latitude::FT,
                  param_set::IP.AIP) where {FT <: Real}

Returns the top-of-atmosphere (TOA) solar flux, i.e. the total solar irradiance (TSI) weighted by the earth-sun distance and cos(solar zenith angle) for input to RRTMGP.jl param_set is an AbstractParameterSet from ClimaParams.jl.

source