Class: MathGL::MglDataA
- Inherits:
-
Object
- Object
- MathGL::MglDataA
- Defined in:
- lib/mathgl/doc/libdoc_data_en.rb
Overview
MglDataA class
Instance Method Summary collapse
-
#datas_hdf(fname, buf, size) ⇒ Integer
File I/O.
-
#export(fname, scheme, v1 = 0, v2 = 0, ns = -1) ⇒ nil
File I/O.
-
#find(cond, dir, i = 0, j = 0, k = 0) ⇒ Integer
Data information.
-
#find_any(cond) ⇒ bool
Data information.
-
#get_nx ⇒ long
Data information.
-
#get_ny ⇒ long
Data information.
-
#get_nz ⇒ long
Data information.
-
#last(cond, i, j, k) ⇒ Float
Data information.
-
#maximal(x, y, z) ⇒ Float
Data information.
-
#minimal(x, y, z) ⇒ Float
Data information.
-
#momentum ⇒ Object
Data information.
-
#print_info ⇒ Object
Data information.
-
#save(fname, ns = -1) ⇒ nil
File I/O.
-
#save_hdf(fname, dname, rewrite = false) ⇒ nil
File I/O.
Instance Method Details
#datas_hdf(fname, buf, size) ⇒ Integer
File I/O. 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.
1204 1205 |
# File 'lib/mathgl/doc/libdoc_data_en.rb', line 1204 def datas_hdf end |
#export(fname, scheme, v1 = 0, v2 = 0, ns = -1) ⇒ nil
File I/O. 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 (Color scheme). If v1>=v2 then the values of v1, v2 are automatically determined as minimal and maximal value of the data array.
1218 1219 |
# File 'lib/mathgl/doc/libdoc_data_en.rb', line 1218 def export end |
#find(cond, dir, i = 0, j = 0, k = 0) ⇒ Integer
Data information. Return position of first in direction dir nonzero value of formula cond. The search is started from point (i,j,k).
1357 1358 |
# File 'lib/mathgl/doc/libdoc_data_en.rb', line 1357 def find end |
#find_any(cond) ⇒ bool
Data information. Determines if any nonzero value of formula in the data array.
1394 1395 |
# File 'lib/mathgl/doc/libdoc_data_en.rb', line 1394 def find_any end |
#get_nx ⇒ long
Data information. Gets the x-, y-, z-size of the data.
1151 1152 |
# File 'lib/mathgl/doc/libdoc_data_en.rb', line 1151 def get_nx end |
#get_ny ⇒ long
Data information. Gets the x-, y-, z-size of the data.
1160 1161 |
# File 'lib/mathgl/doc/libdoc_data_en.rb', line 1160 def get_ny end |
#get_nz ⇒ long
Data information. Gets the x-, y-, z-size of the data.
1169 1170 |
# File 'lib/mathgl/doc/libdoc_data_en.rb', line 1169 def get_nz end |
#last(cond, i, j, k) ⇒ Float
Data information. Find position (before specified in i, j, k) of last nonzero value of formula cond. Function return the data value at found position.
1370 1371 |
# File 'lib/mathgl/doc/libdoc_data_en.rb', line 1370 def last end |
#maximal(x, y, z) ⇒ Float
Data information. Gets approximated (interpolated) position of maximum to variables x, y, z and returns the maximal value.
1267 1268 |
# File 'lib/mathgl/doc/libdoc_data_en.rb', line 1267 def maximal end |
#minimal(x, y, z) ⇒ Float
Data information. Gets approximated (interpolated) position of minimum to variables x, y, z and returns the minimal value.
1276 1277 |
# File 'lib/mathgl/doc/libdoc_data_en.rb', line 1276 def minimal end |
#momentum(dir, a, w) ⇒ Float #momentum(dir, m, w, s, k) ⇒ Float
Data information. Gets zero-momentum (energy, I=sum dat_i) and write first momentum (median, a = sum xi_i dat_i/I), second momentum (width, w^2 = sum (xi_i-a)^2 dat_i/I), third momentum (skewness, s = sum (xi_i-a)^3 dat_i/ I w^3) and fourth momentum (kurtosis, k = sum (xi_i-a)^4 dat_i / 3 I w^4) to variables. Here xi is corresponding coordinate if dir is ”x”, ”y” or ”z”. Otherwise median is a = sum dat_i/N, width is w^2 = sum (dat_i-a)^2/N and so on.
1344 1345 |
# File 'lib/mathgl/doc/libdoc_data_en.rb', line 1344 def momentum end |
#print_info ⇒ String #print_info(fp) ⇒ nil
Data information. Gets or prints to file fp or as message (in MGL) information about the data (sizes, maximum/minimum, momentums and so on).
1231 1232 |
# File 'lib/mathgl/doc/libdoc_data_en.rb', line 1231 def print_info end |
#save(fname, ns = -1) ⇒ nil
File I/O. Saves the whole data array (for ns=-1) or only ns-th slice to text file.
1180 1181 |
# File 'lib/mathgl/doc/libdoc_data_en.rb', line 1180 def save end |
#save_hdf(fname, dname, rewrite = false) ⇒ nil
File I/O. Saves data array named dname to HDF5 file. This function does nothing if HDF5 was disabled during library compilation.
1192 1193 |
# File 'lib/mathgl/doc/libdoc_data_en.rb', line 1192 def save_hdf end |