.. highlightlang:: us .. index:: NC_CreateMeanCycleFile .. _nc_createmeancyclefile: NC_CreateMeanCycleFile ====================== .. us.tag NC_CreateMeanCycleFile ENGLISH nc.tools New5151 :ref:`NC_CreateMeanCycleFile` creates a new NC file with the mean, minimum and maximum cycle of an NC data file containing multiple cycles (segments). .. function:: ssNCMean = NC_CreateMeanCycleFile(ncid, obj) ssNCMean = NC_CreateMeanCycleFile(ssNCFile, obj); .. us.return **Return Value** **Returnwert** Is the name of the new NC data file or an empty string if an error occurred. .. 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`. .. uparam:: obj *obj* is an object with the following elements: .. list-table:: :header-rows: 1 * - Name - Description * - obj.ssNCDestName - Complete file name of the source file. If the element does not exist or contains an empty string, the file will be saved in the directory of the source file. * - obj.ssXChannel - Channel name with the x-coordinates, e. g. Time or CrankAngle. * - obj.svMeanChannel - String vector with channel names. * - obj.rsStartCycle - First data point of a cycle start. The point must exist in the x-data range. * - obj.rsCycleLength - Length of one cycle. * - obj.svCycles - Strintg: Specifies the cycles. Example: ``3,6,10-15`` or the key word ``All`` for all cycles. * - obj.bMean - If TRUE (1) the mean cycle will be calculated. * - obj.bMaximum - If TRUE (1) the maximum cycle will be calculated. * - obj.bMinimum - If TRUE (1) the minimum cycle will be calculated. .. us.example **Example** :: def TestMean() { ssIFile = "z:/uniplot-testdata/ifile-daten/1000_023.001" ssNCFile = auto_ImportData(ssIFile); if (ssNCFile == "") { return FALSE; } ncid = nc_open(ssNCFile, NC_WRITE); if (ncid == -1) { return FALSE; } obj = [.]; obj.ssNCDestName = ssIFile + "_mean.nc"; obj.ssXChannel = "CA"; obj.rsStartCycle = -360; obj.rsCycleLength = 720; obj.svCycles = "All"; obj.bMean = 1; obj.bMaximum = 1; obj.bMinimum = 1; obj.svMeanChannel = ["P_ZYL1", "P_ZYL2", "P_ZYL3", "P_ZYL4"]; ssNCMean = NC_CreateMeanCycleFile(ncid, obj); nc_close(ncid); return ssNCMean; } .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - 5.15.1 - New. .. seealso:: :ref:`overview-netcdf-files`, :ref:`fileexport-data`, :ref:`nc_create`, :ref:`nc_open`, :ref:`browsermeancycle` :ref:`auto_ImportData`, :ref:`NC_ExportData` :sub:`id-1363952`