nds2-client - User 0.16.7
Loading...
Searching...
No Matches
Classes | Functions
NDS Namespace Reference

The NDS client namespace. More...

Classes

struct  availability
 Availability information for a channel. More...
 
class  availability_list_type
 A list of availabilitys (channels, availability segments) More...
 
class  buffer
 A buffer holds the data contents of a channel. More...
 
class  channel
 Represents a LIGO data channel. More...
 
struct  channel_data_type_conversion
 Given a C++ data type, determine which NDS channel data type applies to it. More...
 
class  channel_predicate_object
 A predicate object to be used in limiting the number of channels returned when searching for channels. More...
 
class  connection
 A connection to the NDS/NDS2 server. More...
 
class  data_iterable
 The data_iterable manages streaming data from an NDS::connection. More...
 
class  data_stream_iterator
 A input iterator. More...
 
struct  frequency_range
 A simple range for sample rates. More...
 
class  parameters
 The parameters class holds the configuration for a connection. This includes gap handling strategy and server connection information. More...
 
struct  request_period
 This represents a [start, stop) time with an optional data stride. More...
 
struct  segment
 An availability segment defines when data is available. More...
 
class  segment_list_type
 A list of detailed segments. This does not contain the channel name. More...
 
class  simple_availability_list_type
 A list of simple availability lists. More...
 
struct  simple_segment
 A simple [start,stop) range for denoting segments. More...
 
class  simple_segment_list_type
 A list of simple segments. This does not contain the channel name. More...
 

Functions

template<typename... Args>
channel_predicate_object channel_predicate (Args... args)
 
NDS::buffers_type fetch (const NDS::parameters &params, buffer::gps_second_type gps_start, buffer::gps_second_type gps_stop, const NDS::connection::channel_names_type &channel_names)
 Retreive data from the server without having to manage a connection.
 
NDS::buffers_type fetch (buffer::gps_second_type gps_start, buffer::gps_second_type gps_stop, const NDS::connection::channel_names_type &channel_names)
 Retreive data from the server without having to manage a connection.
 
NDS::data_iterable iterate (const NDS::parameters &params, NDS::request_period period, const NDS::connection::channel_names_type &channel_names)
 Retreive data in segments without having to manage a connection.
 
NDS::data_iterable iterate (NDS::request_period period, const NDS::connection::channel_names_type &channel_names)
 Retreive data in segments without having to manage a connection.
 
channels_type find_channels (const NDS::parameters &params, const channel_predicate_object &pred)
 Retrieve a list of channels without having to manage a connection.
 
channels_type find_channels (const channel_predicate_object &pred)
 Retrieve a list of channels without having to manage a connection.
 
DLL_EXPORT NDS::buffers_type fetch (const NDS::parameters &params, buffer::gps_second_type gps_start, buffer::gps_second_type gps_stop, const NDS::connection::channel_names_type &channel_names)
 Retreive data from the server without having to manage a connection.
 
DLL_EXPORT NDS::buffers_type fetch (buffer::gps_second_type gps_start, buffer::gps_second_type gps_stop, const NDS::connection::channel_names_type &channel_names)
 Retreive data from the server without having to manage a connection.
 
DLL_EXPORT NDS::data_iterable iterate (const NDS::parameters &params, NDS::request_period period, const NDS::connection::channel_names_type &channel_names)
 Retreive data in segments without having to manage a connection.
 
DLL_EXPORT NDS::data_iterable iterate (NDS::request_period period, const NDS::connection::channel_names_type &channel_names)
 Retreive data in segments without having to manage a connection.
 
DLL_EXPORT channels_type find_channels (const NDS::parameters &params, const channel_predicate_object &pred)
 Retrieve a list of channels without having to manage a connection.
 
DLL_EXPORT channels_type find_channels (const channel_predicate_object &pred)
 Retrieve a list of channels without having to manage a connection.
 

Detailed Description

The NDS client namespace.

Function Documentation

◆ channel_predicate()

template<typename... Args>
channel_predicate_object NDS::abi_0::channel_predicate ( Args...  args)

Create a ChannelPredicate object initialized with the parameters to this call.

Template Parameters
ArgsThe types of args
Parameters
argsarguments predicate object.
Returns
A ChannelPredicate object which has been initialized with the search parameters specified.
Note
Each argument passed to this function is used to set a constraint in a ChannelPredicate object.

◆ fetch() [1/4]

NDS::buffers_type NDS::abi_0::fetch ( buffer::gps_second_type  gps_start,
buffer::gps_second_type  gps_stop,
const NDS::connection::channel_names_type &  channel_names 
)

