def get_dependent_variables(self, dataset, var_name):
        # According to CF 1.6 for discrete sampling geometries, "The coordinates
        #   attribute must be attached to every data variable to indicate the
        #   spatiotemporal coordinate variables that are needed to geo-locate
        #   the data."  Additionally, x and y instance variables are mandatory
        #   for all feature types and so will always be indexed by the instance
        #   dimension.
        # Hence, in the following, we read the 'coordinates' attribute of the
        #   variable of interest.  We loop through each listed instance variable
        #   to try to determine the x and y coordinate variables.  Given these
        #   variables, we assume the instance dimension is the rightmost
        #   dimension of the x variable.
        # So, generally, our netCDF file has minimum structure:
        #   DIMENSIONS:
        #       instance = #
        #   VARIABLES:
        #       var_name(..., instance, ...)
        #           .coordinates = "... lon lat ..."
        #       lon(..., instance)
        #       lat(..., instance)

        # Get variable
        arr_var = dataset.variable(var_name)

        # Extract coordinates attribute
        if 'coordinates' in arr_var.ncattrs():
            dim_names = str(arr_var.getncattr('coordinates')).split()
        else:
            return (None, None, None)

        # Coordinate variables can be identified via values of their standard
        # name attribute or values of their units attribute.
        XCoordNamesList = ["longitude","projection_x_coordinate",
                            "grid_longitude"]
        YCoordNamesList = ["latitude","projection_y_coordinate",
                           "grid_longitude"]
        XUnitNamesList = ["degrees_east", "degree_east", "degree_E",
                           "degrees_E", "degreeE", "degreesE" ]
        YUnitNamesList = ["degrees_north","degree_north","degree_N",
                              "degrees_N","degreeN","degreesN"]
        XAxisNameList = ["X"]
        YAxisNameList = ["Y"]

        # Search for x and y variables
        x_variable = ""
        y_variable = ""
        # Loop through each instance variable
        for dim_name in dim_names:
            # Check that a variable actually exists for it (i.e. rather than
            #   being solely a dimension in the dataset).
            if dim_name in dataset.variable_names():
                # Get that variable
                dim_var = dataset.variable(dim_name)
                # Get attribute value if the attribute exists
                if 'standard_name' in dim_var.ncattrs():
                    SNattributeValue = str(dim_var.getncattr('standard_name'))
                else:
                    SNattributeValue = 'missing'
                if 'units' in dim_var.ncattrs():
                    UNattributeValue = str(dim_var.getncattr('units'))
                else:
                    UNattributeValue = 'missing'
                if 'axis' in dim_var.ncattrs():
                    AXattributeValue = str(dim_var.getncattr('axis'))
                else:
                    AXattributeValue = 'missing'
                # Try to discover x and y variables
                if SNattributeValue in XCoordNamesList:
                    x_variable = dim_name
                if SNattributeValue in YCoordNamesList:
                    y_variable = dim_name
                if UNattributeValue in XUnitNamesList:
                    x_variable = dim_name
                if UNattributeValue in YUnitNamesList:
                    y_variable = dim_name
                if AXattributeValue in XAxisNameList:
                    x_variable = dim_name
                if AXattributeValue in YAxisNameList:
                    y_variable = dim_name
        if (not x_variable) or (not y_variable):
            return (None, None, None)

        # Get dimensions of x variable
        stat_variable = dataset.variable_dimension_names(x_variable)

        if len(stat_variable) > 0:
            # Assume instance / station dimension is rightmost dimension
            stat_variable = stat_variable[-1]
        else:
            stat_variable = None

        return (stat_variable, x_variable, y_variable)
Given the name of a netCDF variable, return a tuple of variables
dataset/ETHPy150Open Esri/solutions-geoprocessing-toolbox/suitability/toolboxes/scripts/MultidimensionSupplementalTools/MultidimensionSupplementalTools/Scripts/mds/tools/multidimensional_zonal_statistics.py/MultidimensionalZonalStatistics.get_dependent_variables