Class: IngvQuake::Origin
- Inherits:
-
Object
- Object
- IngvQuake::Origin
- Defined in:
- lib/ingv_quake/models/origin.rb
Overview
This class represents the focal time and geographical location of an earthquake hypocenter, as well as additional meta-information
Instance Attribute Summary collapse
-
#creation_info ⇒ CreationInfo
readonly
The creation info of the origin.
-
#depth ⇒ Integer
readonly
Depth of hypocenter with respect to the nominal sea level given by the WGS84 geoid.
-
#depth_type ⇒ String
readonly
Type of depth determination.
-
#earth_model_id ⇒ String
readonly
Identifies the earth model used in methodID.
-
#evaluation_mode ⇒ String
readonly
Evaluation mode of Origin.
-
#evaluation_status ⇒ String
readonly
The evaluation status of the origin.
-
#latitude ⇒ Float
readonly
Hypocenter latitude, with respect to the WGS84 reference system.
-
#longitude ⇒ Float
readonly
Hypocenter longitude, with respect to the WGS84 reference system.
-
#method_id ⇒ String
readonly
The method ID of the origin.
-
#origin_uncertainty ⇒ OriginUncertainty
readonly
The origin uncertainty of the origin.
-
#public_id ⇒ String
readonly
The public ID of the origin.
-
#quality ⇒ Quality
readonly
The quality of the origin.
-
#time ⇒ String
readonly
Focal date and time.
-
#type ⇒ String
readonly
Describes the Origin type.
-
#uncertainty ⇒ Integer
readonly
The depth uncertainty of the origin.
Instance Method Summary collapse
-
#initialize(data) ⇒ Origin
constructor
Initializes a new Origin instance with the provided data.
Constructor Details
#initialize(data) ⇒ Origin
Initializes a new Origin instance with the provided data.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/ingv_quake/models/origin.rb', line 34 def initialize(data) @evaluation_mode = data.fetch('evaluationMode', nil) @type = data.fetch('type', nil) @time = data.dig('time', 'value') @latitude = data.dig('latitude', 'value')&.to_f @longitude = data.dig('longitude', 'value')&.to_f @depth = data.dig('depth', 'value')&.to_i @uncertainty = data.dig('depth', 'uncertainty')&.to_i @depth_type = data.fetch('depthType', nil) @origin_uncertainty = data.fetch('originUncertainty', nil)&.then { |origin_uncertainty_data| OriginUncertainty.new(origin_uncertainty_data) } @quality = data.fetch('quality', nil)&.then { |quality_data| Quality.new(quality_data) } @evaluation_status = data.fetch('evaluationStatus', nil) @method_id = data.fetch('methodID', nil) @earth_model_id = data.fetch('earthModelID', nil) @creation_info = data.fetch('creationInfo', nil)&.then { |creation_info_data| CreationInfo.new(creation_info_data) } @public_id = data.fetch('publicID', nil) end |
Instance Attribute Details
#creation_info ⇒ CreationInfo (readonly)
The creation info of the origin.
27 28 29 |
# File 'lib/ingv_quake/models/origin.rb', line 27 def creation_info @creation_info end |
#depth ⇒ Integer (readonly)
Depth of hypocenter with respect to the nominal sea level given by the WGS84 geoid. Unit: m
27 28 29 |
# File 'lib/ingv_quake/models/origin.rb', line 27 def depth @depth end |
#depth_type ⇒ String (readonly)
Type of depth determination. Can be on of: <b>‘from location’, ‘from moment tensor inversion’, ‘from from modeling of broad-band P waveforms’, ‘constrained by depth phases’, ‘constrained by direct phases’, ‘constrained by depth and direct phases’,
'operator assigned', 'other'</b>.
27 28 29 |
# File 'lib/ingv_quake/models/origin.rb', line 27 def depth_type @depth_type end |
#earth_model_id ⇒ String (readonly)
Identifies the earth model used in methodID.
27 28 29 |
# File 'lib/ingv_quake/models/origin.rb', line 27 def earth_model_id @earth_model_id end |
#evaluation_mode ⇒ String (readonly)
Evaluation mode of Origin. Can be on of: ‘manual’ or ‘automated’.
27 28 29 |
# File 'lib/ingv_quake/models/origin.rb', line 27 def evaluation_mode @evaluation_mode end |
#evaluation_status ⇒ String (readonly)
The evaluation status of the origin. Can be one of: ‘preliminary’, ‘confirmed’, ‘reviewed’, ‘final’, ‘rejected’.
27 28 29 |
# File 'lib/ingv_quake/models/origin.rb', line 27 def evaluation_status @evaluation_status end |
#latitude ⇒ Float (readonly)
Hypocenter latitude, with respect to the WGS84 reference system. Unit: deg
27 28 29 |
# File 'lib/ingv_quake/models/origin.rb', line 27 def latitude @latitude end |
#longitude ⇒ Float (readonly)
Hypocenter longitude, with respect to the WGS84 reference system. Unit: deg
27 28 29 |
# File 'lib/ingv_quake/models/origin.rb', line 27 def longitude @longitude end |
#method_id ⇒ String (readonly)
The method ID of the origin. Identifies the method used for locating the event.
27 28 29 |
# File 'lib/ingv_quake/models/origin.rb', line 27 def method_id @method_id end |
#origin_uncertainty ⇒ OriginUncertainty (readonly)
The origin uncertainty of the origin.
27 28 29 |
# File 'lib/ingv_quake/models/origin.rb', line 27 def origin_uncertainty @origin_uncertainty end |
#public_id ⇒ String (readonly)
The public ID of the origin.
27 28 29 |
# File 'lib/ingv_quake/models/origin.rb', line 27 def public_id @public_id end |
#quality ⇒ Quality (readonly)
The quality of the origin.
27 28 29 |
# File 'lib/ingv_quake/models/origin.rb', line 27 def quality @quality end |
#time ⇒ String (readonly)
Focal date and time.
27 28 29 |
# File 'lib/ingv_quake/models/origin.rb', line 27 def time @time end |
#type ⇒ String (readonly)
Describes the Origin type. Can be on of: ‘hypocenter’, ‘centroid’, ‘amplitude’, ‘macroseismic’, ‘rupture start’, ‘rupture end’.
27 28 29 |
# File 'lib/ingv_quake/models/origin.rb', line 27 def type @type end |
#uncertainty ⇒ Integer (readonly)
The depth uncertainty of the origin. Unit: m
27 28 29 |
# File 'lib/ingv_quake/models/origin.rb', line 27 def uncertainty @uncertainty end |