librelaxisloader 1.0.x
|
API for use by librelaxisloader users. More...
Data Structures | |
struct | rlx_project |
This struct represents a RelaxIS "project" containing any number of spectra. More... | |
struct | rlx_datapoint |
This struct is used to house a single impedance data point. More... | |
struct | rlx_spectra |
This struct is used to house an EIS spectra and associated meta-data. More... | |
struct | rlx_fitparam |
Functions | |
void | rlx_project_free (struct rlx_project *proj) |
This frees a project struct. | |
void | rlx_project_free_array (struct rlx_project **proj_array) |
This frees an array of project structs. | |
void | rlx_spectra_free (struct rlx_spectra *spectra) |
This frees a spectra struct. | |
void | rlx_spectra_free_array (struct rlx_spectra **spectra_array) |
Frees an array of spectra structs. | |
void | rlx_fitparam_free (struct rlx_fitparam *param) |
Frees a fitparam struct. | |
void | rlx_fitparam_free_array (struct rlx_fitparam **param_array) |
Frees an array of fitparam structs. | |
struct rlxfile * | rlx_open_file (const char *path, const char **error) |
Frees a project struct. | |
void | rlx_close_file (struct rlxfile *file) |
struct rlx_project ** | rlx_get_projects (struct rlxfile *file, size_t *length) |
Gets all the projects in a given RelaxIS file. | |
struct rlx_spectra ** | rlx_get_all_spectra (struct rlxfile *file, const struct rlx_project *project) |
Loads all spectra from file in given project. | |
int * | rlx_get_spectra_ids (struct rlxfile *file, const struct rlx_project *project, size_t *length) |
Loads spectra ids that are associated with a given project. | |
struct rlx_spectra * | rlx_get_spectra (struct rlxfile *file, const struct rlx_project *project, int id) |
Loads spectra with a given spectra id and project from file. | |
int | rlx_get_float_arrays (const struct rlx_spectra *spectra, float **re, float **im, float **omega) |
transforms a rlx_spectra struct into a set of newly allocated arrays, float version. | |
int | rlx_get_double_arrays (const struct rlx_spectra *spectra, double **re, double **im, double **omega) |
transforms a rlx_spectra struct into a set of newly allocated arrays, double version. | |
struct rlx_fitparam ** | rlx_get_fit_parameters (struct rlxfile *file, const struct rlx_project *project, int id, size_t *length) |
Loads the parameters for a given spectra id from file. | |
int | rlx_get_errnum (const struct rlxfile *file) |
Returns the last error returned on a file operation. | |
const char * | rlx_get_errnum_str (int errnum) |
Returns a human readable error string for a given error number. | |
API for use by librelaxisloader users.
This API allows you to load RelaxIS files and get the data therein
void rlx_fitparam_free | ( | struct rlx_fitparam * | param | ) |
Frees a fitparam struct.
fitparam | fitparam struct to be freed |
void rlx_fitparam_free_array | ( | struct rlx_fitparam ** | param_array | ) |
Frees an array of fitparam structs.
param_array | array of fitparam structs to be freed |
struct rlx_spectra ** rlx_get_all_spectra | ( | struct rlxfile * | file, |
const struct rlx_project * | project ) |
Loads all spectra from file in given project.
If this function encounters an error it will return NULL and set an error at rlx_get_errnum.
file | file to load spectra from |
project | project to load spectra from |
int rlx_get_double_arrays | ( | const struct rlx_spectra * | spectra, |
double ** | re, | ||
double ** | im, | ||
double ** | omega ) |
transforms a rlx_spectra struct into a set of newly allocated arrays, double version.
If this function encounters an error it will return NULL and set an error at rlx_get_errnum.
spectra | the spectra to convert |
re | an array with the real part of the spectra will be allocated here. To be freed by free(). |
im | an array with the imaginary part of the spectra will be allocated here. To be freed by free(). |
omega | an array with the omega values of the spectra will be allocated here. To be freed by free(). |
int rlx_get_errnum | ( | const struct rlxfile * | file | ) |
Returns the last error returned on a file operation.
const char * rlx_get_errnum_str | ( | int | errnum | ) |
Returns a human readable error string for a given error number.
struct rlx_fitparam ** rlx_get_fit_parameters | ( | struct rlxfile * | file, |
const struct rlx_project * | project, | ||
int | id, | ||
size_t * | length ) |
Loads the parameters for a given spectra id from file.
If this function encounters an error it will return NULL and set an error at rlx_get_errnum.
file | file to load spectra from |
project | project to load spectra from |
id | spectra id for which to load parameters |
length | a pointer to a size_t where the number of parameters will be stored, or NULL |
int rlx_get_float_arrays | ( | const struct rlx_spectra * | spectra, |
float ** | re, | ||
float ** | im, | ||
float ** | omega ) |
transforms a rlx_spectra struct into a set of newly allocated arrays, float version.
If this function encounters an error it will return NULL and set an error at rlx_get_errnum.
spectra | the spectra to convert |
re | an array with the real part of the spectra will be allocated here. To be freed by free(). |
im | an array with the imaginary part of the spectra will be allocated here. To be freed by free(). |
omega | an array with the omega values of the spectra will be allocated here. To be freed by free(). |
struct rlx_project ** rlx_get_projects | ( | struct rlxfile * | file, |
size_t * | length ) |
Gets all the projects in a given RelaxIS file.
If this function encounters an error it will return NULL and set an error at rlx_get_errnum.
file | file to load projects from |
length | pointer to a size_t where the number of projects will be stored, or NULL |
struct rlx_spectra * rlx_get_spectra | ( | struct rlxfile * | file, |
const struct rlx_project * | project, | ||
int | id ) |
Loads spectra with a given spectra id and project from file.
If this function encounters an error it will return NULL and set an error at rlx_get_errnum.
file | file to load spectra from |
project | project to load spectra from |
id | spectra id to load |
int * rlx_get_spectra_ids | ( | struct rlxfile * | file, |
const struct rlx_project * | project, | ||
size_t * | length ) |
Loads spectra ids that are associated with a given project.
If this function encounters an error it will return NULL and set an error at rlx_get_errnum.
file | file to load spectra from |
project | project to load spectra from |
id | spectra id for which to load parameters |
length | pointer to size_t where the number of ids will be stored or NULL |
struct rlxfile * rlx_open_file | ( | const char * | path, |
const char ** | error ) |
Frees a project struct.
path | the file system path where the file shall be opened |
error | if an error occurs and NULL is returned, pointer to an error string is set here, owned by librelaxisloader, do not free, valid only until next call to librelaxisloader |
void rlx_project_free | ( | struct rlx_project * | proj | ) |
This frees a project struct.
This function must always be used for every singular rlx_project struct to avoid memory leaks. It is safe to pass NULL to this function.
proj | the Project struct to be freed, or NULL. |
void rlx_project_free_array | ( | struct rlx_project ** | proj_array | ) |
This frees an array of project structs.
This function must always be used for array of rlx_project structs to avoid memory leaks.
proj_array | The Array of project structs to be freed. |
void rlx_spectra_free | ( | struct rlx_spectra * | spectra | ) |
This frees a spectra struct.
This function must always be used for every singular rlx_spectra struct to avoid memory leaks. It is safe to pass NULL to this function.
spectra | The spectra to be freed. |
void rlx_spectra_free_array | ( | struct rlx_spectra ** | spectra_array | ) |
Frees an array of spectra structs.
This function must always be used for every array of rlx_spectra structs to avoid memory leaks.
spectra_array | The array of spectra structs to be freed. |