I am trying to calculate point solar radiation for several points every half an hour for a day. But the tricky part is I also want to change the radiation parameters (Diffuse Proportion and Transmissivity) every half an hour.
I am trying to do it with Model Builder but supplying different parameters every time is a problem. Can anybody help me with this?
So you are wanting to change the radiation parameters with each 1/2 hour iteration running the the tool multiple times?
You will be setting the time_configuration parameter using the TimeWithinDay({day},{startTime},{endTime}) option which will allow you to set the intervals accordingly. You could also set the each_interval = INTERVAL to create an output for every specified hour_interval. But as you note this would be only for one radiation setting you specified for that particular run.
To get what you need in model builder you'd be running the tool multiple times in succession being sure to set the parameters correctly . Possibly you could take advantage of creating variable lists or using model value iterators
However scripting would be the easiest way. See python sample #2 in the Point Solar Radiation help topic for how you would set the parameters and run that within a python for loop changing respective values each time. Also please note the usage tips regarding transmittivity and diffuse_proportion.
For example,
val = [0.1, 0.2, 0.3]
for x in val:
transmittivity = x
PointsSolarRadiation(inRaster, inPntFC, outFeatures, "", latitude, skySize,
timeConfig, dayInterval, hourInterval, "INTERVAL",
zFactor, "FROM_DEM", calcDirections, zenithDivisions,
azimuthDivisions,"STANDARD_OVERCAST_SKY", diffuseProp,
transmittivity, outDirectRad, outDiffuseRad, outDirectDur)
Good luck.
First of all, thanks for the reply.
I tried implementing example 2 from Point Solar Radiation by just changing the environment settings to my directory but something is not working.
# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *
# Set environment settings
arcpy.env.workspace = "D:/Solar potential/working_environment"
# Set local variables
inRaster = "D:/Solar potential/working_environment/Area of interest.tif"
inPntFC = "D:/Solar potential/working_environment/Building_centroid/centroid.shp"
outFeatures = "D:/Solar potential/working_environment/output/outglobal1.shp"
skySize = 200
timeConfig = TimeMultipleDays(2009, 91, 212)
dayInterval = 14
hourInterval = 0.5
zFactor = 0.3048
calcDirections = 32
zenithDivisions = 8
azimuthDivisions = 8
diffuseProp = 0.3
transmittivity = 0.5
outDirectRad = "D:/Solar potential/working_environment/output/outdirectrad1.shp"
outDiffuseRad = "D:/Solar potential/working_environment/output/outdiffuserad1.shp"
outDirectDur = "D:/Solar potential/working_environment/output/outduration1.shp"
# Execute PointsSolarRadiation...
PointsSolarRadiation(inRaster, inPntFC, outFeatures, "", latitude, skySize,
timeConfig, dayInterval, hourInterval, "INTERVAL",
zFactor, "FROM_DEM", calcDirections, zenithDivisions,
azimuthDivisions,"STANDARD_OVERCAST_SKY", diffuseProp,
transmittivity, outDirectRad, outDiffuseRad, outDirectDur)
The error message I get is
What might have gone wrong? For your information, I am running this inside ArcGIS Pro
Update: When I run the core Point Solar Radiation tool with the same data, I get some results without any error. But when I copy the Python code for the same tool and run it, I get the same error as above.
Finally, I got succeeded in using variable parameters for calculating point solar radiation for all the points with the following code.
timeConfig = TimeWithinDay(190, 6, 8)
transmittivity = ['0.1', '0.4', '0.5','0.47']
diffuseprop = ['0.7', '0.3', '0.2','0.28']
y = list(map(list, zip(transmittivity ,diffuseprop)))
directory = "D:\Solar potential\output\out.gdb"
for i in range(len(y)):
for j in range(len(y[i])):
PointsSolarRadiation("aoi_reprojected.tif",
"centroid", directory + y[i][0] + y[i][1] ,
0, 47.8209442145, 200,
timeConfig, 14, hourInterval,
"INTERVAL", 1, "FROM_DEM", 32, 8, 8, "UNIFORM_SKY",
y[i][1], y[i][0], None, None, None)
But the problem is that for each diffuse proportion and transmissivity, the point solar radiation(T0, T1, T2, T3) value for all time intervals (6 - 6:30, 6:30- 7:00, 7:00-7:30,7:30-8:00 in this case) is being calculated. But, I am looking to get only T0 for 1st pair of diffuse proportion and transmissivity, T1 for 2nd pair of diffuse proportion and transmissivity, and so on and so forth. In this case, I can delete the columns manually. But if there is a large time duration (for example 6:00-18:00), it will get difficult.
Do you have any idea about how to deal with this problem?
You can use the parameter each_interval key to handle whether to calculate a single total insolation value for all locations or multiple values for the specified hour and day interval.
Are you creating a new output with unique name for each iteration?
Make sure your environment workspace and output directories have write capabilities.
You should be able to verify running the tool (or any tool) in the desktop client setting the output and environment workspace/scratchWorkspace respectively.
Hey there
actually I wanna run "area solar radiation" but I couldn't find Diffuse Proportion and Transmissivity in my region of interest.
can I ask you, how you find Diffuse Proportion and Transmissivity?
thank you
Hi there, not sure if you saw the usage tips from the help:
Finding or identifying best values for your area of interest depends on a number of variables (location and time). You can decide which values best suit your model or you can either change these values to compare how they affect your result. For example, if you are running analysis in downtown Los Angeles in the middle of summer you may want to consider additional atmospheric effects.
hope this helps