Table to NetCDF (Multidimension)

Summary

Converts a table to a netCDF file.

Usage

  • The default variable name is the same as the field name specified in the Fields to Variables parameter.

  • The type of variable is the same as the type of field.

  • The default dimension name is the same as the field name specified in the Fields to Dimensions parameter.

  • The size of a dimension is equal to the number of unique values in the respective field.

  • If no field is specified as dimension, then a dimension named RecordID is created in the output netCDF file.

  • String fields cannot be used to create dimensions in the netCDF file.

Syntax

TableToNetCDF(in_table, fields_to_variables, out_netCDF_file, {fields_to_dimensions})
ParameterExplanationData Type
in_table

The input table.

Table View
fields_to_variables
[[field, {variable}, {units}],...]

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

  • 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 file name must have an .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 table.
  • {dimension}—The netCDF dimension name
  • {units}—The units of the data represented by the field
Value Table

Code sample

TableToNetCDF example 1 (Python window)

Converts a table to a netCDF file.

import arcpy
arcpy.TableToNetCDF_md("c:/data/netcdfgisdata/rainfall.dbf",
                       "longitude longitude degree_east;latitude latitude degree_north",
                       "c:/output/rain.nc","station station")
TableToNetCDF example 2 (stand-alone script)

Converts a table to a netCDF file.

# Name: TableToNetCDF_Ex_02.py
# Description: 
# Requirements: none

# Import system modules
import arcpy

# Set local variables
inTable = "c:/data/netcdfgisdata/rainfall.dbf"
fieldVariableUnits = "longitude longitude degree_east;latitude latitude degree_north"
outNetCDFFile = "c:/output/rain.nc"
fieldDimensionUnits = "station station"

# Execute SelectByDimension
import arcpy
arcpy.TableToNetCDF_md(inTable, fieldVariableUnits, outNetCDFFile, fieldDimensionUnits)

Licensing information

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

Related topics