Class: VORuby::STC::V1_30::HealpixType
- Inherits:
-
CoordFlavorType
- Object
- CoordFlavorType
- VORuby::STC::V1_30::HealpixType
- Defined in:
- lib/voruby/stc/1.30/stc.rb
Overview
2-D Healpix coordinates; defaults for H(4) and K(3).
Direct Known Subclasses
Instance Attribute Summary collapse
-
#healpix_h ⇒ Object
Returns the value of attribute healpix_h.
-
#healpix_k ⇒ Object
Returns the value of attribute healpix_k.
Attributes inherited from CoordFlavorType
Class Method Summary collapse
Instance Method Summary collapse
- #==(h) ⇒ Object
-
#initialize(healpix_h = 4, healpix_k = 3, coord_naxes = 2) ⇒ HealpixType
constructor
A new instance of HealpixType.
- #to_xml(name = nil) ⇒ Object
Methods inherited from CoordFlavorType
Methods included from SerializableToXml
Constructor Details
#initialize(healpix_h = 4, healpix_k = 3, coord_naxes = 2) ⇒ HealpixType
Returns a new instance of HealpixType.
7482 7483 7484 7485 7486 |
# File 'lib/voruby/stc/1.30/stc.rb', line 7482 def initialize(healpix_h=4, healpix_k=3, coord_naxes=2) super(coord_naxes) self.healpix_h = healpix_h || 4 self.healpix_k = healpix_k || 3 end |
Instance Attribute Details
#healpix_h ⇒ Object
Returns the value of attribute healpix_h.
7480 7481 7482 |
# File 'lib/voruby/stc/1.30/stc.rb', line 7480 def healpix_h @healpix_h end |
#healpix_k ⇒ Object
Returns the value of attribute healpix_k.
7480 7481 7482 |
# File 'lib/voruby/stc/1.30/stc.rb', line 7480 def healpix_k @healpix_k end |
Class Method Details
.from_xml(xml) ⇒ Object
7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 |
# File 'lib/voruby/stc/1.30/stc.rb', line 7513 def self.from_xml(xml) root = element_from(xml) hh = root.attributes.get_attribute_ns(obj_ns.uri, 'healpix_H') hk = root.attributes.get_attribute_ns(obj_ns.uri, 'healpix_K') self.new( hh ? Integer(hh.value) : nil, hk ? Integer(hk.value) : nil, *CoordFlavorType.coord_flavor_from_xml(root) ) end |
Instance Method Details
#==(h) ⇒ Object
7498 7499 7500 7501 7502 |
# File 'lib/voruby/stc/1.30/stc.rb', line 7498 def ==(h) super(h) and self.healpix_h == h.healpix_h and self.healpix_k == h.healpix_k end |