TimeWholeYear (arcpy.sa)

摘要

使用每月间隔定义年份以进行太阳能计算。

讨论

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

如果在工具参数中设置了 {each_interval} 选项,则将为每个月份创建输出文件;否则,将为整年创建一个输出。

语法

TimeWholeYear ({year})
参数说明数据类型
year

The Julian year.

(默认值为 the current Julian year)

Long

属性

属性说明数据类型
year
(读写)

The Julian year.

Long

代码实例

TimeWholeYear 示例 1(Python 窗口)

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

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

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

# Name: TimeWholeYear_Ex_02.py
# Description: Execute AreaSolarRadiation using the TimeWholeYear 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 a TimeWholeYear Object
year = 2004
myTimeWholeYear = TimeWholeYear(year)

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

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

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

相关主题

5/10/2014