NetCDF Profiles To Feature Class (Discrete Sampling Geometry) (Multidimension)

Summary

Creates a feature class from profiles in netCDF files. In the Climate and Forecast (CF) metadata convention, a profile is a type of discrete sampling geometry (DSG).

Learn more about how the Discrete Sampling Geometry (DSG) tools work

Usage

  • In the Climate and Forecast (CF) metadata convention, a profile is an ordered set of data points along a vertical line at a fixed horizontal position and fixed time.

  • Discrete sampling geometry (DSG) datasets are characterized by a lower dimensionality than the space-time region where the data is sampled.

  • The input netCDF files should be Climate and Forecast (CF) compliant (CF 1.6 or later). The CF conventions define metadata to describe the data represented by each variable and the spatial and temporal properties of the data.

  • If the input netCDF files are not CF compliant, you can specify an Input Climate and Forecast Metadata (in_cf_metadata in Python) file with additional or altered attributes. The Input Climate and Forecast Metadata file is an XML format file with an .ncml extension. The attributes from this metadata file will extend or override the metadata in the netCDF file. The Input Climate and Forecast Metadata file can also be used to specify a grid mapping variable if the input netCDF file does not have one.

  • A DSG feature type is identified by an instance ID variable marked with a cf_role attribute. Multiple netCDF files with the same schema can be converted to a single feature class with a unique InstanceID field. Each netCDF file should have a variable marked with the same cf_role attribute, which will be used as the identifying field across multiple files. Aggregation will occur strictly along the instance dimension of this variable.

  • For both instance and observation variables, matching occurs by variable name. That is, if two variables in different netCDF files have the same name, they will be interpreted as representing the same thing.

  • Multiple instance and observation variables (cruise number, temperature, salinity, and so on) can be selected in the Instance Variables (instance_variables in Python) and Observation Variables (observation_variables in Python) parameters, respectively.

  • You can use the Analysis Extent (analysis_extent in Python) parameter to specify the output analysis area explicitly for a stand-alone tool operation or to override the environment setting as part of a workflow. You can specify the extent by typing values, choosing the display extent, selecting a layer, or browsing for an input dataset.

  • The default Analysis Extent value is calculated from the union extent of the input netCDF files.

  • If the extent is not explicitly specified as the parameter value, it will be derived from the analysis environment settings.

  • When the Instance and Observation option is specified for the Output Schema parameter (out_schema = "INSTANCE_AND_OBSERVATION" in Python), a 2D point feature class containing all the location information along with the selected instance fields, and a related table containing the selected observation variables, will be created. An optional layer can also be created, which will join the table to the feature class based on the InstanceID field. When the Route and Event option is specified (out_schema = "ROUTE_AND_EVENT" in Python), two outputs will be created. One is a vertical polyline feature class with a 3D vertex and a measure value for each vertical level. The other output is a table with observation values and from_z and to_z fields. You can use this table to create linear dynamic segmentation event classes along the profiles. A join layer will not be created for this schema. When the Point 3D option is specified (out_schema = "POINT_3D" in Python), only a 3D points feature will be created that contains all records (all locations with all vertical levels).

  • A data variable in the netCDF file can use a grid_mapping variable to explicitly define the coordinate reference system (CRS) used for the spatial coordinate values. The grid mapping epsg_code attribute can be used to select a GCS or PCS. Also, the grid mapping esri_pe_string, crs_wkt, and spatial_ref attributes can all be used to define either a WKT 1 or WKT 2 string. If any of these attributes are present, no other attributes for the horizontal coordinate system are used. For more information about coordinate reference systems as well as the supported WKIDs, see the Coordinate systems, projections, and transformations topic.

  • If the spatial coordinate values are 3D, the grid_mapping variable should also specify a vertical coordinate system (VCS). A VCS is a combination of a vertical datum, a linear unit of measure, and the direction (up or down) that vertical coordinates increase. The datum is typically obtained from an attribute of the grid mapping variable and the other properties are obtained from the vertical coordinate variable. An arbitrary vertical datum can be specified using a compound WKT string as the value of one of the WKT attributes listed above. A gravity-based datum can be specified using either the geoid_name or geopotential_datum_name attribute. In addition, a tidal datum can be implicitly specified using one of the tidal standard names for the vertical coordinate variable. If no VCS is specified and a vertical coordinate variable is present, Instantaneous Water Level Depth or Height (epsg:5831, epsg:5829) will be selected as the default.

Parameters

LabelExplanationData Type
Input NetCDF Files or Folders

The input netCDF files that will be used to create a feature class. Individual netCDF files, as well as folders that contain multiple netCDF files, can be used.

The input netCDF files must have the same DSG feature type and schema.

Folder; File
Target Workspace

The enterprise or file geodatabase in which the output feature class and table will be created. This must be an existing workspace.

Workspace
Output Point or Polyline Name

The name of the feature class that will contain the locations from the netCDF variables. These variables will be added as fields from the Instance Variables parameter.

String
Observation Variables
(Optional)

The netCDF variables that contain all the observation values at each location and each vertical level. These will be added as fields to the output table

String
Output Join or Event Table Name
(Optional)

The name of the output table that will contain all the records from the observation variables.

String
Instance Variables
(Optional)

The netCDF variables that differentiate individual features and represent the locations where observations are made. These variables will be added as fields to the output feature class.

String
Output Schema
(Optional)

Specifies the output feature class type that will be created.

  • Instance and ObservationA feature class containing 2D points that contain the location of each instance and a related table containing all the observation variables will be created. This is the default..
  • Route and EventA vertical polyline feature class with 3D vertexes and a linear event table for the observation variables will be created.
  • Point 3DA 3D feature class with all instances at all vertical levels will be created.
String
Include Subdirectories
(Optional)

Specifies whether the files residing in the subdirectories of an input folder will be used.

  • Checked—All netCDF files in all subdirectories will be used.
  • Unchecked—Only files in the input folder will be used. This is the default.
Boolean
Input Climate and Forecast Metadata
(Optional)

The XML format file with an .ncml extension that will supply missing or altered CF information for the input netCDF files.

File
Analysis Extent
(Optional)

The extent that defines the area of the output feature class.

Extent
Output Join Layer
(Optional)

The output layer that will be created by joining the output table to the output feature class. This is an optional output and is only available when the Instance and Observation option is specified for the Output Schema parameter.

Feature Layer

Derived Output

LabelExplanationData Type
Output Point or Polyline

The output point or polyline feature class.

Feature Class
Output Join or Event Table

The output table.

Table

arcpy.md.NetCDFProfilesToFeatureClass(in_files_or_folders, target_workspace, out_point_or_polyline_name, {observation_variables}, {out_table_name}, {instance_variables}, {out_schema}, {include_subdirectories}, {in_cf_metadata}, {analysis_extent}, {out_join_layer})
NameExplanationData Type
in_files_or_folders
[in_files_or_folders,...]

The input netCDF files that will be used to create a feature class. Individual netCDF files, as well as folders that contain multiple netCDF files, can be used.

The input netCDF files must have the same DSG feature type and schema.

Folder; File
target_workspace

The enterprise or file geodatabase in which the output feature class and table will be created. This must be an existing workspace.

Workspace
out_point_or_polyline_name

The name of the feature class that will contain the locations from the netCDF variables. These variables will be added as fields from the instance_variables parameter.

String
observation_variables
[observation_variables,...]
(Optional)

The netCDF variables that contain all the observation values at each location and each vertical level. These will be added as fields to the output table

String
out_table_name
(Optional)

The name of the output table that will contain all the records from the observation variables.

String
instance_variables
[instance_variables,...]
(Optional)

The netCDF variables that differentiate individual features and represent the locations where observations are made. These variables will be added as fields to the output feature class.

String
out_schema
(Optional)

Specifies the output feature class type that will be created.

  • INSTANCE_AND_OBSERVATIONA feature class containing 2D points that contain the location of each instance and a related table containing all the observation variables will be created. This is the default..
  • ROUTE_AND_EVENTA vertical polyline feature class with 3D vertexes and a linear event table for the observation variables will be created.
  • POINT_3DA 3D feature class with all instances at all vertical levels will be created.
String
include_subdirectories
(Optional)

Specifies whether the files residing in the subdirectories of an input folder will be used.

  • INCLUDE_SUBDIRECTORIESAll netCDF files in all subdirectories will be used.
  • DO_NOT_INCLUDE_SUBDIRECTORIESOnly files in the input folder will be used. This is the default.
Boolean
in_cf_metadata
(Optional)

The XML format file with an .ncml extension that will supply missing or altered CF information for the input netCDF files.

File
analysis_extent
(Optional)

The Extent class determines the extent for the output raster dataset.

The form of the Extent class is as follows:

  • Extent (XMin, YMin, XMax, YMax)

    where:

    • XMin—The extent XMin value
    • YMin—The extent YMin value
    • XMax—The extent XMax value
    • YMax—The extent YMax value

Extent
out_join_layer
(Optional)

The output layer that will be created by joining the output table to the output feature class. This is an optional output and is only available when the INSTANCE_AND_OBSERVATION option is specified for the out_schema parameter.

Feature Layer

Derived Output

NameExplanationData Type
out_point_or_polyline

The output point or polyline feature class.

Feature Class
out_table

The output table.

Table

Code sample

NetCDFProfilesToFeatureClass example 1 (Python window)

This example creates a feature class and a table from a netCDF DSG profile file from World Ocean Dataset.

import arcpy
arcpy.md.NetCDFProfilesToFeatureClass(r"C:\WOD\wod_ctd_2019.nc", r"C:\ArcGIS\Projects\output.gdb", 
									  "WOD_2019", "Salinity", None, "WOD_2019_table", 
									  "INSTANCE_AND_OBSERVATION", "INCLUDE_SUBDIRECTORIES",
									  None, "DEFAULT", "WOD_2019_layer")
NetCDFProfilesToFeatureClass example 2 (stand-alone script)

This example creates a 3D feature class from a netCDF DSG profile file from Argo.

# Name: NetCDFProfilesToFeatureClass_Ex_02.py
# Description: Creates a 3D point feature class from a set of float data.

# Import system modules
Import arcpy  

# Set the local variables 
in_files_or_folders = r"C:\Argo" 
target_workspace = r"C:\outputs\argo.gdb" 
out_point_or_polyline_name = "argo_3d" 
observation_variables = "temperature;pressure" 
out_table_name = "" 
instance_variables = "" 
out_schema = "POINT_3D" 
include_subdirectories = "DO_NOT_INCLUDE_SUBDIRECTORIES" 
in_cf_metadata = "" 
analysis_extent = "" 
out_join_layer = "" 

# Execute NetCDFProfilesToFeatureClass
arcpy.md.NetCDFProfilesToFeatureClass(in_files_or_folders, target_workspace,
                                      out_point_or_polyline_name, observation_variables,
                                      out_table_name, instance_variables, out_schema,
                                      include_subdirectories, in_cf_metadata,
                                      analysis_extent, out_join_layer)

Licensing information

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

Related topics