Feature to NetCDF (Multidimension)

Summary

Converts a point feature class to a netCDF file.

Usage

Syntax

FeatureToNetCDF_md (in_features, fields_to_variables, out_netCDF_file, {fields_to_dimensions})
ParameterExplanationData Type
in_features

The input feature class.

Feature Layer
fields_to_variables
[[field, {variable}, {units}],...]

The field or fields used to create variables in the netCDF file.

Four special fields—Shape.X, Shape.Y, Shape.Z, and Shape.M—can be used for exporting x-coordinates or longitude, y-coordinates or latitude, Z values, and M values of input features, respectively.

  • field—A field in the input feature attribute table.
  • {variable}—The netCDF variable name.
  • {units}—The units of the data represented by the field.
Value Table
out_netCDF_file

The output netCDF file. The filename must have a .nc extension.

File
fields_to_dimensions
[[field, {dimension}, {units}],...]
(Optional)

The field or fields used to create dimensions in the netCDF file.

  • field—A field in the input feature attribute table.
  • {dimension}—The netCDF dimension name.
  • {units}—The units of the data represented by the field.
Value Table

Code Sample

FeatureToNetCDF example 1 (Python window)

Converts a feature class to a netCDF file.

import arcpy
arcpy.FeatureToNetCDF_md("c:/data/spotelev.shp", [["Shape.X", "lon"],
                         "degree_east", ["Shape.Y", "lat", "degree_north"],
                         ["elevation", "elevation", "meter"]],
                         "c:/output/pointelev01.nc", "id")
FeatureToNetCDF example 2 (stand-alone script)

Converts a feature class to a netCDF file.

# FeatureToNetCDF_Ex_02.py
# Description: Converts a feature class to a netCDF file.
# Requirements: None

# Import system modules
import arcpy
from arcpy import env

# Set environment settings
env.workspace = "C:/data/netcdfgisdata"

# Set local variables
inFeatures = "spotelev.shp"
fieldToVariable = [["Shape.Y", "lat", "degree_north"],
                   ["elevation", "elevation", "meter"]]
outNetCDFFile = "c:/output/pointelev02.nc"
fieldToDimension = "id"

# Execute FeatureToNetCDF
arcpy.FeatureToNetCDF_md(inFeatures, fieldToVariable, outNetCDFFile, 
                         fieldToDimension)

Environments

Related Topics

Licensing Information

ArcView: Yes
ArcEditor: Yes
ArcInfo: Yes

6/6/2013