Class: MetaData::VisMetaData
- Inherits:
-
RubyUtils::MetaData
- Object
- RubyUtils::MetaData
- MetaData::VisMetaData
- Defined in:
- lib/data/meta_data.rb
Overview
class to store the meta information of a data series
Instance Attribute Summary collapse
-
#domain_x ⇒ DataDomain
readonly
Informations of the x-dimension.
-
#domain_y ⇒ DataDomain
readonly
Informations of the y-dimension.
-
#domain_z ⇒ DataDomain
readonly
Informations of the y-dimension.
-
#name ⇒ String
readonly
The name of the data.
Instance Method Summary collapse
-
#check_and_create_third_domain(metadata) ⇒ Object
private
method to check if the meta data array contains information for a third dimension and read these data if available.
-
#check_element_size(size) ⇒ Object
private
method to check the correct number of parameters for the meta data.
-
#parse_header(header_line) ⇒ Object
private
method which parses the required meta information from the head line relevant meta information.
Instance Attribute Details
#domain_x ⇒ DataDomain (readonly)
Returns informations of the x-dimension.
20 21 22 |
# File 'lib/data/meta_data.rb', line 20 def domain_x @domain_x end |
#domain_y ⇒ DataDomain (readonly)
Returns informations of the y-dimension.
22 23 24 |
# File 'lib/data/meta_data.rb', line 22 def domain_y @domain_y end |
#domain_z ⇒ DataDomain (readonly)
Returns informations of the y-dimension.
24 25 26 |
# File 'lib/data/meta_data.rb', line 24 def domain_z @domain_z end |
#name ⇒ String (readonly)
Returns the name of the data.
18 19 20 |
# File 'lib/data/meta_data.rb', line 18 def name @name end |
Instance Method Details
#check_and_create_third_domain(metadata) ⇒ Object (private)
method to check if the meta data array contains information for a third dimension and read these data if available
58 59 60 61 62 63 64 65 |
# File 'lib/data/meta_data.rb', line 58 def check_and_create_third_domain() if (.length == 13) @domain_z = DataDomain.new([9], [10], \ [11], [12]) else @domain_z = nil end end |
#check_element_size(size) ⇒ Object (private)
method to check the correct number of parameters for the meta data
48 49 50 51 52 53 |
# File 'lib/data/meta_data.rb', line 48 def check_element_size(size) if !(size == 13 || size == 9) raise IndexError, " Error in meta data: incorrect number of" \ " arguments: #{size}.".red end end |
#parse_header(header_line) ⇒ Object (private)
method which parses the required meta information from the head line relevant meta information
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/data/meta_data.rb', line 32 def parse_header(header_line) check_element_size(header_line.length) @name = header_line[0] @domain_x = DataDomain.new(header_line[1], header_line[2], \ header_line[3], header_line[4]) @domain_y = DataDomain.new(header_line[5], header_line[6], \ header_line[7], header_line[8]) check_and_create_third_domain(header_line) end |