Class: VORuby::VOTable::V1_0::Coosys

Inherits:
Base show all
Defined in:
lib/voruby/votable/1.0/votable.rb

Overview

A celestial coordinate system, to which the components of a position on the celestial sphere refer.

Constant Summary collapse

ELEMENT_NAME =
'COOSYS'

Instance Attribute Summary

Attributes inherited from XML::Object::Base

#node

Instance Method Summary collapse

Methods inherited from Base

#==, element_name, #get_element, #xpath_for

Methods inherited from XML::Object::Base

#==, element_name, from_file, #to_s

Constructor Details

#initialize(defn = nil) ⇒ Coosys

Create a new coordinate system.

coosys = Coosys.new(
  :id => 'J2000',
  :equinox => 'J2000.',
  :epoch => 'J2000.',
  :system => 'eq_FK5'
)

The default system is eq_FK5.



241
242
243
244
# File 'lib/voruby/votable/1.0/votable.rb', line 241

def initialize(defn=nil)
  super(defn)
  self.system = 'eq_FK5' if !self.system
end

Instance Method Details

#epochObject



262
263
264
# File 'lib/voruby/votable/1.0/votable.rb', line 262

def epoch
  self.node['epoch']
end

#epoch=(e) ⇒ Object



266
267
268
# File 'lib/voruby/votable/1.0/votable.rb', line 266

def epoch=(e)
  @node['epoch'] = e.to_s
end

#equinoxObject



254
255
256
# File 'lib/voruby/votable/1.0/votable.rb', line 254

def equinox
  self.node['equinox']
end

#equinox=(e) ⇒ Object



258
259
260
# File 'lib/voruby/votable/1.0/votable.rb', line 258

def equinox=(e)
  @node['equinox'] = e.to_s
end

#idObject



246
247
248
# File 'lib/voruby/votable/1.0/votable.rb', line 246

def id
  self.node['ID']
end

#id=(i) ⇒ Object



250
251
252
# File 'lib/voruby/votable/1.0/votable.rb', line 250

def id=(i)
  @node['ID'] = i.to_s
end

#systemObject



270
271
272
# File 'lib/voruby/votable/1.0/votable.rb', line 270

def system
  self.node['system']
end

#system=(s) ⇒ Object

Set the system. May be one of: eq_FK4, eq_FK5, ICRS, ecl_FK4, ecl_FK5, galactic, supergalactic, xy, barycentric or geo_app.



278
279
280
# File 'lib/voruby/votable/1.0/votable.rb', line 278

def system=(s)
  @node['system'] = s.to_s
end