Intervals¶
When dealing with time domain data, it is very common to specify ranges of time that have some meaning. These might be spans of good or bad data, or time ranges that enclose some important event or feature. This use case is so common that TIDAS has a built in object for this. An “intervals” object represents a list of time ranges. Each span can also optionally have a range of sample indices, which is useful if the intervals are associated with a particular group.
Python¶
-
class
tidas.
Intrvl
(*args, **kwargs)¶ Overloaded function.
- __init__(self: tidas._pytidas.Intrvl) -> None
- __init__(self: tidas._pytidas.Intrvl, arg0: float, arg1: float, arg2: int, arg3: int) -> None
-
class
tidas.
Intervals
(*args, **kwargs)¶ Overloaded function.
- __init__(self: tidas._pytidas.Intervals) -> None
- __init__(self: tidas._pytidas.Intervals, arg0: tidas._pytidas.Dictionary, arg1: int) -> None
-
dictionary
(self: tidas._pytidas.Intervals) → tidas._pytidas.Dictionary¶
-
info
(self: tidas._pytidas.Intervals, arg0: std::ostream, arg1: int) → None¶
-
read
(self: tidas._pytidas.Intervals) → List[tidas._pytidas.Intrvl]¶
-
seek
(arg0: List[tidas._pytidas.Intrvl], arg1: float) → tidas._pytidas.Intrvl¶
-
seek_ceil
(arg0: List[tidas._pytidas.Intrvl], arg1: float) → tidas._pytidas.Intrvl¶
-
seek_floor
(arg0: List[tidas._pytidas.Intrvl], arg1: float) → tidas._pytidas.Intrvl¶
-
size
(self: tidas._pytidas.Intervals) → int¶
-
total_samples
(arg0: List[tidas._pytidas.Intrvl]) → int¶
-
total_time
(arg0: List[tidas._pytidas.Intrvl]) → float¶
-
write
(self: tidas._pytidas.Intervals, arg0: List[tidas._pytidas.Intrvl]) → None¶
C++¶
-
class
tidas::
intrvl
¶ intrvl class.
This represents a single span of time and their sample indices for a particular group.
-
class
tidas::
intervals
¶ An intervals object represents a list of disjoint spans of time.
Although each interval has both a time range and a sample range, those sample indices are only meaningful in the context of a particular group. An intervals object has an optional dictionary associated with it at construction time. Some public methods are only used internally and are not needed for normal use of the object. These are labelled “internal”.
Public Functions
-
intervals
()¶ Default constructor. The backend is set to be memory based.
-
~intervals
()¶ Destructor.
-
intervals
(backend_path const &loc)¶ (Internal) Load the intervals from the specified location.
All meta data operations will apply to this location.
-
intervals
(intervals const &other, std::string const &filter, backend_path const &loc)¶ (Internal) Copy from an existing intervals instance.
Apply an optional filter to elements and relocate to a new location. If a filter is given, a new location must be specified.
-
void
relocate
(backend_path const &loc)¶ (Internal) Change the location of the intervals.
-
void
sync
()¶ (Internal) Reload metadata from the current location, overwriting the current state in memory.
-
void
flush
() const¶ (Internal) Write metadata to the current location, overwriting the information at that location.
-
void
copy
(intervals const &other, std::string const &filter, backend_path const &loc)¶ (Internal) Copy with optional selection and relocation.
-
void
link
(link_type const &type, std::string const &path) const¶ (Internal) Create a link at the specified location.
-
void
wipe
() const¶ (Internal) Delete the on-disk data and metadata associated with this object.
In-memory metadata is not modified.
-
backend_path
location
() const¶ (Internal) The current location.
-
size_t
size
() const¶ The number of intervals contained in this object.
-
void
read_data
(interval_list &intr) const¶ Read the list of intervals from the current location.
-
interval_list
read_data
() const¶ Read the list of intervals from the current location.
-
void
write_data
(interval_list const &intr)¶ Write the list of intervals to the current location.
-
void
info
(std::ostream &out, size_t indent) const¶ Print information to a stream.
Public Static Functions
-
index_type
total_samples
(interval_list const &intr)¶ The total number of samples included in all intervals.
-
time_type
total_time
(interval_list const &intr)¶ The total time span included in all intervals.
-
intrvl
seek
(interval_list const &intr, time_type time)¶ Return the single interval that contains a specified time.
If no interval contains the time, an empty interval is returned.
-