# insolation¶

This module contains general-purpose routines for computing daily-average incoming solar radiation at the top of the atmosphere.

Example: Compute the timeseries of insolation at 65N at summer solstice over the past 5 Myears: import numpy as np from climlab.solar.orbital import OrbitalTable from climlab.solar.insolation import daily_insolation # array with specified kyears (can be plain numpy or xarray.DataArray) years = np.linspace(-5000, 0, 5001) # subset of orbital parameters for specified time orb = OrbitalTable.interp(kyear=years) # insolation values for past 5 Myears at 65N at summer solstice (day 172) S65 = daily_insolation(lat=65, day=172, orb=orb) # returns an xarray.DataArray object with insolation values in W/m2 

Note

Ported and modified from MATLAB code daily_insolation.m

Original authors:

Ian Eisenman and Peter Huybers, Harvard University, August 2006

Available online at http://eisenman.ucsd.edu/code/daily_insolation.m

If using calendar days, solar longitude is found using an approximate solution to the differential equation representing conservation of angular momentum (Kepler’s Second Law). Given the orbital parameters and solar longitude, daily average insolation is calculated exactly following [Berger_1978]. Further references: [Berger_1991].

climlab.solar.insolation.daily_insolation(lat, day, orb={'ecc': 0.017236, 'long_peri': 281.37, 'obliquity': 23.446}, S0=1365.2, day_type=1)[source]

Compute daily average insolation given latitude, time of year and orbital parameters.

Orbital parameters can be interpolated to any time in the last 5 Myears with climlab.solar.orbital.OrbitalTable (see example above).

Longer orbital tables are available with climlab.solar.orbital.LongOrbitalTable

Inputs can be scalar, numpy.ndarray, or xarray.DataArray.

The return value will be numpy.ndarray if all the inputs are numpy. Otherwise xarray.DataArray.

Function-call argument

Parameters: lat (array) – Latitude in degrees (-90 to 90). day (array) – Indicator of time of year. See argument day_type for details about format. orb (dict) – a dictionary with three members (as provided by climlab.solar.orbital.OrbitalTable) 'ecc' - eccentricity unit: dimensionless default value: 0.017236 'long_peri' - longitude of perihelion (precession angle) unit: degrees default value: 281.37 'obliquity' - obliquity angle unit: degrees default value: 23.446 S0 (float) – solar constant unit: $$\textrm{W}/\textrm{m}^2$$ default value: 1365.2 day_type (int) – Convention for specifying time of year (+/- 1,2) [optional]. day_type=1 (default): day input is calendar day (1-365.24), where day 1 is January first. The calendar is referenced to the vernal equinox which always occurs at day 80. day_type=2: day input is solar longitude (0-360 degrees). Solar longitude is the angle of the Earth’s orbit measured from spring equinox (21 March). Note that calendar days and solar longitude are not linearly related because, by Kepler’s Second Law, Earth’s angular velocity varies according to its distance from the sun. ValueError if day_type is neither 1 nor 2 Daily average solar radiation in unit $$\textrm{W}/\textrm{m}^2$$. Dimensions of output are (lat.size, day.size, ecc.size) array

Code is fully vectorized to handle array input for all arguments.

Orbital arguments should all have the same sizes. This is automatic if computed from lookup_parameters()

For more information about computation of solar insolation see the Tutorials chapter.
climlab.solar.insolation.solar_longitude(day, orb={'ecc': 0.017236, 'long_peri': 281.37, 'obliquity': 23.446}, days_per_year=None)[source]

Estimates solar longitude from calendar day.

Method is using an approximation from [Berger_1978] section 3 (lambda = 0 at spring equinox).

Function-call arguments

Parameters: day (array) – Indicator of time of year. orb (dict) – a dictionary with three members (as provided by OrbitalTable) 'ecc' - eccentricity unit: dimensionless default value: 0.017236 'long_peri' - longitude of perihelion (precession angle) unit: degrees default value: 281.37 'obliquity' - obliquity angle unit: degrees default value: 23.446 days_per_year (float) – number of days in a year (optional) (default: 365.2422) Reads the length of the year from constants if available. solar longitude lambda_long in dimension( day.size, ecc.size ) array

Works for both scalar and vector orbital parameters.