Retreive data from the server without having to manage a connection.

Given a start/stop time and a channel list retrieve the associated data, pulling connection information from the environment.

Parameters
[in]gps_startStart time of request
[in]gps_stopStop time of request
[in]channel_namesThe channel list
Returns
A list of buffers containing the request data.
Remarks
The server to connect to, gap handlers, ... are all configured via the environment.

◆ fetch() [2/4]

DLL_EXPORT NDS::buffers_type NDS::abi_0::fetch ( buffer::gps_second_type  gps_start,
buffer::gps_second_type  gps_stop,
const NDS::connection::channel_names_type &  channel_names 
)

Retreive data from the server without having to manage a connection.

Given a start/stop time and a channel list retrieve the associated data, pulling connection information from the environment.

Parameters
[in]gps_startStart time of request
[in]gps_stopStop time of request
[in]channel_namesThe channel list
Returns
A list of buffers containing the request data.
Remarks
The server to connect to, gap handlers, ... are all configured via the environment.

◆ fetch() [3/4]

NDS::buffers_type NDS::abi_0::fetch ( const NDS::parameters params,
buffer::gps_second_type  gps_start,
buffer::gps_second_type  gps_stop,
const NDS::connection::channel_names_type &  channel_names 
)

Retreive data from the server without having to manage a connection.

Given a start/stop time and a channel list retrieve the associated data.

Parameters
[in]paramsParameters object specifying connection settings
[in]gps_startStart time of request
[in]gps_stopStop time of request
[in]channel_namesThe channel list
Returns
A list of buffers containing the request data.
Remarks
The params argument should be used to specify how fetch selects gap handlers, deals with data on tape, and provide a specific server to connect to.

◆ fetch() [4/4]

DLL_EXPORT NDS::buffers_type NDS::abi_0::fetch ( const NDS::parameters params,
buffer::gps_second_type  gps_start,
buffer::gps_second_type  gps_stop,
const NDS::connection::channel_names_type &  channel_names 
)

Retreive data from the server without having to manage a connection.

Given a start/stop time and a channel list retrieve the associated data.

Parameters
[in]paramsParameters object specifying connection settings
[in]gps_startStart time of request
[in]gps_stopStop time of request
[in]channel_namesThe channel list
Returns
A list of buffers containing the request data.
Remarks
The params argument should be used to specify how fetch selects gap handlers, deals with data on tape, and provide a specific server to connect to.

◆ find_channels() [1/4]

channels_type NDS::abi_0::find_channels ( const channel_predicate_object pred)

Retrieve a list of channels without having to manage a connection.

Return a list of channels that are available form this connection within the given contstraints.

