Class: MathGL::MglDataA

Inherits:
Object
  • Object
show all
Defined in:
lib/mathgl/doc/libdoc_data_en.rb

Overview

MglDataA class

Instance Method Summary collapse

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.

Parameters:

  • fname (String)
  • buf (String)
  • size (long)

Returns:

  • (Integer)


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.

Parameters:

  • fname (String)
  • scheme (String)
  • v1 (Float) (defaults to: 0)

    default=0

  • v2 (Float) (defaults to: 0)

    default=0

  • ns (Integer) (defaults to: -1)

    default=-1

Returns:

  • (nil)


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).

Parameters:

  • cond (String)
  • dir (String)
  • i (Integer) (defaults to: 0)

    default=0

  • j (Integer) (defaults to: 0)

    default=0

  • k (Integer) (defaults to: 0)

    default=0

Returns:

  • (Integer)


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.

Parameters:

  • cond (String)

Returns:

  • (bool)


1394
1395
# File 'lib/mathgl/doc/libdoc_data_en.rb', line 1394

def find_any
end

#get_nxlong

Data information. Gets the x-, y-, z-size of the data.

Returns:

  • (long)


1151
1152
# File 'lib/mathgl/doc/libdoc_data_en.rb', line 1151

def get_nx
end

#get_nylong

Data information. Gets the x-, y-, z-size of the data.

Returns:

  • (long)


1160
1161
# File 'lib/mathgl/doc/libdoc_data_en.rb', line 1160

def get_ny
end

#get_nzlong

Data information. Gets the x-, y-, z-size of the data.

Returns:

  • (long)


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.

Parameters:

  • cond (String)
  • i (Integer)
  • j (Integer)
  • k (Integer)

Returns:

  • (Float)


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.

Parameters:

  • x (Float)
  • y (Float)
  • z (Float)

Returns:

  • (Float)


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.

Parameters:

  • x (Float)
  • y (Float)
  • z (Float)

Returns:

  • (Float)


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.

Overloads:

  • #momentum(dir, a, w) ⇒ Float

    Parameters:

    • dir (String)
    • a (Float)
    • w (Float)

    Returns:

    • (Float)
  • #momentum(dir, m, w, s, k) ⇒ Float

    Parameters:

    • dir (String)
    • m (Float)
    • w (Float)
    • s (Float)
    • k (Float)

    Returns:

    • (Float)


1344
1345
# File 'lib/mathgl/doc/libdoc_data_en.rb', line 1344

def momentum
end

Data information. Gets or prints to file fp or as message (in MGL) information about the data (sizes, maximum/minimum, momentums and so on).

Overloads:

  • #print_infoString

    Returns:

    • (String)
  • #print_info(fp) ⇒ nil

    Parameters:

    • fp (FILE)

    Returns:

    • (nil)


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.

Parameters:

  • fname (String)
  • ns (Integer) (defaults to: -1)

    default=-1

Returns:

  • (nil)


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.

Parameters:

  • fname (String)
  • dname (String)
  • rewrite (bool) (defaults to: false)

    default=false

Returns:

  • (nil)


1192
1193
# File 'lib/mathgl/doc/libdoc_data_en.rb', line 1192

def save_hdf
end