Select to view content in your preferred language

Points solar radiation in an hourly basis for a whole year.

2905
4
11-15-2013 07:12 AM
JimenoFonseca
New Contributor
Hi there,

I have been working lately on setting the points solar radiation routine to calculate the 8760 values of solar radiation in the year for a set of points in a single run.

The routine in ArcGIS 10.1 does it already for as much as an hourly scale but on a daily basis and only delivering apparently those hours with solar irradiance (not exactly the 24 hours)

To solve this, it is necessary to run the algorithm for every day of the year + identifying the hours of daylight of the day and do the correction to obtain 8760. Is there a way to edit the source code or do it so in a simpler manner?

Thanks,

Jimeno
0 Kudos
4 Replies
ShaunWalbridge
Esri Regular Contributor
Hello Jimeno,

I'm not sure exactly what you're looking for, but you should be able to use the solar functions, perhaps in conjunction with other packages, to answer your question. I see that as you mention, when you run Points Solar Radiation on a single day, you get back the time steps but not the actual time that it corresponds to -- one way to get back the corresponding actual hours would be to use a script such as this one calculating sunrise and sunset or use a package like PyEphem to get more precise calculations.

From there, you should be able to combine the solar observations from ArcGIS with 'actual time', so you can correspond the output T0 with the sunrise time and the final Tn with the sunset time. So my psuedo-code for this on a single day would be something like:

    import arcpy
    import ephem

    julian_day = 165
    
    # run solar calculation for all sites on this day; defaults used here
    arcpy.PointsSolarRadiation("elevation", "my_sites", 
        "output_global_radiation", "", 35, 200, 
        arcpy.sa.TimeWithinDay(julian_day, 0, 24))

    # figure out sunrise and sunset. if the points are close together, do this 
    # once for all sites, if they're geographically spread over a large area, you'll need
    # to make these calculations for each site.
    
    obs = ephem.Observer()
    obs.lat = ' 34' # obtained from my_sites
    obs.long = '-120.0' # obtained from my_sites
    obs.elev = 15 # extract from elevation raster at site location

    sunrise = obs.previous_rising(ephem.Sun()) # sunrise
    noon = obs.next_transit(ephem.Sun(), start=sunrise) # solar noon
    sunset = obs.next_setting(ephem.Sun()) # sunset
   
    # then, map those times to the T0...Tn time steps, which are by default in half-hour intervals.
    # output this result to a CSV or the like.


Does that help get you started? I think something like this is easier than trying to dig up the internals to figure out the corresponding times.

cheers,
Shaun
0 Kudos
XanderBakker
Esri Esteemed Contributor
Hi Shaun,

Thanx for this great post (+1 for that). A small correction; the 'PointsSolarRadiation' is part of the sa module. So in the code change the line:

arcpy.PointsSolarRadiation("elevation", "my_sites",


for this:

arcpy.sa.PointsSolarRadiation("elevation", "my_sites",


Kind regards,

Xander
0 Kudos
JimenoFonseca
New Contributor
Hi Shaun,

Thanx for this great post (+1 for that). A small correction; the 'PointsSolarRadiation' is part of the sa module. So in the code change the line:

arcpy.PointsSolarRadiation("elevation", "my_sites",


for this:

arcpy.sa.PointsSolarRadiation("elevation", "my_sites",


Kind regards,

Xander



Dear Shaun and Xander,

Thank you for your answers. It is a great starting. I am still struggling with computing every single day and then joining them. It requires a lot of time even while using parallel computing. For 300-400 points, with 8 cores the time is around 1.5 hours.

I use a similar algorithm as Shaun suggested, but still printing a single shape file for each day (result of the points solar radiation). Then reading it, and joining it to the others to have the 8760 values for each point takes a lot of computational time.

Would you guys have any idea of how improving this?

Thank you, Jimeno
0 Kudos
ShaunWalbridge
Esri Regular Contributor
Jimeno,

I'm not sure of the specifics for the points solar radiation tool, but testing it locally, it looks to take about one second per site per day on my machine, which gives me a ballpark estimation of 41 hours for 400 sites, using the defaults for the tool, against a 1m LIDAR dataset, stored as a mosaic. You mentioned that you're using 8 cores, do you have custom code to distribute the workload across those cores? If not, check out multiprocessing along with background processing to take advantage of those additional cores.


  • Use an in-memory workspace to store the results. If memory is available, also try copying your input raster into the in-memory workspace.

  • Use a file geodatabase instead of plain old shapefiles for the outputs.

  • Try adjusting the resolution of the input DEM to see its effects on performance. Also, think about clipping down the DEM as much as possible to just include a buffered area around the points themselves.

  • If the features don't fit into an in-memory workspace, serve them off of a fast disk -- SSD if at all possible.


Those are a few things off the top of my head.
0 Kudos