Class: Hdf5::H5Datatype
Overview
Object for wrapping an HD5 datatype, which contains information about the type and makeup of an individual element of the dataset, which may be a float or integer, or may be a vast compound type
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #h5_class ⇒ Object
-
#initialize(id) ⇒ H5Datatype
constructor
A new instance of H5Datatype.
-
#is_complex? ⇒ Boolean
We assume that a compound datatype with two floating point members is a complex number.
-
#member_types ⇒ Object
An array of datatypes of the members of a compound datatype.
-
#nmembers ⇒ Object
The number of members in a compound datatype.
Constructor Details
#initialize(id) ⇒ H5Datatype
Returns a new instance of H5Datatype.
305 306 307 |
# File 'lib/hdf5.rb', line 305 def initialize(id) @id = id end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
304 305 306 |
# File 'lib/hdf5.rb', line 304 def id @id end |
Instance Method Details
#h5_class ⇒ Object
308 309 310 |
# File 'lib/hdf5.rb', line 308 def h5_class basic_get_class(@id) end |
#is_complex? ⇒ Boolean
We assume that a compound datatype with two floating point members is a complex number. This may want to be revisisted…
317 318 319 |
# File 'lib/hdf5.rb', line 317 def is_complex? nmembers == 2 and member_types.map{|t| t.h5_class} == [:h5t_float, :h5t_float] end |
#member_types ⇒ Object
An array of datatypes of the members of a compound datatype
321 322 323 |
# File 'lib/hdf5.rb', line 321 def member_types nmembers.times.map{|i| self.class.new(basic_get_member_type(@id, i))} end |
#nmembers ⇒ Object
The number of members in a compound datatype
312 313 314 |
# File 'lib/hdf5.rb', line 312 def nmembers basic_get_nmembers(@id) end |