Skip To Content

Make NetCDF Raster Layer


Makes a raster layer from an netCDF file.


  • To create a netCDF raster layer from a netCDF variable, the spacing between x-coordinates must be equal and the spacing between y-coordinates must be equal. If the coordinates are unequally spaced, create a netCDF feature layer, then interpolate to raster.

  • The output raster layer type is either float or integer based on the netCDF variable type.

  • The first variable in the netCDF file suitable for creating a raster is selected as the default variable.

  • Auxiliary coordinate variables are listed in the X Dimension and Y Dimension drop-down lists and used during execution if specified. They are not listed in the Dimension Values parameter drop-down list and cannot be set as the value of this parameter in a script.

  • Specify a Band Dimension to create a multiband raster.

  • The first value of a nonspatial dimension is used to create a default view of a multidimensional variable.

  • To save the output layer, right-click the layer in the ArcGIS Pro Contents pane and click Save As Layer File, or use the Save To Layer File tool.

  • The calendar attribute values noleap and 365_day, assigned to the time coordinate variable of the netCDF file, are not honored in ArcGIS.


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

The input netCDF file.


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.


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


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


The name of the output raster layer.

Raster Layer

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.

[[dimension, {value}],...]

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.

  • dimension—A netCDF dimension.
  • {value}—The value of the dimension to use.
Value Table

Specifies the dimension value selection method.

  • BY_VALUEThe input value is matched with the actual dimension value.
  • BY_INDEXThe 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.

Code sample

MakeNetCDFRasterLayer example 1 (Python window)

Creates a raster layer from a netCDF file.

import arcpy
MakeNetCDFRasterLayer example 2 (stand-alone script)

Creates a raster layer from a netCDF file.

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

# Import system modules
import arcpy

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

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


Licensing information

  • ArcGIS Desktop Basic: Yes
  • ArcGIS Desktop Standard: Yes
  • ArcGIS Desktop Advanced: Yes

Related topics