Previous topic

nc_inquire_update

Next topic

nc_last_error

This Page

NC_InterpolationΒΆ

NC_Interpolation creates a new NC file with interpolated data. The function can be used to change the sampling rate (frequency resolution). MDF/Inca files with multiple time channels can be interpolated onto a common time channel.

bool = NC_Interpolation(ssNCFile, ssNewNCName, ssTimeName)
bool = NC_Interpolation(ssNCFile, ssNewNCName, ssTimeName, svChannelList)
bool = NC_Interpolation(ssNCFile, ssNewNCName, ssTimeName, svChannelList, rvTimeDef)
bool = NC_Interpolation(ncid, ssNewNCName, ssTimeName)
bool = NC_Interpolation(ncid, ssNewNCName, ssTimeName, svChannelList)
bool = NC_Interpolation(ncid, ssNewNCName, ssTimeName, svChannelList, rvTimeDef)

Return Value

Is TRUE (1), if the file could be created and otherwise FALSE (0).

Parameters

ssNCFile

ssNCFile is the name of an NC file with the source data.

ncid

ncid is the handle of an NC file, returned by nc_create or nc_open.

ssTimeName

Is the name of a time channel in the source file. If the parameter rvTimeDef is not specified, the data will be interpolated to this channel.

svChannelList

svChannelList is a vector with channel names. If an empty string is given, all channels will be interpolated.

rvTimeDef

Is a real vector with one or three elements.

If the parameter contains one value only, it is the time increment, for example 0.01 seconds (100 Hz). If the vector contains three values, the first element is the start time, the second element the end time and the third element the time increment. Example: [0,10,0.1] create a time channel form 0 to 10 with an increment of 0.1 seconds (10 Hz).

Comment

Only channels with at least 2 data points will be interpolated.

For MDF data files the group name can be ignored.

No extrapolation. Missing values will be set to missing.

A linear interpolation is executed.

Example

def TestInterpolation()
{
     ssDatFile = "u:/nc_daten2/080226_P5736R3_Startversuch.dat"
     ssNCFile = auto_ImportData(ssDatFile);

     ssNewTimeName = "time"
     svChannel = ["AirCtl_dvolIndAir_r32_ETKC_1", "PthSet_trqInrSet_ETKC_1", "AirCtl_mDesVal_ETKC_1"]

     // Erzeuge neuen Namen:
     svPath = SplitPath(ssNCFile);
     ssOutputName = svPath[1] + svPath[2] + svPath[3] + "_interpol" + svPath[4];

     NC_Interpolation(ssNCFile, ssOutputName, ssNewTimeName, svChannel); // Time wie erste Kanal
     //NC_Interpolation (ssNCFile, ssOutputName, ssNewTimeName, svChannel, [0.01]) // Delta 0.1s von Range 1. Kanal
     //NC_Interpolation (ssNCFile, ssOutputName, ssNewTimeName, svChannel, [0,12,0.01]) // Time    }

History

Version Description
5.15.1 New.

id-540769