TimeWithinDay (arcpy.sa)

摘要

定义一天内的时间段以进行太阳能计算。指定儒略日、起始时间和结束时间。

讨论

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

起始时间结束时间相同时,将计算瞬时日照。当起始时间在日出前而结束时间在日出后时,将计算全天日照。

对于“日内”时间配置,最大时间范围为一天(24 小时)。计算不会跨天执行(例如,从 12:00 p.m. 到第二天的 12:00 p.m.)。起始时间必须早于结束时间

对于日内的时间配置,开始和结束时间显示为太阳时(单位:十进制小时)。将本地标准时转换成太阳时时,此程序会考虑均时差。

语法

TimeWithinDay ({day}, {startTime}, {endTime})
参数说明数据类型
day

The day is a Julian day value from 1 to 365.

(默认值为 183 of the Julian calendar)

Long
startTime

The startTime is the first hour to be used in the analysis. The hour is represented with a number from 0 to 24.

(默认值为 0)

Double
endTime

The endTime is the last hour to be used in the analysis. The hour is represented with a number from 0 to 24.

(默认值为 24)

Double

属性

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

The day is a Julian day value from 1 to 365.

Long
startTime
(读写)

The startTime is the first hour to be used in the analysis. The hour is represented with a number from 0 to 24.

Double
endTime
(读写)

The endTime is the last hour to be used in the analysis. The hour is represented with a number from 0 to 24.

Double

代码实例

TimeWithinDay 示例 1(Python 窗口)

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

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
myTimeWithinDay = TimeWithinDay(264, 11, 14)
outAreaSolar = AreaSolarRadiation("solar_dem", "", "", myTimeWithinDay)
outAreaSolar.save("C:/sapyexamples/output/areasolartwd")
TimeWithinDay 示例 2(独立脚本)

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

# Name: TimeWithinDay_Ex_02.py
# Description: Execute AreaSolarRadiation using the TimeWithinDay 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 TimeWithinDay Object
day = 100
startTime = 0 
endTime = 24
myTimeWithinDay = TimeWithinDay(day, startTime, endTime)

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

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

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

相关主题

5/10/2014