Parameters
[in]predA channel_predicate object holding the constraints to impose on the search.
Returns
A count of channels matching the input parameters.
Remarks
This may result in multiple requests being sent to the server.
Note
The server(s) that are queried for channel lists is pulled from the environment. To specify a specific server use the overload that takes a parameters object.
// Return all channels
auto chans = find_channels(channel_predicate());
// Return all DMT channels
auto chans = conn.find_channels(channel_predicate("*DMT*"));
// Return all 16Hz-2KHz channels that are 32 bit integers
auto chans =
find_channels(channel_predicate(FrequencyRange(16.0, 2000.),
@ DATA_TYPE_INT32
32 bit signed integer
Definition nds_channel.hh:56
// Return all 16Hz-2KHz channels that are 32 bit integers
// from the O1 run.
auto chans =
find_channels(channel_predicate(FrequencyRange(16.0, 2000.),

◆ find_channels() [2/4]

DLL_EXPORT channels_type NDS::abi_0::find_channels ( const channel_predicate_object pred)

Retrieve a list of channels without having to manage a connection.

Return a list of channels that are available form this connection within the given contstraints.

Parameters
[in]predA channel_predicate object holding the constraints to impose on the search.
Returns
A count of channels matching the input parameters.
Remarks
This may result in multiple requests being sent to the server.
Note
The server(s) that are queried for channel lists is pulled from the environment. To specify a specific server use the overload that takes a parameters object.
// Return all channels
auto chans = find_channels(channel_predicate());
// Return all DMT channels
auto chans = conn.find_channels(channel_predicate("*DMT*"));
// Return all 16Hz-2KHz channels that are 32 bit integers
auto chans =
find_channels(channel_predicate(FrequencyRange(16.0, 2000.),
// Return all 16Hz-2KHz channels that are 32 bit integers
// from the O1 run.
auto chans =
find_channels(channel_predicate(FrequencyRange(16.0, 2000.),

◆ find_channels() [3/4]

channels_type NDS::abi_0::find_channels ( const NDS::parameters params,
const channel_predicate_object pred 
)

Retrieve a list of channels without having to manage a connection.

Return a list of channels that are available form this connection within the given contstraints.

Parameters
[in]paramsA parameters object used to specify a specific server
[in]predA channel_predicate object holding the constraints to impose on the search.
Returns
A count of channels matching the input parameters.
Remarks
This may result in multiple requests being sent to the server.
// Return all channels
auto params = parameters(hostname, port);
auto chans = find_channels(params, channel_predicate());
The parameters class holds the configuration for a connection. This includes gap handling strategy an...
Definition nds_connection.hh:930
// Return all DMT channels
auto params = parameters(hostname, port);
auto chans = conn.find_channels(params, channel_predicate("*DMT*"));
// Return all 16Hz-2KHz channels that are 32 bit integers
auto params = parameters(hostname, port);
auto chans =
find_channels(params, channel_predicate(FrequencyRange(16.0, 2000.),
// Return all 16Hz-2KHz channels that are 32 bit integers
// from the O1 run.
auto params = parameters(hostname, port);
auto chans =
find_channels(params, channel_predicate(FrequencyRange(16.0, 2000.),

◆ find_channels() [4/4]

DLL_EXPORT channels_type NDS::abi_0::find_channels ( const NDS::parameters params,
const channel_predicate_object pred 
)

Retrieve a list of channels without having to manage a connection.

Return a list of channels that are available form this connection within the given contstraints.

Parameters
[in]paramsA parameters object used to specify a specific server
[in]predA channel_predicate object holding the constraints to impose on the search.
Returns
A count of channels matching the input parameters.
Remarks
This may result in multiple requests being sent to the server.
// Return all channels
auto params = parameters(hostname, port);
auto chans = find_channels(params, channel_predicate());
// Return all DMT channels
auto params = parameters(hostname, port);
auto chans = conn.find_channels(params, channel_predicate("*DMT*"));
// Return all 16Hz-2KHz channels that are 32 bit integers
auto params = parameters(hostname, port);
auto chans =
find_channels(params, channel_predicate(FrequencyRange(16.0, 2000.),
// Return all 16Hz-2KHz channels that are 32 bit integers
// from the O1 run.
auto params = parameters(hostname, port);
auto chans =
find_channels(params, channel_predicate(FrequencyRange(16.0, 2000.),

◆ iterate() [1/4]

NDS::data_iterable NDS::abi_0::iterate ( const NDS::parameters params,
NDS::request_period  period,
const NDS::connection::channel_names_type &  channel_names 
)

Retreive data in segments without having to manage a connection.

Setup an iterative data retrieval process. This function initiates the request for data in range specified by period, but does not actually retreive the data. Instead it returns a data_stream object which manages the data iteration request.

Parameters
[in]paramsParameters object specifying connection settings
[in]periodThe range of data to return. It may be any range that a request_period may express, including unbounded live data, bounded live data, or bounded historical data.
[in]channel_namesThe list of channels to retrieve data for.
Returns
A data_iterable object which manages the iteration.
Note
All iterate calls must be terminated. If you break out of an iterate loop without retrieving all of the available data you must call the abort() method of the data_iterable object to ensure that a network connection is not left open to the server. This will eventually happen when all references to the data_iterable object and the iterators it refers to are destructed.
// to stream live data from a connection object 'conn'.
auto params = parameters(hostname, port);
auto stream = iterate(params, NDS::request_period(),
{"H1:GDS-CALIB_STRAIN,online",});
for (auto it:stream) {
// *it will be a std::shared_ptr<NDS::buffers_type>
std::cout << (*it)->Start();
}
This represents a [start, stop) time with an optional data stride.
Definition nds_data_iterator.hh:38
// To stream historical data, skipping over gaps
// it is assumed that start, stop are defined elsewhere
// but are in scope.
auto params = parameters();
params.set("ITERATE_USE_GAP_HANDLERS", "false");
auto stream = iterate(params, NDS::request_period(start, stop),
{"H1:GDS-CALIB_STRAIN,online",});
for (auto it:stream) {
// *it will be a std::shared_ptr<NDS::buffers_type>
std::cout << (*it)->Start();
}

◆ iterate() [2/4]

DLL_EXPORT NDS::data_iterable NDS::abi_0::iterate ( const NDS::parameters params,
NDS::request_period  period,
const NDS::connection::channel_names_type &  channel_names 
)

Retreive data in segments without having to manage a connection.

Setup an iterative data retrieval process. This function initiates the request for data in range specified by period, but does not actually retreive the data. Instead it returns a data_stream object which manages the data iteration request.

Parameters
[in]paramsParameters object specifying connection settings
[in]periodThe range of data to return. It may be any range that a request_period may express, including unbounded live data, bounded live data, or bounded historical data.
[in]channel_namesThe list of channels to retrieve data for.
Returns
A data_iterable object which manages the iteration.
Note
All iterate calls must be terminated. If you break out of an iterate loop without retrieving all of the available data you must call the abort() method of the data_iterable object to ensure that a network connection is not left open to the server. This will eventually happen when all references to the data_iterable object and the iterators it refers to are destructed.
// to stream live data from a connection object 'conn'.
auto params = parameters(hostname, port);
auto stream = iterate(params, NDS::request_period(),
{"H1:GDS-CALIB_STRAIN,online",});
for (auto it:stream) {
// *it will be a std::shared_ptr<NDS::buffers_type>
std::cout << (*it)->Start();
}
// To stream historical data, skipping over gaps
// it is assumed that start, stop are defined elsewhere
// but are in scope.
auto params = parameters();
params.set("ITERATE_USE_GAP_HANDLERS", "false");
auto stream = iterate(params, NDS::request_period(start, stop),
{"H1:GDS-CALIB_STRAIN,online",});
for (auto it:stream) {
// *it will be a std::shared_ptr<NDS::buffers_type>
std::cout << (*it)->Start();
}

◆ iterate() [3/4]

NDS::data_iterable NDS::abi_0::iterate ( NDS::request_period  period,
const NDS::connection::channel_names_type &  channel_names 
)

Retreive data in segments without having to manage a connection.

Setup an iterative data retrieval process. This function initiates the request for data in range specified by period, but does not actually retreive the data. Instead it returns a data_stream object which manages the data iteration request.

Parameters
[in]periodThe range of data to return. It may be any range that a request_period may express, including unbounded live data, bounded live data, or bounded historical data.
[in]channel_namesThe list of channels to retrieve data for.
Returns
A data_iterable object which manages the iteration.
Note
All iterate calls must be terminated. If you break out of an iterate loop without retrieving all of the available data you must call the abort() method of the data_iterable object to ensure that a network connection is not left open to the server. This will eventually happen when all references to the data_iterable object and the iterators it refers to are destructed.
// to stream live data from a connection object 'conn'.
auto stream = iterate(NDS::request_period(),
{"H1:GDS-CALIB_STRAIN,online",});
for (auto it:stream) {
// *it will be a std::shared_ptr<NDS::buffers_type>
std::cout << (*it)->Start();
}
// To stream historical data.
// it is assumed that start, stop are defined elsewhere
// but are in scope.
// Note if to explicitly set gap handlers/... use the
// overload which accepts a parameters object.
auto stream = iterate(NDS::request_period(start, stop),
{"H1:GDS-CALIB_STRAIN,online",});
for (auto it:stream) {
// *it will be a std::shared_ptr<NDS::buffers_type>
std::cout << (*it)->Start();
}

◆ iterate() [4/4]

DLL_EXPORT NDS::data_iterable NDS::abi_0::iterate ( NDS::request_period  period,
const NDS::connection::channel_names_type &  channel_names 
)

Retreive data in segments without having to manage a connection.

Setup an iterative data retrieval process. This function initiates the request for data in range specified by period, but does not actually retreive the data. Instead it returns a data_stream object which manages the data iteration request.

Parameters
[in]periodThe range of data to return. It may be any range that a request_period may express, including unbounded live data, bounded live data, or bounded historical data.
[in]channel_namesThe list of channels to retrieve data for.
Returns
A data_iterable object which manages the iteration.
Note
All iterate calls must be terminated. If you break out of an iterate loop without retrieving all of the available data you must call the abort() method of the data_iterable object to ensure that a network connection is not left open to the server. This will eventually happen when all references to the data_iterable object and the iterators it refers to are destructed.
// to stream live data from a connection object 'conn'.
auto stream = iterate(NDS::request_period(),
{"H1:GDS-CALIB_STRAIN,online",});
for (auto it:stream) {
// *it will be a std::shared_ptr<NDS::buffers_type>
std::cout << (*it)->Start();
}
// To stream historical data.
// it is assumed that start, stop are defined elsewhere
// but are in scope.
// Note if to explicitly set gap handlers/... use the
// overload which accepts a parameters object.
auto stream = iterate(NDS::request_period(start, stop),
{"H1:GDS-CALIB_STRAIN,online",});
for (auto it:stream) {
// *it will be a std::shared_ptr<NDS::buffers_type>
std::cout << (*it)->Start();
}