Class: IngvQuake::OriginUncertainty
- Inherits:
-
Object
- Object
- IngvQuake::OriginUncertainty
- Defined in:
- lib/ingv_quake/models/origin_uncertainty.rb
Overview
The OriginUncertainty class represents the metadata related to the origin uncertainty details of an event record
Instance Attribute Summary collapse
-
#azimuth_max_horizontal_uncertainty ⇒ Integer
readonly
Azimuth of major axis of confidence ellipse.
-
#confidence_level ⇒ Integer
readonly
Confidence level of the uncertainty, given in percent.
-
#horizontal_uncertainty ⇒ Float
readonly
Circular confidence region, given by single value of horizontal uncertainty.
-
#max_horizontal_uncertainty ⇒ Integer
readonly
Semi-major axis of confidence ellipse.
-
#min_horizontal_uncertainty ⇒ Integer
readonly
Semi-minor axis of confidence ellipse.
-
#preferred_description ⇒ String
readonly
Preferred uncertainty description.
Instance Method Summary collapse
-
#initialize(data) ⇒ OriginUncertainty
constructor
Initializes a new OriginUncertainty instance with the provided data.
Constructor Details
#initialize(data) ⇒ OriginUncertainty
Initializes a new OriginUncertainty instance with the provided data.
21 22 23 24 25 26 27 28 |
# File 'lib/ingv_quake/models/origin_uncertainty.rb', line 21 def initialize(data) @preferred_description = data.fetch('preferredDescription', nil) @horizontal_uncertainty = data.fetch('horizontalUncertainty', nil)&.to_f @min_horizontal_uncertainty = data.fetch('minHorizontalUncertainty', nil)&.to_i @max_horizontal_uncertainty = data.fetch('maxHorizontalUncertainty', nil)&.to_i @azimuth_max_horizontal_uncertainty = data.fetch('azimuthMaxHorizontalUncertainty', nil)&.to_i @confidence_level = data.fetch('confidenceLevel', nil)&.to_i end |
Instance Attribute Details
#azimuth_max_horizontal_uncertainty ⇒ Integer (readonly)
Azimuth of major axis of confidence ellipse. Measured clockwise from South-North direction at epicenter. Unit: deg.
14 15 16 |
# File 'lib/ingv_quake/models/origin_uncertainty.rb', line 14 def azimuth_max_horizontal_uncertainty @azimuth_max_horizontal_uncertainty end |
#confidence_level ⇒ Integer (readonly)
Confidence level of the uncertainty, given in percent.
14 15 16 |
# File 'lib/ingv_quake/models/origin_uncertainty.rb', line 14 def confidence_level @confidence_level end |
#horizontal_uncertainty ⇒ Float (readonly)
Circular confidence region, given by single value of horizontal uncertainty. Unit: m.
14 15 16 |
# File 'lib/ingv_quake/models/origin_uncertainty.rb', line 14 def horizontal_uncertainty @horizontal_uncertainty end |
#max_horizontal_uncertainty ⇒ Integer (readonly)
Semi-major axis of confidence ellipse. Unit: m.
14 15 16 |
# File 'lib/ingv_quake/models/origin_uncertainty.rb', line 14 def max_horizontal_uncertainty @max_horizontal_uncertainty end |
#min_horizontal_uncertainty ⇒ Integer (readonly)
Semi-minor axis of confidence ellipse. Unit: m.
14 15 16 |
# File 'lib/ingv_quake/models/origin_uncertainty.rb', line 14 def min_horizontal_uncertainty @min_horizontal_uncertainty end |
#preferred_description ⇒ String (readonly)
Preferred uncertainty description. Can be one of: ‘horizontal uncertainty’, ‘uncertainty ellipse’, ‘confidence ellipsoid’.
14 15 16 |
# File 'lib/ingv_quake/models/origin_uncertainty.rb', line 14 def preferred_description @preferred_description end |