| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
6.5 File I/O
- Method on
mglData(C++, Python):voidRead (const char *fname) - C function:
voidmgl_data_read (HMDTdat,const char *fname) Reads data from tab-separated text file with auto determining sizes of the data.
- Method on
mglData(C++, Python):voidRead (const char *fname,intmx,intmy=1,intmz=1) - C function:
voidmgl_data_read_dim (HMDTdat,const char *fname,intmx,intmy,intmz) Reads data from text file with specified data sizes. This function does nothing if one of parameters mx, my or mz is zero or negative.
- Method on
mglData(C++, Python):voidReadMat (const char *fname,intdim=2) - C function:
voidmgl_data_read_mat (HMDTdat,const char *fname,intdim) Read data from text file with size specified at beginning of the file by first dim numbers. At this, variable dim set data dimensions.
- Method on
mglData(C++, Python):voidReadRange (const char *templ,floatfrom,floatto,floatstep=1.f,boolas_slice=false) Join data arrays from several text files. The file names are determined by function call
sprintf(fname,templ,val);, where val changes from from to to with step step. The data load one-by-one in the same slice if as_slice=falseor as slice-by-slice if as_slice=true.
- Method on
mglData(C++, Python):voidReadAll (const char *templ,boolas_slice=false) Join data arrays from several text files which filenames satisfied the template templ (for example, templ=
"t_*.dat"). The data load one-by-one in the same slice if as_slice=falseor as slice-by-slice if as_slice=true.
- Method on
mglData(C++, Python):voidSave (const char *fname,intns=-1)const - C function:
voidmgl_data_save (const HMDTdat,const char *fname,intns) Saves the whole data array (for ns=
-1) or only ns-th slice to text file.
- Method on
mglData(C++, Python):voidReadHDF (const char *fname,const char *dname) Reads data array named dname from HDF5 or HDF4 file. This function does nothing if NO_HDF5|NO_HDF4 was defined during library compilation.
- Method on
mglData(C++, Python):voidSaveHDF (const char *fname,const char *dname,boolrewrite=false)const Saves data array named dname from HDF5 or HDF4 file. This function does nothing if NO_HDF5|NO_HDF4 was defined during library compilation.
- Method on
mglData(C++, Python):voidImport (const char *fname,const char *scheme,floatv1=0, float v2=1) - C function:
voidmgl_data_import (HMDTdat,const char *fname,const char *scheme,floatv1, float v2) Reads data from bitmap file (now support only PNG format). The RGB values of bitmap pixels are transformed to float values in range [v1, v2] using color scheme scheme (see section Color scheme).
- Method on
mglData(C++, Python):voidExport (const char *fname,const char *scheme,floatv1=0, float v2=0,intns=-1) const - C function:
voidmgl_data_export (HMDTdat,const char *fname,const char *scheme,floatv1, float v2,intns) const Saves data matrix (or
ns-th slice for 3d data) to bitmap file (now support only PNG format). The data values are transformed from range [v1, v2] to RGB pixels of bitmap using color scheme scheme (see section Color scheme). If v1>=v2 then the values of v1, v2 are automatically determined as minimal and maximal value of the data array.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
