TimeMultipleDays (arcpy.sa)
摘要
定义特定年份内的多日时间段以进行太阳能量计算。指定年份、起始日和结束日。
讨论
此对象可用于以下工具:太阳辐射区域、太阳辐射点和太阳辐射图。
对于多日时间配置,最大天数范围为一年的总天数(365 天,闰年为 366 天)。如果起始日晚于结束日,时间计算将进行到下一年。例如,[起始日, 结束日] = [365, 31] 表示 12 月 31 日到下一年的 1 月 31 日。[1, 2] 表示第一天的时间,即从 0:00(1 月 1 日)到 0:00(1 月 2 日)。起始日和结束日不能相同。
指定年间隔的起始日、年份和结束日。如果结束日早于起始日,则认为结束日在下一年。这是默认时间配置。
语法
参数 | 说明 | 数据类型 |
year |
The Julian year. (默认值为 the current Julian year) | Long |
startDay |
The startDay is the first Julian day in the analysis. (默认值为 5, which is January 5th) | Long |
endDay |
The endDay is the last Julian day in the analysis. (默认值为 160, which is June 9th or 10th, depending if the year is a leap year) | Long |
属性
属性 | 说明 | 数据类型 |
year (读写) |
The Julian year. | Long |
startDay (读写) |
The startDay is the first Julian day in the analysis. | Long |
endDay (读写) |
The endDay is the last Julian day in the analysis. | Long |
代码实例
演示如何创建 TimeMultipleDays 类并在 Python 窗口中的 AreaSolarRadiation 工具中使用 TimeMultipleDays 类。
import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
myTimeMultiDay = TimeMultipleDays(1980, 216, 244)
outAreaSolar = AreaSolarRadiation("solar_dem", "", "", myTimeMultiDay)
outAreaSolar.save("C:/temp/solarouttmd")
通过 AreaSolarRadiation 工具使用 TimeMultipleDays 类计算入射太阳辐射。
# Name: TimeMultipleDays_Ex_02.py
# Description: Execute AreaSolarRadiation using the TimeMultipleDays object.
# Requirements: Spatial Analyst Extension
# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *
# Set environment settings
env.workspace = "C:/sapyexamples/data"
# Set local variables
inRaster = "solar_dem"
# Create TimeMultipleDays Object
year = 2004
startDay = 5
endDay = 6
myTimeMultiDay = TimeMultipleDays(year, startDay, endDay)
# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")
# Execute AreaSolarRadiation using TimeMultipleDays Object
outAreaSolar = AreaSolarRadiation(inRaster, "", 200, myTimeMultiDay, 14, 0.5,
"NOINTERVAL", 1, "FROM_DEM", 32, 8, 8,
"UNIFORM_SKY", 0.3, 0.5)
# Save the output
outAreaSolar.save("C:/sapyexamples/output/areasolartmd2")