def execute(self, parameters, messages):
        """The source code of the tool."""

        # Describe the supplied netCDF File.
        ncFP = arcpy.NetCDFFileProperties(parameters[0].valueAsText)
        selectedVars = parameters[1].valueAsText.split(';')

        # Coordinate variables can be identified via values of their standard
        # name attribute or values of their untis 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"]

        # Case 1: Independent latitude, Longitude, Vertical and Time Axes
        # Get the dimensions associated with the first variable.  We can use a
        # single variable because tool validation guarentees that all the
        # selected variables have the same dimensions.
        dimNames = ncFP.getDimensionsByVariable(str(selectedVars[0]))
        x_variable = ""
        y_variable = ""
        for dimension in dimNames:
            # Per CF 1.6 (Chapter 5, preamble): "All of a variable's dimensions
            # that are latitude, longitude, vertical, or time dimensions must
            # have corresponding coordinate variables, i.e., one-dimensional
            # variables with the same name as the dimension."
            # Identify the coordinate variable by its standard name or units.

            try:
                SNattributeValue = ncFP.getAttributeValue(dimension,
                    "standard_name")
            except:
                SNattributeValue = "missing"

            try:
                UNattributeValue = ncFP.getAttributeValue(dimension, "units")
            except:
                UNattributeValue = "missing"

            try:
                AXattributeValue = ncFP.getAttributeValue(dimension,"axis")
            except:
                AXattributeValue = "missing"

            if SNattributeValue in XCoordNamesList:
                x_variable = dimension
            if SNattributeValue in YCoordNamesList:
                y_variable = dimension
            if UNattributeValue in XUnitNamesList:
                x_variable = dimension
            if UNattributeValue in YUnitNamesList:
                y_variable = dimension
            if AXattributeValue in XAxisNameList:
                x_variable = dimension
            if AXattributeValue in YAxisNameList:
                y_variable = dimension

        # Set the row dimensions parameter of the Make NetCDF Feature Layer tool
        # to the names of the latitude and longitude dimensions
        rowDimensions = ""
        rowDimensions = x_variable + ";" + y_variable


        # Case #2: 2 dimensional lat/long coordinate variable
        # If unsuccessful in locating variable for x and y coordinates based on
        # latitude and longitude, check to see if variable of interest is
        # georeferenced via a 2 dimensional lat/long coordinate variable

        # Coordinate Variable Method will only work if CDL conforms to the
        # CF 1.6 convention (section 2.4) that "All other dimensions should,
        # whenever possible, be placed to the left of the spatiotemporal
        # dimensions."

        if (not x_variable) or (not y_variable):
            try:
                coordAttributeValue = ncFP.getAttributeValue(str(selectedVars[0]),
                    "coordinates")
                coordVariables = coordAttributeValue.split(' ')
                for element in coordVariables:
                    try:
                        SNattributeValue = ncFP.getAttributeValue(element,
                            "standard_name")
                    except:
                        SNattributeValue = "missing"

                    try:
                        UNattributeValue = ncFP.getAttributeValue(element,
                            "units")
                    except:
                        UNattributeValue = "missing"

                    try:
                        AXattributeValue = ncFP.getAttributeValue(element,
                            "axis")
                    except:
                        AXattributeValue = "missing"

                    if SNattributeValue in XCoordNamesList:
                        x_variable = element
                    if SNattributeValue in YCoordNamesList:
                        y_variable = element
                    if UNattributeValue in XUnitNamesList:
                        x_variable = element
                    if UNattributeValue in YUnitNamesList:
                        y_variable = element
                    if AXattributeValue in XAxisNameList:
                        x_variable = element
                    if AXattributeValue in YAxisNameList:
                        y_variable = element

                # Set the row dimensions parameter of the Make NetCDF Feature
                # Layer tool to the names of the coordinate variables
                dimNames = ncFP.getDimensionsByVariable(str(selectedVars[0]))
                rowDimensions = str(dimNames[-1]) + ";" + str(dimNames[-2])


            except:
                CoordAttributeValue = "missing"

        # Convert the python list of selected variables into a single
        # (comma delimited string if necessary.
        if selectedVars.count > 1:
            variable_list = ','.join([str(x) for x in selectedVars])
        else:
            variable_list = selectedVars[0]

        if (x_variable) and (y_variable):
            if (debug):
                arcpy.AddWarning("netCDFFile Name: %s" \
                    % parameters[0].valueAsText)
                arcpy.AddWarning("Variable List: %s" % variable_list)
                arcpy.AddWarning("x_variable: %s" % x_variable)
                arcpy.AddWarning("y_variable: %s" % y_variable)
                arcpy.AddWarning("Output Feature Layer: %s " \
                    % parameters[2].valueAsText)
                arcpy.AddWarning("Row Dimensions: %s " % rowDimensions)

            result1 = arcpy.MakeNetCDFFeatureLayer_md(parameters[0].valueAsText,
                                            variable_list,
                                            x_variable,
                                            y_variable,
                                            parameters[2].value,
                                            rowDimensions)
            # Force the netCDF Feature Layer to be added to the display
            arcpy.SetParameter(3, result1)
        else:
            arcpy.AddError("Unable to automatically determine x and y " +
                "variables from the netCDF file. Use Make NetCDF " +
                "Feature Layer tool.")
        return
dataset/ETHPy150Open Esri/solutions-geoprocessing-toolbox/suitability/toolboxes/scripts/MultidimensionSupplementalTools/MultidimensionSupplementalTools/Scripts/mds/tools/make_netcdf_regularpointslayer.py/MakeNetCDFRegularPointsLayer.execute/original