ASCOT5
Loading...
Searching...
No Matches
hdf5_helpers.h
Go to the documentation of this file.
1
5#ifndef HDF5_HELPERS_H
6#define HDF5_HELPERS_H
7
8#include <hdf5.h>
9#include "../ascot5.h"
10
11void hdf5_init(void);
12hid_t hdf5_create(const char* filename);
13hid_t hdf5_open(const char* filename);
14hid_t hdf5_open_ro(const char* filename);
15herr_t hdf5_close(hid_t file_id);
16hid_t hdf5_create_group(hid_t loc, const char* path);
17herr_t hdf5_find_group(hid_t loc, const char* path);
18char* hdf5_generate_qid_path(const char* original, char* qid, char* path);
19char* hdf5_gen_path(const char* original, char* qid, char* path);
20int hdf5_read_double(const char* var, real* ptr, hid_t file, char* qid,
21 const char* errfile, int errline);
22int hdf5_read_int(const char* var, int* ptr, hid_t file, char* qid,
23 const char* errfile, int errline);
24int hdf5_read_long(const char* var, long* ptr, hid_t file, char* qid,
25 const char* errfile, int errline);
26herr_t hdf5_write_string_attribute(hid_t loc, const char* path,
27 const char* attrname, const char* string);
29 const char* datasetname,
30 int length, double* data);
31herr_t hdf5_write_extendible_dataset_long(hid_t group,
32 const char* datasetname,
33 int length, long* data);
34herr_t hdf5_write_extendible_dataset_int(hid_t group,
35 const char* datasetname,
36 int length, int* data);
37
38#endif
Main header file for ASCOT5.
double real
Definition ascot5.h:85
hid_t hdf5_create_group(hid_t loc, const char *path)
Create a group (with parent groups if necessary). Returns a handle to the group. Negative on failure.
herr_t hdf5_write_string_attribute(hid_t loc, const char *path, const char *attrname, const char *string)
Write string attribute with null-padding.
herr_t hdf5_find_group(hid_t loc, const char *path)
Checks if given group exists within given hdf5 file. Negative value is returned if the group doesn't ...
herr_t hdf5_write_extendible_dataset_long(hid_t group, const char *datasetname, int length, long *data)
Create and write to an extendible dataset for long data.
herr_t hdf5_write_extendible_dataset_int(hid_t group, const char *datasetname, int length, int *data)
Create and write to an extendible dataset int data.
int hdf5_read_double(const char *var, real *ptr, hid_t file, char *qid, const char *errfile, int errline)
Read double-valued data from ASCOT5 HDF5 file.
int hdf5_read_long(const char *var, long *ptr, hid_t file, char *qid, const char *errfile, int errline)
Read long-valued data from ASCOT5 HDF5 file.
hid_t hdf5_create(const char *filename)
Create an hdf5 file, fail if file exists. A negative value is returned on failure.
herr_t hdf5_close(hid_t file_id)
Close access to given hdf5 file identifier. A negative value is returned on failure.
char * hdf5_gen_path(const char *original, char *qid, char *path)
Generate a valid path from a given template and qid.
void hdf5_init(void)
Initialize hdf5, right now just disables automatic error messages.
hid_t hdf5_open_ro(const char *filename)
Open a hdf5 file for read only. A negative value is returned on failure.
herr_t hdf5_write_extendible_dataset_double(hid_t group, const char *datasetname, int length, double *data)
Create and write to an extendible dataset for double data.
hid_t hdf5_open(const char *filename)
Open a hdf5 file for reading and writing. A negative value is returned on failure.
int hdf5_read_int(const char *var, int *ptr, hid_t file, char *qid, const char *errfile, int errline)
Read int-valued data from ASCOT5 HDF5 file.
char * hdf5_generate_qid_path(const char *original, char *qid, char *path)
Generate a valid path from a given template and qid.