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 may not be used to create dimensions in the netCDF file.
Syntax
TableToNetCDF_md (in_table, fields_to_variables, out_netCDF_file, {fields_to_dimensions})
Parameter | Explanation | Data 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.
| 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.
| 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)
Environments
Licensing information
- ArcGIS Desktop Basic: Yes
- ArcGIS Desktop Standard: Yes
- ArcGIS Desktop Advanced: Yes