librelaxisloader is a shared library that allows you to load data from RelaxIS3 files. This library supports only files with a DatabaseFormat of "1"
#include <stdio.h>
#include <relaxisloader.h>
#include <stdlib.h>
int main(int argc, char** argv)
{
if(argc < 2) {
printf("Usage %s [FILE]\n", argc == 1 ? argv[0] : "NULL");
return 1;
}
const char *error;
if(!file) {
printf("Unable to open %s: %s\n", argv[1], error);
return 2;
}
size_t projectCount;
if(projectCount < 1) {
return 4;
}
size_t idCount;
for(int i = 0; i < idCount; ++i)
printf("PROJECT: %d ID: %d\n", projects[0]->id, ids[i]);
if(idCount < 1) {
return 3;
}
printf("%p %d\n", projects[0], projects[0]->id);
if(!spectra) {
return 3;
}
printf("Spectra for PROJECT: %d ID: %d\nomega, re, im\n", projects[0]->id, ids[0]);
for(
size_t i = 0; i < spectra->
length; ++i) {
}
size_t paramCount;
if(!params) {
return 4;
}
for(size_t i = 0; i < paramCount; ++i) {
printf("Parameter %d: Name: %s Value: %f Error: %f\n", params[i]->p_index, params[i]->name, params[i]->value, params[i]->error);
}
free(ids);
rlx_close_file(file);
return 0;
}
void rlx_spectra_free(struct rlx_spectra *spectra)
This frees a spectra struct.
const char * rlx_get_errnum_str(int errnum)
Returns a human readable error string for a given error number.
struct rlx_project ** rlx_get_projects(struct rlxfile *file, size_t *length)
Gets all the projects in a given RelaxIS file.
int rlx_get_errnum(const struct rlxfile *file)
Returns the last error returned on a file operation.
struct rlxfile * rlx_open_file(const char *path, const char **error)
Frees a project struct.
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.
void rlx_project_free_array(struct rlx_project **proj_array)
This frees an array of project structs.
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_spectra_ids(struct rlxfile *file, const struct rlx_project *project, size_t *length)
Loads spectra ids that are associated with a given project.
void rlx_fitparam_free_array(struct rlx_fitparam **param_array)
Frees an array of fitparam structs.
double re
Real part of the measurement in Ohms.
Definition relaxisloader.h:69
double im
Imaginary part of the measurement in Ohms.
Definition relaxisloader.h:68
double omega
Frequency of the measurement in rad/s.
Definition relaxisloader.h:70
Definition relaxisloader.h:110
This struct represents a RelaxIS "project" containing any number of spectra.
Definition relaxisloader.h:39
This struct is used to house an EIS spectra and associated meta-data.
Definition relaxisloader.h:76
size_t length
Amount of data points in the spectrum.
Definition relaxisloader.h:80
struct rlx_datapoint * datapoints
Data points of the spectrum.
Definition relaxisloader.h:79
librelaxisloader is licensed to you under the Gnu Lesser General Public License Version 3.0