Using ArcGIS to map forest clearing needs to get full sunlight on a point

3559
8
09-27-2014 07:16 AM
PhilFreeman
New Contributor II

I have ArcMap skills that are on the low end of "intermediate" and do volunteer work for a non-profit conservation organization.  I have what I think is a conceptually simple problem, but so far haven't found an automated practical solution:

Within a forested area with flat terrain, I have a point location where I want to provide full sunlight. Assume the surrounding forest is of uniform height.  NOAA  has a website which will calculate the position of the sun - both azimuth and height above the horizon - for any day and time given the latitude and longitude of the site.  The site provides spreadsheets that include the calculations.  I want the point to receive 100% of available sunlight from May 15-Sept 30, and I wish to calculate and map the extent of forest that must be cleared to provide this sunlight.  If the tree height is 65 feet and X is the distance from the point for which all the trees must be cut, then I believe (please correct me if I am in error) that X for a date and time can be simply calculated by dividing 65 by the tangent of the angle of the sun's elevation above the horizon at that moment.  The resulting solution will be the extent of clearing needed on that date at an azimuth from the point equal to the azimuth of the sun's location at that time on that date.  For this purpose I can ignore the small differences year-to-year in the sun's position on a given date.  So, conceptually, all I would need to do is apply the NOAA data to perform these calculations for each day between May 15 and Sept. 30 during the daylight hours at some time interval - maybe 5 or ten minutes.  For a given date and time, I could then use an ArcMap tool to create a point x distance from the point of interest at the calculated azimuth.  Starting at about due east and working clockwise to about due west, I would then determine the greatest plotted distance X by some rounded azimuth interval, connect the resulting points and have a map of the extent of clearing needed.  Conceptually simple but impractical due to time required.  Given that solar installers need to solve this problem routinely, I think somebody surely has created an ArcMap tool to do this, but I can't find it.  Can anybody help me with this?  I would greatly appreciate it.

 

Here's the link to the NOAA site:  http://http://www.esrl.noaa.gov/gmd/grad/solcalc/

Tags (1)
0 Kudos
8 Replies
PhilFreeman
New Contributor II

I realized that I should have clarified this.  I don't expect anybody to attempt to incorporate the NOAA coding into an ArcGIS script.  I mainly am hoping some of you know about a tool or application that will do what I want.  If all else fails, I think I can use a combination of a VB script in Excel and ArcMap tools.

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi Phil,

Although the question might seem easy, there is no standard tool in ArcGIS to create this type of output. The Solar Radiation tools in ArcGIS can evaluated the polygon derived in your analysis: ArcGIS Help (10.2, 10.2.1, and 10.2.2)

For questions like yours, a python script might be an option. I created a start for you based on a script "sunpos.py" downloaded from:

https://raw.githubusercontent.com/minopret/sunpos/master/sunpos.py

The idea is to iterate over a date interval. During the iteration there is a second loop over a time interval. I would suggest that you avoid getting near to sunrise and sunset since this would create an angle so small that you would have to clear a lot of forest. Based on the location provided (lat, lon values in script) the altitude and azimuth are returned for each date, time. To make this data manageable, I rounded azimuth to a whole number and create a dictionary to hold the minimum altitude values of the sun. At the end the dictionary is sorted and can be used (not yet implemented) to translate to distance of clearing forest. The azimuth and distance should be translated to a geographic location and can be combined to create a polygon for logging.

import sunpos

# downloaded from: https://raw.githubusercontent.com/minopret/sunpos/master/sunpos.py

import collections

from datetime import date, timedelta

# setting

start_date = date(2014, 5, 15)

end_date = date(2014, 9, 30)

start_time = 9 # 9 am

end_time = 17 # 5 pm

time_interval = 1 # 0.25 = every 15 minutes

lat = 4.5

lon = -74

dct = {}

d = start_date

delta = timedelta(days=1)

while d <= end_date:

    t = start_time

    while t <= end_time:

        alt, azi = sunpos.time_and_location_to_sun_alt_azimuth(d.year, d.month, d.day, t, lat, lon)

        azi2 = round(azi)

        if azi2 in dct:

            if alt < dct[azi2]:

                dct[azi2] = alt

        else:

            dct[azi2] = alt

        # update dictionary (rounded azimuth vs min altitud)

        t += time_interval

    d += delta

odct = collections.OrderedDict(sorted(dct.items()))

# now you have a list of angles that you could translate to a distance

print "azimuth\taltitud"

for azi, alt in odct.items():

    print "{0}\t{1}".format(azi, alt if alt <= 90 else 360 - alt)

Hope this helps you a bit.

Kind regards, Xander

0 Kudos
PhilFreeman
New Contributor II

Thank you, Xander - I appreciate the help. While I am not at all competent with python, I had decided to pretty much do what you are talking about in Excel with a VBA script, and then import the results into ArcMap. I have started working with the Excel spreadsheet that I downloaded from NOAA and am going from there. I did take a very basic online course from ESRI in Python, but one of these days I will buckle down and learn it.

Regards,

Phil Freeman

0 Kudos
XanderBakker
Esri Esteemed Contributor

Good to hear that Phil. Python is the scripting language for these type of problems. If you manage to solve the problem, share a little map of the result. It will be interesting to see what it looks like.

Kind regards, Xander

0 Kudos
PhilFreeman
New Contributor II

Will do.

Phil

0 Kudos
PhilFreeman
New Contributor II

Xander,

Attached is the map I created using the methodology we discussed. Basically, what I did was compute a clearing distance at intervals of 1 degree azimuth from a spot near the center of the nesting pad (this is a wood turtle nesting habitat project). I repeated this for each day during the time of interest – May 20-September 15 – between 8:30 A.M. and 7:00 P.M. Then, after making these computations, I used the greatest clearing distance for each azimuth. The ones outside of the pine stand are essentially irrelevant because the vegetation there is low. I assumed a 70 foot height for the pine stand and did the computations using the NOAA spreadsheet for sun azimuth and angle above the horizon and calculating the distance by dividing 70 feet by the tangent of the sun’s angle above the horizon. I made it an iterative process using a VBA macro in the spreadsheet and printing the end results to a second sheet I created. Does all of this seem right to you?

Thanks.

Phil Freeman

Bayfield Regional Conservancy

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi Phil,

Thanks for sharing! It sounds correct to me, although some of the point locations look a bit odd (at the extremes east and west, but might have to do with the differences in angle when it's near to sunrise or sunset). You could use the solar radiation tools provided by ArcGIS to test the area you want to clear. You should add the trees (area not being logged with an altitude of 70ft) and test the solar radiation it receives.

Kind regards, Xander

0 Kudos
PhilFreeman
New Contributor II

Thank you, Xander. I too thought those locations looked odd, but I can’t find any flaws. You know, most of us kind of take the sun and its location in the sky for granted, but I think you nailed it regarding especially sunset. I believe the time period we specified and the times of day resulted in that long tail to the west. Fortunately, the sky is open in that direction so it won’t affect what we do. am a forester by training and profession, and this exercise reinforces what I have always known – that small openings (this “stand” is only about ¼ acre ) just are not sufficient for regenerating shade-intolerant forest types.

Phil

0 Kudos