TimeWholeYear (arcpy.sa)

Resumen

Defines a year, using monthly intervals, to perform solar caclulations.

Debate

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

If the {each_interval} option is set in the tool parameter, then output files will be created for each month; otherwise, a single output will be created for the whole year.

Sintaxis

TimeWholeYear ({year})
ParámetroExplicaciónTipo de datos
year

The Julian year.

(El valor predeterminado es the current Julian year)

Long

Propiedades

PropiedadExplicaciónTipo de datos
year
(Lectura y escritura)

The Julian year.

Long

Ejemplo de código

TimeWholeYear example 1 (Python window)

Demonstrates how to create a TimeWholeYear 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"
outAreaSolar = AreaSolarRadiation("solar_dem", "", "", TimeWholeYear(2008))
outAreaSolar.save("C:/sapyexamples/output/areasolartwy")
TimeWholeYear example 2 (stand-alone script)

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

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

Temas relacionados

9/12/2013