Class: VORuby::STC::V1_30::RedshiftIntervalType

Inherits:
CoordScalarIntervalType show all
Defined in:
lib/voruby/stc/1.30/stc.rb

Overview

Contains a 1-D redshift interval; position and time units are required if redshifts are expressed as Doppler velocities.

Instance Attribute Summary collapse

Attributes inherited from CoordScalarIntervalType

#hi_limit, #lo_limit

Attributes inherited from CoordIntervalType

#fill_factor, #frame_id, #hi_include, #lo_include

Attributes included from STCReference

#id, #idref, #ucd, #xlink_href, #xlink_type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CoordScalarIntervalType

coord_scalar_interval_from_xml, #initialize

Methods inherited from CoordIntervalType

coord_interval_from_xml, #hi_include?, #initialize, #lo_include?

Methods inherited from STCBaseType

#initialize, stc_base_from_xml

Methods included from STCReference

#stc_reference_eq, stc_reference_from_xml, #stc_reference_to_xml

Methods included from SerializableToXml

#element

Constructor Details

This class inherits a constructor from VORuby::STC::V1_30::CoordScalarIntervalType

Instance Attribute Details

#unitObject

Returns the value of attribute unit.



4873
4874
4875
# File 'lib/voruby/stc/1.30/stc.rb', line 4873

def unit
  @unit
end

#vel_time_unitObject

Returns the value of attribute vel_time_unit.



4873
4874
4875
# File 'lib/voruby/stc/1.30/stc.rb', line 4873

def vel_time_unit
  @vel_time_unit
end

Class Method Details

.from_xml(xml) ⇒ Object



4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
# File 'lib/voruby/stc/1.30/stc.rb', line 4906

def self.from_xml(xml)
  root = element_from(xml)
  
  lo_limit, hi_limit, lo_include, hi_include, options = CoordScalarIntervalType.coord_scalar_interval_from_xml(root)
  
  unit = root.attributes.get_attribute_ns(obj_ns.uri, 'unit')
  options[:unit] = PosUnitType.new(unit.value) if unit
  
  vel_time_unit = root.attributes.get_attribute_ns(obj_ns.uri, 'vel_time_unit')
  options[:vel_time_unit] = VelTimeUnitType.new(vel_time_unit.value) if vel_time_unit
  
  self.new(
    lo_limit,
    hi_limit,
    lo_include,
    hi_include,
    options
  )
end

Instance Method Details

#==(i) ⇒ Object



4891
4892
4893
4894
4895
# File 'lib/voruby/stc/1.30/stc.rb', line 4891

def ==(i)
  super(i) and
  self.unit == i.unit and
  self.vel_time_unit == i.vel_time_unit
end

#to_xml(name = nil) ⇒ Object



4897
4898
4899
4900
4901
4902
4903
4904
# File 'lib/voruby/stc/1.30/stc.rb', line 4897

def to_xml(name=nil)
  el = super(name)
  
  el.attributes["#{obj_ns.prefix}:unit"] = self.unit.to_s if self.unit
  el.attributes["#{obj_ns.prefix}:vel_time_unit"] = self.vel_time_unit.to_s if self.vel_time_unit
  
  el
end