pvl_ephemeris

Calculates the position of the sun given time, location, and optionally pressure and temperature

Contents

Syntax

[SunAz, SunEl, ApparentSunEl, SolarTime] = pvl_ephemeris(Time, Location)

[SunAz, SunEl, ApparentSunEl, SolarTime] = pvl_ephemeris(Time, Location, Pressure)

[SunAz, SunEl, ApparentSunEl, SolarTime] = pvl_ephemeris(Time, Location, Pressure, Temperature)

[SunAz, SunEl, ApparentSunEl, SolarTime] = pvl_ephemeris(Time, Location, 'temperature', Temperature)

Description

[SunAz, SunEl, ApparentSunEl, SolarTime] = pvl_ephemeris(Time, Location) : Uses the given Time and Location structs to compute sun positions with atmospheric pressure assumed to be 1 atm (101325 Pa) and the temperature assumed to be 12 C.

[SunAz, SunEl, ApparentSunEl, SolarTime] = pvl_ephemeris(Time, Location, Pressure): Uses the given Time and Location structs with the given Pressure to determine sun positions. The temperature is assumed to be 12C. Pressure must be given in Pascals (1atm = 101325 Pa). Pressure may be estimated from altitude using pvl_alt2pres.

[SunAz, SunEl, ApparentSunEl, SolarTime] = pvl_ephemeris(Time, Location, Pressure, Temperature) : Uses the given Time and Location structs with the given Pressure and Temperature to determine sun positions. Pressure must be given in Pascals, and temperature must be given in C.

[SunAz, SunEl, ApparentSunEl, SolarTime] = pvl_ephemeris(Time, Location, 'temperature', Temperature) : Uses the given Time and Location structs with the given Temperature (in C) to determine sun positions. Default pressure is 101325 Pa.

Inputs

Time is a struct with the following elements, note that all elements can be column vectors, but they must all be the same length:

Location is a struct with the following elements:

Outputs

Example

Plot aparent sun elevation angle for Albuquerque for Jan 1, 2012 This example uses the function pvl_maketimestruc

Location.latitude = 35.04;
Location.longitude = -106.62;
Location.altitude = 1619;
% Create 1-min time series for Jan 1, 2012
DN = datenum(2012, 1,1):1/(24*60):datenum(2012, 1, 1, 23, 59, 59);
Time = pvl_maketimestruct(DN, -7);
%
[SunAz, SunEl, ApparentSunEl, SolarTime]=pvl_ephemeris(Time, Location);
dHr = Time.hour+Time.minute./60+Time.second./3600; % Calculate decimal hours for plotting
figure
plot(dHr,ApparentSunEl)
ylim([0 60])
title('Solar Elevation Angle on Jan 1, 2012 in Albuquerque, NM','FontSize',14)
xlabel('Hour of the Day (hr)')
ylabel('Solar Elevation Angle (deg)')

References

[1] Grover Hughes, Engineering Astronomy, Sandia National Laboratories, February 1985.

See Also

pvl_maketimestruct , pvl_makelocationstruct, pvl_alt2pres, pvl_getaoi

Copyright 2014 Sandia National Laboratories