Class: IngvQuake::OriginUncertainty

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ OriginUncertainty

Initializes a new OriginUncertainty instance with the provided data.

Parameters:

  • data (Hash)

    A hash containing detailed information about the origin uncertainty of an event.



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_uncertaintyInteger (readonly)

Azimuth of major axis of confidence ellipse. Measured clockwise from South-North direction at epicenter. Unit: deg.

Returns:

  • (Integer)

    the current value of azimuth_max_horizontal_uncertainty



14
15
16
# File 'lib/ingv_quake/models/origin_uncertainty.rb', line 14

def azimuth_max_horizontal_uncertainty
  @azimuth_max_horizontal_uncertainty
end

#confidence_levelInteger (readonly)

Confidence level of the uncertainty, given in percent.

Returns:

  • (Integer)

    the current value of confidence_level



14
15
16
# File 'lib/ingv_quake/models/origin_uncertainty.rb', line 14

def confidence_level
  @confidence_level
end

#horizontal_uncertaintyFloat (readonly)

Circular confidence region, given by single value of horizontal uncertainty. Unit: m.

Returns:

  • (Float)

    the current value of horizontal_uncertainty



14
15
16
# File 'lib/ingv_quake/models/origin_uncertainty.rb', line 14

def horizontal_uncertainty
  @horizontal_uncertainty
end

#max_horizontal_uncertaintyInteger (readonly)

Semi-major axis of confidence ellipse. Unit: m.

Returns:

  • (Integer)

    the current value of max_horizontal_uncertainty



14
15
16
# File 'lib/ingv_quake/models/origin_uncertainty.rb', line 14

def max_horizontal_uncertainty
  @max_horizontal_uncertainty
end

#min_horizontal_uncertaintyInteger (readonly)

Semi-minor axis of confidence ellipse. Unit: m.

Returns:

  • (Integer)

    the current value of min_horizontal_uncertainty



14
15
16
# File 'lib/ingv_quake/models/origin_uncertainty.rb', line 14

def min_horizontal_uncertainty
  @min_horizontal_uncertainty
end

#preferred_descriptionString (readonly)

Preferred uncertainty description. Can be one of: ‘horizontal uncertainty’, ‘uncertainty ellipse’, ‘confidence ellipsoid’.

Returns:

  • (String)

    the current value of preferred_description



14
15
16
# File 'lib/ingv_quake/models/origin_uncertainty.rb', line 14

def preferred_description
  @preferred_description
end