WIP - add clarification comments

parent ba77fc79
......@@ -15,13 +15,36 @@ extern "C" {
#include <stdlib.h>
#include <sys/time.h>
/*
* general questions/open ends --- look fast for 'tbd' or FIXME in the
* code to quickly identify loose ends
*
* - some params like frequencies and distances might better be passed
* as large integers/indexes in a conventionally bound array between
* e.g. 1525-1630nm - tbd
* - channels will be distance or Bragg, and so configured till next
* call to the configuration (INPUT) function
* - the peak set requested in a channel is assumed to have different
* fit params per peak. If a channel has all its peaks of the same
* type, this can be size-optimized - tbd
*/
/* two types of channel inputs: distance meas. or Bragg */
enum fsi_channel_type {
FSI_CH_NONE = 0,
FSI_CH_DISTANCE = 1, /**< configure as distance meas. channel */
FSI_CH_BRAGG, /**< configure as Bragg channel */
};
/* types of functional forms to fit the peaks found */
enum fsi_peak_type {
FSI_PEAK_NONE = 0,
FSI_PEAK_LORENTZ = 1, /**< Cauchy-Lorentz 1/(1+xˆ2) distribution */
FSI_PEAK_GAUSS, /**< Gaussian (normal) distribution */
FSI_PEAK_SINC, /**< Sinc (sin(x)/x)) distribution */
FSI_PEAK_MOFFAT, /**< Moffat (power of Cauchy pdf) distribution */
FSI_PEAK_BRAGG, /**< Bragg-type peak */
/* FIXME:should Bragg type be set apart? */
/* FIXME:should Bragg type be set apart? tbd */
};
/* biggest number of model parameters among different peak types */
......@@ -34,9 +57,13 @@ enum fsi_peak_type {
/* library error codes */
#define __FSI_ERR_START 1024
struct fsi_peak_request {
/* peak finding/fitting configuration for a channel
*
* A channel will be configured so that
*/
struct fsi_peak_config {
double frequency; /**< estimated frequency where peak fits */
double search_range; /**< estimated interval of peak range */
double range1, range2; /**< estimated interval of peak range */
double channel_gain; /**< FIXME: should be per-channel, not per-peak? */
enum fsi_peak_type type; /**< shape of peak to fit */
};
......@@ -44,7 +71,7 @@ struct fsi_peak_request {
struct fsi_peak_result {
double frequency; /**< center of peak fitted to data */
double amplitude; /**< peak width derived from parameters */
double snr; /**< peak signal-to-noise ratio (?) */
double snr; /**< peak signal-to-noise ratio (? tbd) */
enum fsi_peak_type
type; /**< shape of peak fit to data */
double fit_params[FSI_MAX_MODEL_PARAMS];
......@@ -53,16 +80,20 @@ struct fsi_peak_result {
};
struct fsi_channel_request {
struct fsi_channel_config {
unsigned int channel_id; /**< channel to be configured */
enum fsi_channel_type type; /**< type of channel (distance/Bragg) */
double channel_gain; /**< channel gain FIXME: see fsi_peak_request */
int npeaks; /**< number of valid peaks in peaks array */
struct fsi_peak_request
peaks[FSI_MAX_PEAKS]; /**< peak requests */
};
int npeaks; /**< number of valid peaks to be requested in peaks array */
struct fsi_peak_config
peaks[FSI_MAX_PEAKS]; /**< peak requests
FIXME: should peak params be identical for all of them?
If so, this needs not be an array and npeaks is sufficient */
};
struct fsi_channel_measurement {
unsigned int channel_id; /**< channel measured here */
unsigned int channel_id; /**< channel id of this measurement */
enum fsi_channel_type type; /**< type of channel (distance/Bragg) */
int npeaks; /**< number of valid entries in peaks array */
struct fsi_peak_result
peaks[FSI_MAX_PEAKS]; /**< peam measured values */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment