gd_mplex_lookback(3)

πŸ’– gd_mplex_lookback πŸ’–

okay bestie, gather round, because we're talking about gd_mplex_lookback(3) β€” a lil function from the GETDATA family that does exactly one job and does it slayfully. no cap.


✨ NAME ✨

gd_mplex_lookback β€” set the GetData lookback length for MPLEX fields. that's it, that's the whole vibe πŸŽ€


🌸 SYNOPSIS 🌸

#include <getdata.h>

void gd_mplex_lookback(DIRFILE *dirfile, int lookback);

πŸ¦‹ DESCRIPTION πŸ¦‹

so. gd_mplex_lookback() controls how far back GetData will search for the initial value of a field when it's reading an MPLEX field out of the dirfile(5) database you handed it in dirfile. it's giving "how deep are we digging, bestie" πŸ’…

here's the situation: if the first sample returned for a MPLEX field doesn't contain the value of the field β€” because the index field doesn't take on the specified multiplex index value β€” then GetData has to search the field backwards to find the last time the field was actually updated, so it can propagate that value into the initial portion of the returned data. (peep gd_getdata(3) for the full tea on what data comes back for a MPLEX field.)

this function sets how much data GetData searches before it gives up, based on lookback. two special cases, bestie, listen close:

  • if lookback is zero, the search is disabled completely, and the start of the returned data gets padded (with zero or IEEE-754-conformant not-a-number) β€” unless the first sample returned happens to contain the value of the field. so like, no digging, hope for the best πŸ™ˆ
  • if lookback is the special symbol GD_LOOKBACK_ALL, GetData will exhaustively search all available data before the returned portion for an initial value. full send. πŸ”₯

if it's not one of those special values, lookback should be a positive integer specifying the number of MPLEX periods to search. and every MPLEX field has its own period, measured in samples of the index field, defined like this:

  • if the MPLEX field in question specifies an optional period positive parameter (check the MPLEX definition in dirfile-format(5)), its period is that many samples;
  • otherwise, if the MPLEX field's count_val is at least five, its period is one more sample than twice that value;
  • otherwise, the period is ten samples.

so given these MPLEX definitions, right:

field1 MPLEX data_field index_field 7 12
field2 MPLEX data_field index_field 2 6
field3 MPLEX data_field index_field 7
field4 MPLEX data_field index_field 2
  • field1 has a period of 12 samples, and field2 has a period of 6 samples (both of those are just the value of their period parameters);
  • field3 has a period of 15 samples (one more than twice it's count_val);
  • field4 has a period of 10 samples (the default value, since its count_val is less than five).

the initial value of the MPLEX lookback is ten periods. this value is provided in getdata.h as GD_DEFAULT_LOOKBACK. iconic of it honestly πŸ‘‘

and the best part? this function always succeeds and returns no value. no error codes, no drama, no notes. it just does the thing and moves on. main character energy fr fr ✨


πŸ“œ HISTORY πŸ“œ

gd_mplex_lookback() appeared in GetData-0.8.0. a whole era began 🌈


πŸ‘€ SEE ALSO πŸ‘€

gd_getdata(3), gd_open(3), dirfile(5), dirfile-format(5)


and that's the whole page, bestie!! this lil gem is from Version 0.10.0, dated 25 December 2016 β€” happy holidays from the GetData girlies πŸŽ€πŸ’– periodt.