las_reader 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -5,3 +5,4 @@ require 'rspec/core/rake_task'
5
5
  RSpec::Core::RakeTask.new('spec')
6
6
 
7
7
  task :default => :spec
8
+ task :test => :spec
data/las_reader.gemspec CHANGED
@@ -10,8 +10,6 @@ Gem::Specification.new do |gem|
10
10
  gem.email = ["gpcarmo@gmail.com"]
11
11
  gem.description = %q{A simple gem to read CWLS-LAS file format. File in this format will contain well log data in ASCII format}
12
12
 
13
- gem.add_development_dependency "rspec"
14
-
15
13
  gem.summary = %q{Read CWLS LAS files}
16
14
  gem.homepage = "https://github.com/gpcarmo/cwls-las-reader"
17
15
 
@@ -19,4 +17,7 @@ Gem::Specification.new do |gem|
19
17
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
20
18
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
21
19
  gem.require_paths = ["lib"]
20
+
21
+ gem.add_development_dependency "rspec"
22
+
22
23
  end
data/lib/las_reader.rb CHANGED
@@ -42,92 +42,92 @@ module LasReader
42
42
 
43
43
  def set_well_info(info)
44
44
 
45
- strt = info.match(/(STRT)\.(\w).+\s([0-9]+\.[0-9]+).*:\s*(.*)/)
45
+ strt = info.match(/(STRT)\s*\.(\w).+\s([0-9]+\.[0-9]+).*:\s*(.*)/)
46
46
  unless strt.nil?
47
47
  @well_info.start_depth = strt[3].to_f
48
48
  @well_info.depth_unit = strt[2]
49
49
  return
50
50
  end
51
51
 
52
- stop = info.match(/(STOP)\.(\w).+\s([0-9]+\.[0-9]+).*:\s*(.*)/)
52
+ stop = info.match(/(STOP)\s*\.(\w).+\s([0-9]+\.[0-9]+).*:\s*(.*)/)
53
53
  unless stop.nil?
54
54
  @well_info.stop_depth = stop[3].to_f
55
55
  return
56
56
  end
57
57
 
58
- step = info.match(/(STEP)\.(\w).+\s(-?[0-9]+\.[0-9]+).*:\s*(.*)/)
58
+ step = info.match(/(STEP)\s*\.(\w).+\s(-?[0-9]+\.[0-9]+).*:\s*(.*)/)
59
59
  unless step.nil?
60
60
  @well_info.step = step[3].to_f
61
61
  return
62
62
  end
63
63
 
64
- null = info.match(/(NULL)\..+\s(-?[0-9]+\.[0-9]+).*:\s*(.*)/)
64
+ null = info.match(/(NULL)\s*\..+\s(-?[0-9]+\.[0-9]+).*:\s*(.*)/)
65
65
  unless null.nil?
66
66
  @well_info.null_value = null[2].to_f
67
67
  return
68
68
  end
69
69
 
70
- comp = info.match(/(COMP\..+COMPANY:\s*(.*))|(COMP\s*\.\s*(.*)\s+:COMPANY)/)
70
+ comp = info.match(/(COMP\s*\..+COMPANY:\s*(.*))|(COMP\s*\.\s*(.*)\s+:COMPANY)/)
71
71
  unless comp.nil?
72
72
  @well_info.company_name = (comp[2] or comp[4]).strip
73
73
  return
74
74
  end
75
75
 
76
- well = info.match(/(WELL\..+WELL:\s*(.*))|(WELL\s*\.\s*(.*)\s+:WELL)/)
76
+ well = info.match(/(WELL\s*\..+WELL:\s*(.*))|(WELL\s*\.\s*(.*)\s+:WELL)/)
77
77
  unless well.nil?
78
78
  @well_info.well_name = (well[2] or well[4]).strip
79
79
  return
80
80
  end
81
81
 
82
- fld = info.match(/(FLD \..+FIELD:\s*(.*))|(FLD\s*\.\s*(.*)\s+:FIELD)/)
82
+ fld = info.match(/(FLD\s*\..+FIELD:\s*(.*))|(FLD\s*\.\s*(.*)\s+:FIELD)/)
83
83
  unless fld.nil?
84
84
  @well_info.field_name = (fld[2] or fld[4]).strip
85
85
  return
86
86
  end
87
87
 
88
- loc = info.match(/(LOC \..+LOCATION:\s*(.*))|(LOC\s*\.\s*(.*)\s+:LOCATION)/)
88
+ loc = info.match(/(LOC\s*\..+LOCATION:\s*(.*))|(LOC\s*\.\s*(.*)\s+:LOCATION)/)
89
89
  unless loc.nil?
90
90
  @well_info.location = (loc[2] or loc[4]).strip
91
91
  return
92
92
  end
93
93
 
94
- prov = info.match(/(PROV\..+PROVINCE:\s*(.*))|(PROV\s*\.\s*(.*)\s+:PROVINCE)/)
94
+ prov = info.match(/(PROV\s*\..+PROVINCE:\s*(.*))|(PROV\s*\.\s*(.*)\s+:PROVINCE)/)
95
95
  unless prov.nil?
96
96
  @well_info.province = (prov[2] or prov[4]).strip
97
97
  return
98
98
  end
99
99
 
100
- cnty = info.match(/(CNTY\..+COUNTY:\s*(.*))|(CNTY\s*\.\s*(.*)\s+:COUNTY)/)
100
+ cnty = info.match(/(CNTY\s*\..+COUNTY:\s*(.*))|(CNTY\s*\.\s*(.*)\s+:COUNTY)/)
101
101
  unless cnty.nil?
102
102
  @well_info.county = (cnty[2] or cnty[4]).strip
103
103
  return
104
104
  end
