.. highlightlang:: us .. index:: NC_Classify .. _nc_classify: NC_Classify =========== .. us.tag NC_Classify ENGLISH nc.tools New5514 :ref:`NC_Classify` classifies the data into groups. For each group an index channel is created. The index channel starts with the value 1 and is constant for each group. The second group receives the index value 2 and so on. If invoked with more than 2 parameters the data file can be split into single files depending on the given index channel name. .. function:: bool = NC_Classify(ncid, smClassDefine) bool = NC_Classify(ssNCFile, smClassDefine) svNames = NC_Classify(ncid, smClassDefine, ssSplitBaseName, ssSplitIndexChannel) svNames = NC_Classify(ssNCFile, smClassDefine, ssSplitBaseName, ssSplitIndexChannel) svNames = NC_Classify(ncid, smClassDefine, ssSplitBaseName, ssSplitIndexChannel, svChannelList) svNames = NC_Classify(ssNCFile, smClassDefine, ssSplitBaseName, ssSplitIndexChannel, svChannelList) .. us.return **Return Value** *bool* is TRUE if the function was successful. *svNames* are the names of the NC split files. .. us.params **Parameters** .. uparam:: ssNCFile *ssNCFile* is the name of an NC file with the source data. .. uparam:: ncid *ncid* is the handle of an NC file, returned by :ref:`nc_create` or :ref:`nc_open`. The file must be opened with write access. .. uparam:: smClassDefine *smClassDefine* is a string matrix with 2 columns and 1 to 4 rows. The first column contains the channel name and the second column the tolerance. Example:: smClassDefine = ["speed", "10"; "torque", "0.5"]; For text channels the tolerance value will be ignored. You can set the tolerance value to an empty string "". .. uparam:: ssSplitBaseName *ssSplitBaseName* is a complete file name used to name the split files. The channelname followed by ``=`` followed by the group value followed by an underscore followed by the index value, followed by ``.nc``. Example: "d:\\map-data_map.xls_N=4590_10.nc" .. uparam:: ssSplitIndexChannel *ssSplitIndexChannel* is the name of the index channel. The name is the sting ``_index_`` followed by the name of the channel used to classify the data. .. uparam:: svChannelList *svChannelList* is and optional string vector with channel names. Only the given channels are added the the files. .. us.comment **Comment** Up to 4 channels can be specified to classify the data. The data is sorted in ascending order after the first specified channel. The double tolerance is added to the first value (minimum) to specify the lower and upper class limit. The next class starts with the first value bigger than the last upper class limit. For each channel an index channel is created. The index channel starts with the text ``_index_`` followed by the channel name, for example ``_index_speed``. The channel contains olny integer beginning wiht 1. The index channel can be used to import data, for example the the type ``2D: x/y/Cycle-Index``. See also :ref:`browserclassify`. .. us.example **Example** :: def TestSplit() { ssFile = GetRootDirector() + "samples\\map-data.xls"; ssNCFile = auto_ImportData(ssFile); if (ssNCFile == "") { return FALSE; } ssNewNCBaseName = sum(SplitPath(ssNCFile)[1,2,3]); return NC_Classify(ssNCFile, ["N", "20"], ssNewNCBaseName, "_index_N"); } .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - R2013.14 - New. .. seealso:: :ref:`overview-netcdf-files`, :ref:`fileexport-data`, :ref:`nc_create`, :ref:`nc_open`, :ref:`auto_ImportData`, :ref:`browserclassify`, :ref:`NC_ExportData` :sub:`id-1676138`