Make NetCDF Raster Layer (Multidimension)

Summary

Makes a raster layer from a netCDF file.

The Make Multidimensional Raster Layer tool provides enhanced functionality or performance.

Usage

  • The output of this tool is not supported as input in many multidimensional exploratory, data management, and analytical tools. Use the output from the Make Multidimensional Raster Layer tool instead.

  • This tool supports netCDF file with nc and nc4 extensions. The group variables and dimensions within a group in a nc4 file are not supported. Only the variables and dimensions outside of the group are supported.

  • 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 parameter 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 value for the Band Dimension parameter 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.

  • Use the Cell registration parameter (cell_registration in Python) to determine how the extent of the netCDF raster layer is computed from the X Dimension and Y Dimension values. The cell size, number of rows, number of columns, and the width and height of the output raster remain the same, regardless of the option used.

Parameters

LabelExplanationData Type
Input 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
Output 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
(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.

  • Dimension—A netCDF dimension.
  • Value—The dimension value to use.
Value Table
Value Selection Method
(Optional)

Specifies the dimension value selection method that will be used.

  • 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
Cell Registration
(Optional)

Specifies the location of the cell registration.

  • Center —Cell registration at the center of the cell. This is the default.
  • Lower Left —Cell registration at the lower left of the cell.
  • Upper Left —Cell registration at the upper left of the cell.
String

arcpy.md.MakeNetCDFRasterLayer(in_netCDF_file, variable, x_dimension, y_dimension, out_raster_layer, {band_dimension}, {dimension_values}, {value_selection_method}, {cell_registration})
NameExplanationData 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.

  • dimension—A netCDF dimension.
  • {value}—The dimension value to use.
Value Table
value_selection_method
(Optional)

Specifies the dimension value selection method that will be used.

  • 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.
String
cell_registration
(Optional)

Specifies the location of the cell registration.

  • CENTERCell registration at the center of the cell. This is the default.
  • LOWER_LEFTCell registration at the lower left of the cell.
  • UPPER_LEFTCell registration at the upper left of the cell.
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 = "rainfall"
bandDimmension = ""
dimensionValues = ""
valueSelectionMethod = ""
cellRegistration = ""

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

Environments

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics