ArcGIS Desktop

  • Documentation
  • Support

  • My Profile
  • Aide
  • Sign Out
ArcGIS Desktop

ArcGIS Online

La plateforme cartographique de votre organisation

ArcGIS Desktop

Un SIG professionnel complet

ArcGIS Enterprise

SIG dans votre entreprise

ArcGIS for Developers

Outils de création d'applications de localisation

ArcGIS Solutions

Modèles d'applications et de cartes gratuits pour votre secteur d'activité

ArcGIS Marketplace

Téléchargez des applications et des données pour votre organisation.

  • Documentation
  • Support
Esri
  • Se connecter
user
  • Mon profil
  • Déconnexion

ArcMap

  • Accueil
  • Commencer
  • Carte
  • Analyser
  • Gérer les données
  • Outils
  • Extensions

NetCDFFileProperties

  • Résumé
  • Syntaxe
  • Vue d'ensemble des méthodes
  • Méthodes
  • Exemple de code

Résumé

The Network Common Data Form (netCDF) is a binary, self-describing, machine-independent file format for storing scientific data.

Learn more about netCDF

Syntaxe

 NetCDFFileProperties  (netcdffile)
ParamètreExplicationType de données
netcdffile

The input netCDF file.

String

Vue d'ensemble des méthodes

MéthodeExplication
getAttributeNames ({variable_name})

Gets the attribute names of a variable in a NetCDF file.

getAttributeValue (variable_name, attribute_name)

Get the value of an attribute.

getDimensionIndex (dimension_name, value)

Gets the dimension index.

getDimensionSize (dimension_name)

Gets the dimension size.

getDimensionValue (dimension_name, index)

Gets the dimension value.

getDimensions ()

Gets the dimensions.

getDimensionsByVariable (variable_name)

Gets the dimensions by variable.

getFieldType (name)

Gets the field type of a variable or dimension.

getSpatialReference (variable_name, x_dimension, y_dimension)

Gets the spatial reference of a variable.

getVariables ()

Gets the variables.

getVariablesByDimension (dimension_name)

Get the variables by dimension.

Méthodes

getAttributeNames ({variable_name})
ParamètreExplicationType de données
variable_name
[variable_name,...]

Variable name of the NetCDF file.

String

Valeur renvoyée

Type de donnéesExplication
String

The attribute names of the variable.

getAttributeValue (variable_name, attribute_name)
ParamètreExplicationType de données
variable_name

Variable name of the netCDF file.

String
attribute_name

Attribute name of the netCDF file.

String

Valeur renvoyée

Type de donnéesExplication
Object

The value of the attribute. The type of returned value depends on the dimension type.

getDimensionIndex (dimension_name, value)
ParamètreExplicationType de données
dimension_name

Dimension name of the NetCDF file.

String
value

The dimension value.

Integer

Valeur renvoyée

Type de donnéesExplication
Integer

The dimension index.

getDimensionSize (dimension_name)
ParamètreExplicationType de données
dimension_name

Dimension name of the NetCDF file.

String

Valeur renvoyée

Type de donnéesExplication
Integer

The dimension size.

getDimensionValue (dimension_name, index)
ParamètreExplicationType de données
dimension_name

Dimension name of the NetCDF file.

String
index

The index position.

Integer

Valeur renvoyée

Type de donnéesExplication
Object

The dimension value. The type of returned value depends on the dimension type.

getDimensions ()

Valeur renvoyée

Type de donnéesExplication
String

List of dimensions.

getDimensionsByVariable (variable_name)
ParamètreExplicationType de données
variable_name

Variable name of the NetCDF file.

String

Valeur renvoyée

Type de donnéesExplication
String

The dimensions by variable.

getFieldType (name)
ParamètreExplicationType de données
name

Variable or dimension name of the NetCDF file.

String

Valeur renvoyée

Type de donnéesExplication
String

The field type.

getSpatialReference (variable_name, x_dimension, y_dimension)
ParamètreExplicationType de données
variable_name

Variable name of the NetCDF file.

String
x_dimension

The x-dimension.

Integer
y_dimension

The y-dimension.

Integer

Valeur renvoyée

Type de donnéesExplication
SpatialReference

The spatial reference of a variable.

getVariables ()

Valeur renvoyée

Type de donnéesExplication
String

List of variables.

getVariablesByDimension (dimension_name)
ParamètreExplicationType de données
dimension_name

Variable name of the netCDF file

String

Valeur renvoyée

Type de donnéesExplication
String

List of variables by dimension

Exemple de code

NetCDFFileProperties example

Display properties of NetCDF file.

import arcpy

in_netcdf = "c:/NetCDF/crwr.nc"
try:
    nc_fp = arcpy.NetCDFFileProperties(in_netcdf)

    # Get Variables
    for nc_var in nc_fp.getVariables():
        print("Variable: {0}".format(nc_var))
        print("\tVariable type: {0}".format(nc_fp.getFieldType(nc_var)))

        # Get dimensions by variable
        for nc_dim_by_var in nc_fp.getDimensionsByVariable(nc_var):
            print("Dimension: {0}".format(nc_dim_by_var))
        print(nc_fp.getAttributeValue(nc_var, "units"))

        # Get Variable Attribues
        for nc_va_name in nc_fp.getAttributeNames(nc_var):
            print("Attribute Name: {0}".format(nc_va_name))

    # Get Dimensions
    for nc_dim in nc_fp.getDimensions():
        print("Dimension: {0}".format(nc_dim))
        print("\tDimension size: {0}".format(nc_fp.getDimensionSize(nc_dim)))
        print("\tDimension type: {0}".format(nc_fp.getFieldType(nc_dim)))

        for i in range(0, nc_fp.getDimensionSize(nc_dim)):
            nc_dim_value = nc_fp.getDimensionValue(nc_dim, i)
            print("\tDimension value: {0}".format(nc_dim_value))
            print("\tDimension index: {0}".format(
                nc_fp.getDimensionIndex(nc_dim, nc_dim_value)))

        # Get Variable by dimension
        for nc_vars_by_dim in nc_fp.getVariablesByDimension(nc_dim):
            print("\tVariable by dimension: {0}".format(nc_vars_by_dim))

    # Get Global Attribues
    for nc_att_name in nc_fp.getAttributeNames(""):
        print("Attribute Name: {0}".format(nc_att_name))
        print(nc_fp.getAttributeValue("", nc_att_name))

except Exception as err:
    print(err)

Rubriques connexes

  • Utilisation de classes dans Python
  • Utilisation de la classe de références spatiales

ArcGIS Desktop

  • Accueil
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

A propos d'Esri

  • A propos de la société
  • Carrières
  • Blog des initiés
  • Conférence des utilisateurs
  • Sommet des développeurs
Esri
Donnez-nous votre avis.
Copyright © 2018 Esri. | Confidentialité | Légal