105
105
 
106
- stat = info.match(/(STAT\..+STATE:\s*(.*))|(STAT\s*\.\s*(.*)\s+:STATE)/)
106
+ stat = info.match(/(STAT\s*\..+STATE:\s*(.*))|(STAT\s*\.\s*(.*)\s+:STATE)/)
107
107
  unless stat.nil?
108
108
  @well_info.state = (stat[2] or stat[4]).strip
109
109
  return
110
110
  end
111
111
 
112
- ctry = info.match(/(CTRY\..+COUNTRY:\s*(.*))|(CTRY\s*\.\s*(.*)\s+:COUNTRY)/)
112
+ ctry = info.match(/(CTRY\s*\..+COUNTRY:\s*(.*))|(CTRY\s*\.\s*(.*)\s+:COUNTRY)/)
113
113
  unless ctry.nil?
114
114
  @well_info.country = (ctry[2] or ctry[4]).strip
115
115
  return
116
116
  end
117
117
 
118
- srvc = info.match(/(SRVC\..+SERVICE COMPANY:\s*(.*))|(SRVC\s*\.\s*(.*)\s+:SERVICE COMPANY)/)
118
+ srvc = info.match(/(SRVC\s*\..+SERVICE COMPANY:\s*(.*))|(SRVC\s*\.\s*(.*)\s+:SERVICE COMPANY)/)
119
119
  unless srvc.nil?
120
120
  @well_info.service_company = (srvc[2] or srvc[4]).strip
121
121
  return
122
122
  end
123
123
 
124
- data = info.match(/(DATE\..+LOG DATE:\s*(.*))|(DATE\s*\.\s*(.*)\s+:LOG DATE)/)
124
+ data = info.match(/(DATE\s*\..+LOG DATE:\s*(.*))|(DATE\s*\.\s*(.*)\s+:LOG DATE)/)
125
125
  unless data.nil?
126
126
  @well_info.date_logged = (data[2] or data[4]).strip
127
127
  return
128
128
  end
129
129
 
130
- uwi = info.match(/(UWI \..+UNIQUE WELL ID:\s*(.*))|(UWI\s*\.\s*(.*)\s+:UNIQUE WELL ID)/)
130
+ uwi = info.match(/(UWI\s*\..+UNIQUE WELL ID:\s*(.*))|(UWI\s*\.\s*(.*)\s+:UNIQUE WELL ID)/)
131
131
  unless uwi.nil?
132
132
  @well_info.uwi = (uwi[2] or uwi[4]).strip
133
133
  return
@@ -170,15 +170,6 @@ module LasReader
170
170
 
171
171
  read_state = 0
172
172
 
173
- #section_definition = {
174
- # 'V' => "Version and wrap mode information",
175
- # 'W' => "well identification",
176
- # 'C' => "curve information",
177
- # 'P' => "parameters or constants",
178
- # 'O' => "other information such as comments",
179
- # 'A' => "ASCII log data"
180
- #}
181
-
182
173
  unless File.exist?(file_name)
183
174
  raise "No such file or directory"
184
175
  end
@@ -188,9 +179,6 @@ module LasReader
188
179
  next if line[0].chr == '#'
189
180
  # The '~' is used to inform the beginning of a section
190
181
  if line[0].chr == '~'
191
- # unless section_definition.keys.include? line[1].chr
192
- # raise "unsupported_file_format for #{line}"
193
- # end
194
182
  case line[1].chr
195
183
  when 'V' # Version information section
196
184
  read_state = 1
@@ -1,3 +1,3 @@
1
1
  module LasReader
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -91,7 +91,7 @@ describe "CWLS LAS reader" do
91
91
  context "get DT curve from wrap_mode with nil values from LAS v2.0 file 'example23.las'" do
92
92
  c = [nil, nil, nil, nil, nil]
93
93
  las = CWLSLas.new
94
- las.load_file(file_path+'/example3.las')
94
+ las.load_file(file_path+'/example23.las')
95
95
  it { expect(las.curve('DT').log_data).to eq(c) }
96
96
  end
97
97
  end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: las_reader
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
4
+ hash: 25
5
+ prerelease:
5
6
  segments:
6
7
  - 0
7
8
  - 0
8
- - 2
9
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
10
11
  platform: ruby
11
12
  authors:
12
13
  - Gilberto P. Carmo Jr.
@@ -14,8 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2013-01-08 00:00:00 -02:00
18
- default_executable:
18
+ date: 2013-01-08 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rspec
@@ -25,6 +25,7 @@ dependencies:
25
25
  requirements:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
+ hash: 3
28
29
  segments:
29
30
  - 0
30
31
  version: "0"
@@ -63,7 +64,6 @@ files:
63
64
  - spec/fixtures/files/example3.las
64
65
  - spec/las_reader_spec.rb
65
66
  - spec/spec_helper.rb
66
- has_rdoc: true
67
67
  homepage: https://github.com/gpcarmo/cwls-las-reader
68
68
  licenses: []
69
69
 
@@ -77,6 +77,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
77
77
  requirements:
78
78
  - - ">="
79
79
  - !ruby/object:Gem::Version
80
+ hash: 3
80
81
  segments:
81
82
  - 0
82
83
  version: "0"
@@ -85,13 +86,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
86
  requirements:
86
87
  - - ">="
87
88
  - !ruby/object:Gem::Version
89
+ hash: 3
88
90
  segments:
89
91
  - 0
90
92
  version: "0"
91
93
  requirements: []
92
94
 
93
95
  rubyforge_project:
94
- rubygems_version: 1.3.7.1
96
+ rubygems_version: 1.8.24
95
97
  signing_key:
96
98
  specification_version: 3
97
99
  summary: Read CWLS LAS files