Channels#
A channel is one named signal in a dataset, such as altitude. It has a data type, and can have a unit and a description.
To use this page, first make sure you can Connect to Nominal and obtain a client.
Fetch a channel#
If the dataset’s RID and the channel’s name are known, you can fetch that channel directly without needing to search.
let altitude = client.catalog().get_channel("<ri.catalog.instance.dataset.identifier>", "altitude").await?;
Find channels#
// Every channel in the dataset
for channel in client.catalog().list_channels("<ri.catalog.instance.dataset.identifier>").await? {
println!("{} {:?} {}", channel.name(), channel.data_type(), channel.unit().unwrap_or(""));
}
To find only some of a dataset’s channels, give search_channels filters that all have to match:
use nominal::core::{ChannelDataType, ChannelQuery};
// Floating-point channels with "temp" in their names, in any case
let channels = client
.catalog()
.search_channels(
ChannelQuery::new()
.data_source("<ri.catalog.instance.dataset.identifier>")
.substring_match("temp")
.data_type(ChannelDataType::Double),
)
.await?;
Set units and descriptions#
set_channel_metadata sets a channel’s unit and description, without changing its data:
use nominal::core::{ChannelDataType, ChannelUpdate};
client
.catalog()
.set_channel_metadata(
"<ri.catalog.instance.dataset.identifier>",
"altitude",
ChannelUpdate::new(ChannelDataType::Double).unit("m").description("Barometric altitude"),
)
.await?;