The connection object has a series of parameters that can be set. Currently the parameters that can be set are "ALLOW_DATA_ON_TAPE", "GAP_HANDLER", and "ITERATE_USE_GAP_HANDLERS".
ALLOW_DATA_ON_TAPE. NDS2 only. The NDS2 server may serve data that resides on a high latency storage layer, such as a tape system. This may lead to data requests taking minutes or hours to complete, depending on the load on the storage system.As of version 0.12 of the client the default is to raise an error when accessing data that is on a high latency storage layer. This allows the application to provide feedback (if needed) to a users regarding amount of time that a request may take. If this parameter is set to a true value ("True", "1", "yes") then an error will not be raised when requesting data on a high latency storage.
As of client 0.12.0 "ALLOW_DATA_ON_TAPE" is set to False by default. You MUST enable data on tape if you want it.
GAP_HANDLER. For a given request there may not be be data available to fill the request completely. This happens due to issues upstream of the NDS server. How this is handled is application specific. Setting the "GAP_HANDLER" parameter allows the application to specify what to do. This includes options such as abort, zero fill the data, ...
Available handlers:
"ABORT_HANDLER". This aborts the request when a gap is found in the data.
"STATIC_HANDLER_ZERO". This zero fills any missing data.
"STATIC_HANDLER_ONE". This fills any missing data with ones.
"STATIC_HANDLER_NAN". This fills any missing data with NaN values (or zero for integer channels).
"STATIC_HANDLER_POS_INF". This fills any missing data with +infinity (or the maximum integer value for integer channels).
"STATIC_HANDLER_NEG_INF". This fills any missing data with -infinity (or the minimum integer value for integer channels).
ITERATE_USE_GAP_HANDLERS. The iterate methods have a special case. Unlike fetch operations which work on a single block, the iterate methods retrieve chunks of data that may not need to be contigous. Setting ITERATE_USE_GAP_HANDLERS to "false" configures the connection to simply skip any gaps in the data and only return the data that is available.
Please note that if you are asking for multiple channels that do not have identical gaps the NDS servers will return a data not found error if ITERATE_USE_GAP_HANDLERS is set to false.
Parameters can also be given default values in the system environment. The names of the environment variables are derived by prefixing them with "NDS2_CLIENT_". So the available enviornment variables are "NDS2_CLIENT_ALLOW_DATA_ON_TAPE", "NDS2_CLIENT_GAP_HANDLER", and "NDS2_CLIENT_ITERATE_USE_GAP_HANDLERS".
Example 4.4. Setting parameters in Python with connection.set_parameter()
Allow data on tape. >>>conn.set_parameter('ALLOW_DATA_ON_TAPE', '1')
Equivalent to: >>>conn.set_parameter('ALLOW_DATA_ON_TAPE', 'True')
Set a gap handler: >>>conn.set_parameter('GAP_HANDLER', 'STATIC_HANDLER_ZERO')
Example 4.5. Setting parameters in Octave with connection.set_parameter()
Allow data on tape. octave:1>conn.set_parameter('ALLOW_DATA_ON_TAPE', '1')
Equivalent to: octave:2>conn.set_parameter('ALLOW_DATA_ON_TAPE', 'True')
Set a gap handler: octave:3conn.set_parameter('GAP_HANDLER', 'STATIC_HANDLER_ZERO')
Example 4.6. Setting parameters in MATLAB with connection.set_parameter()
Allow data on tape. >>conn.set_parameter('ALLOW_DATA_ON_TAPE', '1')
Equivalent to: >>conn.set_parameter('ALLOW_DATA_ON_TAPE', 'True')
Set a gap handler: >>conn.set_parameter('GAP_HANDLER', 'STATIC_HANDLER_ZERO')