3. UniScript FAQ¶
3.1. Channel length¶
The length of a channel of an NC2 file can be determined using
def ChannelLength(ssNCFilename, ssChannel)
{
ncid = nc_open(ssNCFilename);
if (ncid == -1) {
MessageBoxError("Cannot open file: %s", ssNCFilename)
return -1;
}
varid = nc_varid(ncid, ssChannel);
if (varid == -1) {
MessageBoxError("Channel does not exist: %s", ssChannel)
return -1;
}
dimid = nc_varinq_dimids(ncid, varid);
if (dimid == -1) {
return -1;
}
return nc_diminq_size(ncid, dimid);
}
* ChannelLength(GetRootDirectory() + "samples\\cycles.nc2", "pzyl_1")
118291.0000
id-749515