|
SASHE_VAP
1.0
|
Data Structures | |
| struct | ConfigTable |
| SASHE Configuration Table. More... | |
Macros | |
| #define | INTERPOLATE(x, x0, y0, x1, y1) (y0 + (x - x0) * ((y1 - y0)/(x1 - x0))) |
| Macro to interpolate between two values. | |
Functions | |
| int | sashe_find_nearest_float (int n, float *x, float v) |
| Find the index of a value in an array of floats. | |
| int | sashe_find_nearest_double (int n, double *x, double v) |
| Find the index of a value in an array of doubles. | |
| int | sashe_find_recset_indexes (const char *site, time_t data_time, size_t ntags, int *tags, int *recsets, size_t *rs_drk, size_t *rs_tot, size_t *rs_sb1, size_t *rs_blk, size_t *rs_sb2) |
| Get the start indexes of all complete record sets. | |
| void | sashe_free_config_table (ConfigTable *table) |
| Free the memory used by a configuration table. | |
| void | sashe_get_config_values (ConfigTable *table, size_t nvals, float *col1, float *col2) |
| Get values from a configuration table. | |
| void | sashe_get_config_values_interpolate (ConfigTable *table, size_t nvals, float *col1, float *col2) |
| Get values from a configuration table using interpolation. | |
| double | sashe_get_diffuse_correction (void) |
| Get the diffuse correction factor from the conf file. | |
| ConfigTable * | sashe_load_config_table (const char *name) |
| Load the values from a SASHE configuration table. | |
| int | sashe_print_config_table (const char *file, ConfigTable *table) |
| Print a configuration table. | |
| int sashe_find_nearest_double | ( | int | n, |
| double * | x, | ||
| double | v | ||
| ) |
Find the index of a value in an array of doubles.
This function will find the index of the value in an array of monotonically increasing or decreasing values that is closest to the specified value.
| n | number of values in the array |
| x | array of monotonically increasing or decreasing values |
| v | the value to look for |
Definition at line 255 of file sashe_utils.c.
| int sashe_find_nearest_float | ( | int | n, |
| float * | x, | ||
| float | v | ||
| ) |
Find the index of a value in an array of floats.
This function will find the index of the value in an array of monotonically increasing or decreasing values that is closest to the specified value.
| n | number of values in the array |
| x | array of monotonically increasing or decreasing values |
| v | the value to look for |
Definition at line 307 of file sashe_utils.c.
| int sashe_find_recset_indexes | ( | const char * | site, |
| time_t | data_time, | ||
| size_t | ntags, | ||
| int * | tags, | ||
| int * | recsets, | ||
| size_t * | rs_drk, | ||
| size_t * | rs_tot, | ||
| size_t * | rs_sb1, | ||
| size_t * | rs_blk, | ||
| size_t * | rs_sb2 | ||
| ) |
Get the start indexes of all complete record sets.
OLD order before 3/23/2012
Tag sequence 1:
2 - dark counts
3 - total
5 - side blocked
7 - side blocked (other side)
9 - blocked (diffuse)
Tag sequence 2:
11 - dark counts
12 - total
14 - side blocked
16 - side blocked (other side)
18 - blocked (diffuse)
NEW order starts 3/23/2012
Tag sequence 1:
4 - dark counts
5 - total
7 - side blocked
9 - blocked (diffuse)
11 - side blocked (other side)
Tag sequence 2:
15 - dark counts
16 - total
18 - side blocked
20 - blocked (diffuse)
22 - side blocked (other side)
| [in] | site | site name |
| [in] | data_time | start time of the data being processed |
| [in] | ntags | length of the tags array |
| [in] | tags | array of tag values |
| [in] | recsets | array to store the start indexes for each complete record set |
| [out] | rs_drk | record set index of dark counts |
| [out] | rs_tot | record set index of total |
| [out] | rs_sb1 | record set index of side blocked 1 |
| [out] | rs_blk | record set index of blocked |
| [out] | rs_sb2 | record set index of side blocked 2 |
Definition at line 401 of file sashe_utils.c.
| void sashe_free_config_table | ( | ConfigTable * | table | ) |
Free the memory used by a configuration table.
| table | pointer to the configuration table |
Definition at line 476 of file sashe_utils.c.
| void sashe_get_config_values | ( | ConfigTable * | table, |
| size_t | nvals, | ||
| float * | col1, | ||
| float * | col2 | ||
| ) |
Get values from a configuration table.
| table | pointer to the configuration table |
| nvals | number of values to lookup in the configuration table |
| col1 | array of column 1 values to lookup in the table |
| col2 | array to store the corresponding column 2 values in |
Definition at line 493 of file sashe_utils.c.
| void sashe_get_config_values_interpolate | ( | ConfigTable * | table, |
| size_t | nvals, | ||
| float * | col1, | ||
| float * | col2 | ||
| ) |
Get values from a configuration table using interpolation.
| table | pointer to the configuration table |
| nvals | number of values to lookup in the configuration table |
| col1 | array of column 1 values to lookup in the table |
| col2 | array to store the corresponding column 2 values in |
Definition at line 546 of file sashe_utils.c.
| double sashe_get_diffuse_correction | ( | void | ) |
Get the diffuse correction factor from the conf file.
| diff_corr | diffuse correction factor |
| 0 | if an error occurred |
Definition at line 607 of file sashe_utils.c.
| ConfigTable* sashe_load_config_table | ( | const char * | name | ) |
Load the values from a SASHE configuration table.
The memory used by the returned structure is dynamically allocated and must be freed using the sashe_free_config_table() function.
| name | configuration table name |
| table | pointer to the configuration table |
| NULL | if an error occurred |
Definition at line 730 of file sashe_utils.c.
| int sashe_print_config_table | ( | const char * | file, |
| ConfigTable * | table | ||
| ) |
Print a configuration table.
| file | name of the output file |
| table | pointer to the configuration table |
| 1 | if successful |
| 0 | if an error occurred |
Definition at line 767 of file sashe_utils.c.