サマリー
Converts an xarray.Dataset to a multidimensional raster.
説明
xarray is a Python module that supports multidimensional arrays with labels of dimensions, coordinates, and attributes. It builds on and integrates NumPy and pandas, and deals with multidimensional data in the Python SciPy ecosystem for numerical computing. For more information, refer to the xarray documentation.
After an xarray.DataArray is processed with Python, you may want to convert it to an ArcGIS multidimensional raster for it to be used in ArcGIS environments.
構文
XarrayToRaster (in_xarray)
パラメーター | 説明 | データ タイプ |
in_xarray | The input xarray.Dataset object to convert to a multidimensional raster. | xarray.Dataset |
データ タイプ | 説明 |
Raster | The output raster. |
コードのサンプル
Python window sample for the XarrayToRaster function.
import arcpy
import xarray
# Get input Raster multidimensional information
inRas = arcpy.Raster('C:/data/temperature_3hour.crf', True)
inRas.mdinfo
# Convert Raster to Xarray Dataset
xrr = arcpy.ia.RasterToXarray(inRas)
# Upsample the data from originally 3 hour to hourly time interval
newXrr = xrr.resample(StdTime='1H').nearest(tolerance="1H")
#Convert Xarray dataset back to raster
newRaster = arcpy.ia.XarrayToRaster(newXrr)
newRaster.save("C:/output/temperature_hourly.crf")