4.5

4.5 | 2 ratings Rate this file 23 downloads (last 30 days) File Size: 17.94 KB File ID: #5430

Sun Azimuth Data

by Khalil Sultan

 

08 Jul 2004 (Updated 09 Jul 2004)

Code covered by BSD License  

A script for generation of an ASCII File (Report) containing Sun Azimuth Data.

Download Now | Watch this File

File Information
Description

Using this script, you can generate a set of data regarding Sun Azimuth Positions at various instants of time for any location on Earth. This data can be used in many applications, like, in determination of orientation of any plane's azimuth from True North.

The syntax is 'sun_azimuth_data' (no arguments). It prompts for Observer's geodetic coordinates, observer's time zone and starting time [according to local standard time]. Then, it asks the Time Period and intervals for which Sun Azimuth data has to be generated. It creates a MS Word file containing Sun Azimuth data.

Author offers his acknowledgements for the script 'sun_position.m' by Vincent Roy, which returns the Sun Position data for a given observer location and time.

History
25/05/2004 - Original Creation by Khalil Sultan (khalilsultan@msn.com)
15/06/2004 - Code Modified.
08/07/2004 - Code Re-modified and Uploaded on MATLAB Central - File Exchange.

Sample Interaction with the Script :
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

WARNING:
Skipping any field, with a hyphen before it, will result in termination of execution of this script. Fields with some value, in square brackets after them, represent their default values.
 
- Enter the Location of the Observer: Karachi
  Enter the Country of the Observer: Pakistan
  Enter the GPS Receiver Set Title:
 
- Enter the Longitude (in dd.dddddd° Format) : E 68.35
- Enter the Latitude (in dd.dddddd° Format) : N 19.15
  Enter the Altitude (in meters) [0] :
- Enter the Time Zone (+GMT Zone) : +5
 
- Should the data be generated for today [y/n] : y
- Enter the Starting Time (in HH:MM:SS [24 Hours] format) : 16:00:00
  Enter the Duration of Interval (in minutes) [5] :
  Enter the Total Time Span (in hours) [2 Hours] :

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
sun_position.m

MATLAB release MATLAB 6.5 (R13)
Zip File Content  
Other Files validate.m,
08Jul2004Karachi.doc,
About the Script.doc,
List of files.txt,
formatchange.m,
sun_azimuth_data.m,
sun_position.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
16 Feb 2006 ALLAH NAWAZ KHAN

Very Nice.... Khalil Sultan..........
it is really accurate to an extent....
nice use matlab by Khalil Sultan.

28 Aug 2009 Hanno Ix

Using the data suggested in the initial comment of this m-file I received results different from the suggested results:

location.longitude = -105.1786;
location.latitude = 39.742476;
location.altitude = 1830.14;
time.year = 2003;
time.month = 10;
time.day = 17;
time.hour = 12;
time.min = 30;
time.sec = 30;
time.UTC = -7;

sun = sun_position(time, location);
%
% sun =
%
% zenith: 50.1080438859849
% azimuth: 194.341174010338

RESULTS SEEN HERE:

>> sun
sun =
     zenith: 50.107627161847546
    azimuth: 1.943412241230940e+002

I am using MATLAB vs. 7.6.0.324 (R2008a). I wonder if there is anyone who has seen a comparable discrepancy and if/how this was resolved.

Regards

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
script Khalil Sultan 22 Oct 2008 07:26:34
ascii Khalil Sultan 22 Oct 2008 07:26:34
data Khalil Sultan 22 Oct 2008 07:26:34
sun azimuth Khalil Sultan 22 Oct 2008 07:26:34
positions Khalil Sultan 22 Oct 2008 07:26:34
earth sciences Khalil Sultan 22 Oct 2008 07:26:34
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com