TimeMultipleDays

Récapitulatif

Defines a multiple day time period within a given year to perform solar calculations. A year, start day, and end day are specified.

Discussion

This object can be used in the following tools: Area Solar Radiation, Points Solar Radiation, and Solar Radiation Graphics.

For multi-day time configurations, the maximum range of days is a total of one year (365 days, or 366 days for leap years). If the startDay is greater than the endDay, the time calculations will proceed into the following year. For example, [startDay, endDay] = [365, 31], represents December 31 to January 31 of the following year. In the example of [1, 2], the time is inclusive for the first day from 0:00 hours (January 1) to 0:00 (January 2). The startDay and endDay cannot be equal.

Specify the startDay, year, and endDay for a year interval. When the endDay is smaller than the startDay, the endDay is considered to be in the following year. This is the default time configuration.

Syntaxe

TimeMultipleDays ({year}, {startDay}, {endDay})
ParamètreExplicationType de données
year

The Julian year.

(La valeur par défaut est the current Julian year)

Long
startDay

The startDay is the first Julian day in the analysis.

(La valeur par défaut est 5, which is January 5th)

Long
endDay

The endDay is the last Julian day in the analysis.

(La valeur par défaut est 160, which is June 9th or 10th, depending if the year is a leap year)

Long

Propriétés

PropriétéExplicationType de données
year
(Lecture et écriture)

The Julian year.

Long
startDay
(Lecture et écriture)

The startDay is the first Julian day in the analysis.

Long
endDay
(Lecture et écriture)

The endDay is the last Julian day in the analysis.

Long

Exemple de code

TimeMultipleDays example 1 (Python window)

Demonstrates how to create a TimeMultipleDays class and use it in the AreaSolarRadiation tool within the Python window.

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")
TimeMultipleDays example 2 (stand-alone script)

Calculates the incoming solar radiation with the AreaSolarRadiation tool using the TimeMultipleDays class.

# 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")

Rubriques connexes


7/10/2012