Make NetCDF Raster Layer (Multidimension)

License Level:BasicStandardAdvanced

Summary

Makes a raster layer from a netCDF file.

Usage

Syntax

MakeNetCDFRasterLayer_md (in_netCDF_file, variable, x_dimension, y_dimension, out_raster_layer, {band_dimension}, {dimension_values}, {value_selection_method})
ParameterExplanationData Type
in_netCDF_file

The input netCDF file.

File
variable

The variable of the netCDF file used to assign cell values to the output raster. This is the variable that will be displayed, such as temperature or rainfall.

String
x_dimension

A netCDF dimension used to define the x, or longitude, coordinates of the output layer.

String
y_dimension

A netCDF dimension used to define the y, or latitude, coordinates of the output layer.

String
out_raster_layer

The name of the output raster layer.

Raster Layer
band_dimension
(Optional)

A netCDF dimension used to create bands in the output raster. Set this dimension if a multiband raster layer is required. For instance, altitude might be set as the band dimension to create a multiband raster where each band represents temperature at that altitude.

String
dimension_values
[[dimension, {value}],...]
(Optional)

The value (such as 01/30/05) of the dimension (such as Time) or dimensions to use when displaying the variable in the output layer. By default, the first value of the dimension or dimensions will be used. This default value can also be altered on the netCDF tab of the Layer Properties dialog box.

Value Table
value_selection_method
(Optional)

Specifies the dimension value selection method.

  • BY_VALUE The input value is matched with the actual dimension value.
  • BY_INDEX The input value is matched with the position or index of a dimension value. The index is 0 based, that is, the position starts at 0.
String

Code Sample

MakeNetCDFRasterLayer example 1 (Python window)

Creates a raster layer from a netCDF file.

import arcpy
arcpy.MakeNetCDFRasterLayer_md("C:/data/netcdf/rainfall.nc","pptx",
                         "lon","lat","rainfall")
MakeNetCDFRasterLayer example 2 (stand-alone script)

Creates a raster layer from a netCDF file.

# Name: MakeNetCDFRasterLayer_Ex_02.py
# Description: Create a raster layer from a netCDF file.
# Requirements: None

# Import system modules
import arcpy


# Set local variables
inNetCDFFile = "C:/data/netcdf/rainfall.nc"
variable = "pptx"
XDimension = "lon"
YDimension = "lat"
outRasterLayer = "c:/output/rainfall"
bandDimmension = ""
dimensionValues = ""
valueSelectionMethod = ""

# Execute MakeNetCDFRasterLayer
arcpy.MakeNetCDFRasterLayer_md(inNetCDFFile, variable, XDimension, YDimension,
                               outRasterLayer, bandDimmension, dimensionValues, 
                               valueSelectionMethod)

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Yes
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
4/15/2014