Class: VORuby::STC::V1_30::AstroSTCDescriptionType

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

Defined Under Namespace

Classes: AstroCoordAreaList

Instance Attribute Summary

Attributes inherited from STCDescriptionType

#coord_areas, #coord_sys, #coords

Attributes included from STCReference

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from STCDescriptionType

#==, #initialize, stc_description_from_xml, #to_xml

Methods inherited from STCMetadataType

stc_metadata_from_xml

Methods inherited from STCBaseType

#==, #initialize, stc_base_from_xml, #to_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::STCDescriptionType

Class Method Details

.from_xml(xml) ⇒ Object



8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
# File 'lib/voruby/stc/1.30/stc.rb', line 8241

def self.from_xml(xml)
  root = element_from(xml)
  
  css, cs, cas, options = STCDescriptionType.stc_description_from_xml(root)
  
  coord_sys = xml_to_obj(root, AstroCoordSystem)
  coord_sys = nil if coord_sys.size == 0
  
  coords = xml_to_obj(root, AstroCoords)
  coords = nil if coords.size == 0
  
  coord_areas = xml_to_obj(root, AstroCoordArea)
  coord_areas = nil if coord_areas.size == 0
  
  self.new(
    coord_sys ? AstroCoordSystemList.new(coord_sys) : nil,
    coords ? AstroCoordsList.new(coords) : nil,
    coord_areas ? AstroCoordAreaList.new(coord_areas) : nil,
    options || {}
  )
end

Instance Method Details

#coord_areas=(cas) ⇒ Object

The coverage area of the data; the fill factor does not need to be 1.0.



8233
8234
8235
8236
8237
8238
8239
# File 'lib/voruby/stc/1.30/stc.rb', line 8233

def coord_areas=(cas)
  if cas
    cas = AstroCoordAreaList.new(cas) if cas.class == Array
    raise_type_mismatch_error(cas, AstroCoordAreaList)
  end
  @coord_areas = cas
end

#coord_sys=(cs) ⇒ Object

The coordinate system definition: spatial coordinate frame and reference position; time frame and reference position; the coordinate flavor; and the planetary ephemeris; an ID is required, since this is how coordinate elements are associated with their coordinate systems.



8214
8215
8216
8217
8218
8219
8220
# File 'lib/voruby/stc/1.30/stc.rb', line 8214

def coord_sys=(cs)
  if cs
    cs = AstroCoordSystemList.new(cs) if cs.class == Array
    raise_type_mismatch_error(cs, AstroCoordSystemList)
  end
  @coord_sys = cs
end

#coords=(cs) ⇒ Object

AstroCoords contains information on time and spatial locations, resolution, errors, and pixelsizes (if fixed); typical best numbers are expected.



8224
8225
8226
8227
8228
8229
8230
# File 'lib/voruby/stc/1.30/stc.rb', line 8224

def coords=(cs)
  if cs
    cs = AstroCoordsList.new(cs) if cs.class == Array
    raise_type_mismatch_error(cs, AstroCoordsList)
  end
  @coords = cs
end