TimeSpecialDays (arcpy.sa)

摘要

将夏至/春秋分/冬至日定义为时间段以进行太阳能量计算。

讨论

此对象可用于以下工具:太阳辐射区域太阳辐射点太阳辐射图

TimeSpecialDays 类没有参数。

语法

TimeSpecialDays ()

代码实例

TimeSpecialDays 示例 1(Python 窗口)

演示如何创建 TimeSpecialDays 类并在 Python 窗口中的 AreaSolarRadiation 工具中使用 TimeSpecialDays 类。

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outAreaSolar = AreaSolarRadiation("solar_dem", "", 200, TimeSpecialDays())
outAreaSolar.save("C:/sapyexamples/output/areasolartsd")
TimeSpecialDays 示例 2(独立脚本)

通过 AreaSolarRadiation 工具使用 TimeSpecialDays 类计算入射太阳辐射。

# Name: TimeSpecialDays_Ex_02.py
# Description: Execute AreaSolarRadiation using the TimeSpecialDays 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 TimeSpecialDays Object
myTimeSpecialDay = TimeSpecialDays()

# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")

# Execute AreaSolarRadiation
outAreaSolar = AreaSolarRadiation(inRaster, "", 200, myTimeSpecialDay, 14,
                                  0.5, "NOINTERVAL", 1, "FROM_DEM", 32, 8, 8,
                                  "UNIFORM_SKY", 0.3, 0.5)


# Save the output 
outAreaSolar.save("C:/sapyexamples/output/areasolartsd2")

相关主题

9/15/2013