| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
6.5 File I/O
- MGL command: read DAT 'fname'
- Method on
mglData:boolRead (const char *fname) - Method on
mglDataC:boolRead (const char *fname) - C function:
intmgl_data_read (HMDTdat,const char *fname) - C function:
intmgl_datac_read (HADTdat,const char *fname) Reads data from tab-separated text file with auto determining sizes of the data. Double newline means the beginning of new z-slice.
- MGL command: read DAT 'fname'
mx [my=1 mz=1] - Method on
mglData:boolRead (const char *fname,intmx,intmy=1,intmz=1) - Method on
mglDataC:boolRead (const char *fname,intmx,intmy=1,intmz=1) - C function:
intmgl_data_read_dim (HMDTdat,const char *fname,intmx,intmy,intmz) - C function:
intmgl_datac_read_dim (HADTdat,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.
- MGL command: readmat DAT 'fname' [
dim=2] - Method on
mglData:boolReadMat (const char *fname,intdim=2) - Method on
mglDataC:boolReadMat (const char *fname,intdim=2) - C function:
intmgl_data_read_mat (HMDTdat,const char *fname,intdim) - C function:
intmgl_datac_read_mat (HADTdat,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.
- MGL command: readall DAT 'templ'
v1 v2 [dv=1 slice=off] - Method on
mglData:voidReadRange (const char *templ,mrealfrom,mrealto,mrealstep=1,boolas_slice=false) - Method on
mglDataC:voidReadRange (const char *templ,mrealfrom,mrealto,mrealstep=1,boolas_slice=false) - C function:
intmgl_data_read_range (HMDTdat,const char *templ,mrealfrom,mrealto,mrealstep,intas_slice) - C function:
intmgl_datac_read_range (HADTdat,const char *templ,mrealfrom,mrealto,mrealstep,intas_slice) 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.
- MGL command: readall DAT 'templ'
[slice=off] - Method on
mglData:voidReadAll (const char *templ,boolas_slice=false) - Method on
mglDataC:voidReadAll (const char *templ,boolas_slice=false) - C function:
intmgl_data_read_all (HMDTdat,const char *templ,intas_slice) - C function:
intmgl_datac_read_all (HADTdat,const char *templ,intas_slice) 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.
- MGL command: save dat 'fname'
- Method on
mglData:voidSave (const char *fname,intns=-1)const - Method on
mglDataC:voidSave (const char *fname,intns=-1)const - C function:
voidmgl_data_save (HCDTdat,const char *fname,intns) - C function:
voidmgl_datac_save (HCDTdat,const char *fname,intns) Saves the whole data array (for ns=
-1) or only ns-th slice to text file.
- MGL command: readhdf DAT 'fname' 'dname'
- Method on
mglData:voidReadHDF (const char *fname,const char *dname) - Method on
mglDataC:voidReadHDF (const char *fname,const char *dname) - C function:
voidmgl_data_read_hdf (HMDTdat,const char *fname,const char *dname) - C function:
voidmgl_datac_read_hdf (HADTdat,const char *fname,const char *dname) Reads data array named dname from HDF5 or HDF4 file. This function does nothing if HDF5|HDF4 was disabled during library compilation.
- MGL command: savehdf dat 'fname' 'dname'
- Method on
mglData:voidSaveHDF (const char *fname,const char *dname,boolrewrite=false)const - Method on
mglDataC:voidSaveHDF (const char *fname,const char *dname,boolrewrite=false)const - C function:
voidmgl_data_save_hdf (HCDTdat,const char *fname,const char *dname,intrewrite) - C function:
voidmgl_datac_save_hdf (HCDTdat,const char *fname,const char *dname,intrewrite) Saves data array named dname to HDF5 file. This function does nothing if HDF5 was disabled during library compilation.
- MGL command: datas 'fname'
- Method on
mglData:intDatasHDF (const char *fname,char *buf,longsize)static - Method on
mglDataC:intDatasHDF (const char *fname,char *buf,longsize)static - C function:
intmgl_datas_hdf (const char *fname,char *buf,longsize) Put data names from HDF5 file fname into buf as ’\t’ separated fields. In MGL version the list of data names will be printed as message. This function does nothing if HDF5 was disabled during library compilation.
- MGL command: import DAT 'fname' 'sch' [
v1=0 v2=1] - Method on
mglData:voidImport (const char *fname,const char *scheme,mrealv1=0, mreal v2=1) - C function:
voidmgl_data_import (HMDTdat,const char *fname,const char *scheme,mrealv1, mreal v2) Reads data from bitmap file (now support only PNG format). The RGB values of bitmap pixels are transformed to mreal values in range [v1, v2] using color scheme scheme (see section Color scheme).
- MGL command: export dat 'fname' 'sch' [
v1=0 v2=0] - Method on
mglData:voidExport (const char *fname,const char *scheme,mrealv1=0, mreal v2=0,intns=-1) const - C function:
voidmgl_data_export (HMDTdat,const char *fname,const char *scheme,mrealv1, mreal 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] | [ ? ] |
This document was generated on March 21, 2014 using texi2html 5.0.
