las_reader 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,36 @@
1
+ #EXAMPLE # 4 LAS FILE FOR TIME BASED DATA
2
+ ~VERSION INFORMATION
3
+ VERS. 2.0 : CWLS LOG ASCII STANDARD -VERSION 2.0
4
+ WRAP. NO : ONE LINE PER TIME STEP
5
+ #
6
+ ~WELL INFORMATION
7
+ STRT .S 0.0000 :START TIME
8
+ STOP .S 39.9000 :STOP TIME
9
+ STEP .S 0.3000 :STEP
10
+ NULL . -999.25 :NULL VALUE
11
+ COMP . ANY OIL COMPANY INC. :COMPANY
12
+ WELL . ANY ET 12-34-12-34 :WELL
13
+ FLD . WILDCAT :FIELD
14
+ LOC . 12-34-12-34W5 :LOCATION
15
+ PROV . ALBERTA :PROVINCE
16
+ SRVC . ANY LOGGING COMPANY INC. :SERVICE COMPANY
17
+ DATE . 13-DEC-86 :LOG DATE
18
+ UWI . 100123401234W500 :UNIQUE WELL ID
19
+ #
20
+ ~CURVE INFORMATION
21
+ ETIM .S : 1 ELAPSED TIME
22
+ BFR1 .OHMM : 2 SINGLE PROBE 1 RESISTIVITY
23
+ BSG1 .PSIG : 3 SINGLE PROBE 1 STRAIN GAUGE PRESSURE
24
+ #
25
+ ~PARAMETER INFORMATION
26
+ MRT .DEGC 67.0 : BOTTOM HOLE TEMPERATURE
27
+ GDEPT .M 3456.5 : GAUGE DEPTH
28
+ DFD .KG/M3 1000.0 : MUD WEIGHT
29
+ #
30
+ ~A
31
+ 0.0000 0.2125 16564.1445
32
+ 0.3000 0.2125 16564.1445
33
+ 0.6000 0.2125 16564.2421
34
+ 0.9000 0.2125 16564.0434
35
+ 1.2000 0.2125 16564.0430
36
+ 1.5000 0.2125 16564.0435
@@ -0,0 +1,91 @@
1
+ #EXAMPLE #3 - ILLUSTRATING THE WRAPPED VERSION
2
+ # OF THE LOG ASCII STANDARD
3
+ ~Version Information
4
+ VERS. 1.20: CWLS log ASCII Standard -VERSION 1.20
5
+ WRAP. YES: Multiple lines per depth step
6
+ ~Well Information
7
+ #MNEM.UNIT Data Type Information
8
+ #--------- ------------- ------------------------------
9
+ STRT.M 910.000:
10
+ STOP.M 901.000:
11
+ STEP.M -0.1250:
12
+ NULL. -999.2500: Null value
13
+ COMP. COMPANY: ANY OIL COMPANY INC.
14
+ WELL. WELL: ANY ET AL XX-XX-XX-XX
15
+ FLD . FIELD: WILDCAT
16
+ LOC . LOCATION: XX-XX-XX-XXW3M
17
+ PROV. PROVINCE: SASKATCHEWAN
18
+ SRVC. SERVICE COMPANY: ANY LOGGING COMPANY INC.
19
+ SON . SERVICE ORDER #: 142085
20
+ DATE. LOG DATE: 13-DEC-86
21
+ UWI . UNIQUE WELL ID:
22
+ ~Curve Information
23
+ #MNEM.UNIT API CODE Curve Description
24
+ #--------- ------------- ------------------------------
25
+ DEPT.M : Depth
26
+ DT .US/M : 1 Sonic Travel Time
27
+ RHOB.K/M : 2 Density-Bulk Density
28
+ NPHI.V/V : 3 Porosity -Neutron
29
+ RX0 .OHMM : 4 Resistivity -Rxo
30
+ RESS.OHMM : 5 Resistivity -Shallow
31
+ RESM.OHMM : 6 Resistivity -Medium
32
+ RESD.OHMM : 7 Resistivity -Deep
33
+ SP .MV : 8 Spon. Potential
34
+ GR .GAPI : 9 Gamma Ray
35
+ CALI.MM : 10 Caliper
36
+ DRHO.K/M3 : 11 Delta-Rho
37
+ EATT.DBM : 12 EPT Attenuation
38
+ TPL .NS/M : 13 TP -EPT
39
+ PEF . : 14 PhotoElectric Factor
40
+ FFI .V/V : 15 Porosity -NML FFI
41
+ DCAL.MM : 16 Caliper-Differential
42
+ RHGF.K/M3 : 17 Density-Formation
43
+ RHGA.K/M3 : 18 Density-Apparent
44
+ SPBL.MV : 19 Baselined SP
45
+ GRC .GAPI : 20 Gamma Ray BHC
46
+ PHIA.V/V : 21 Porosity -Apparent
47
+ PHID.V/V : 22 Porosity -Density
48
+ PHIE.V/V : 23 Porosity -Effective
49
+ PHIN.V/V : 24 Porosity -Neut BHC
50
+ PHIC.V/V : 25 Porosity -Total HCC
51
+ R0 .OHMM : 26 Ro
52
+ RWA .OHMM : 27 Rfa
53
+ SW . : 28 Sw -Effective
54
+ MSI . : 29 Sh Idx -Min
55
+ BVW . : 30 BVW
56
+ FGAS. : 31 Flag -Gas Index
57
+ PIDX. : 32 Prod Idx
58
+ FBH . : 33 Flag -Bad Hole
59
+ FHCC. : 34 Flag -HC Correction
60
+ LSWB. : 35 Flag -Limit SWB
61
+ ~A Log data section
62
+ 910.000000
63
+ -999.2500 2692.7075 0.3140 19.4086 19.4086 13.1709 12.2681
64
+ -1.5010 96.5306 204.7177 30.5822 -999.2500 -999.2500 3.2515
65
+ -999.2500 4.7177 3025.0264 3025.0264 -1.5010 93.1378 0.1641
66
+ 0.0101 0.1641 0.3140 0.1641 11.1397 0.3304 0.9529
67
+ 0.0000 0.1564 0.0000 11.1397 0.0000 0.0000 0.0000
68
+ 909.875000
69
+ -999.2500 2712.6460 0.2886 23.3987 23.3987 13.6129 12.4744
70
+ -1.4720 90.2803 203.1093 18.7566 -999.2500 -999.2500 3.7058
71
+ -999.2500 3.1093 3004.6050 3004.6050 -1.4720 86.9078 0.1456
72
+ -0.0015 0.1456 0.2886 0.1456 14.1428 0.2646 1.0000
73
+ 0.0000 0.1456 0.0000 14.1428 0.0000 0.0000 0.0000
74
+ 909.750000
75
+ -999.2500 2692.8137 0.2730 22.5909 22.5909 13.6821 12.6146
76
+ -1.4804 89.8492 201.9287 3.1551 -999.2500 -999.2500 4.3124
77
+ -999.2500 1.9287 2976.4451 2976.4451 -1.4804 86.3465 0.1435
78
+ 0.0101 0.1435 0.2730 0.1435 14.5674 0.2598 1.0000
79
+ 0.0000 0.1435 0.0000 14.5674 0.0000 0.0000 0.0000
80
+ 909.625000
81
+ -999.2500 2644.3650 0.2765 18.4831 18.4831 13.4159 12.6900
82
+ -1.5010 93.3999 201.5826 -6.5861 -999.2500 -999.2500 4.3822
83
+ -999.2500 1.5826 2955.3528 2955.3528 -1.5010 89.7142 0.1590
84
+ 0.0384 0.1590 0.2765 0.1590 11.8600 0.3210 0.9667
85
+ 0.0000 0.1538 0.0000 11.8600 0.0000 0.0000 0.0000
86
+ 909.500000
87
+ -999.2500 2586.2822 0.2996 13.9187 13.9187 12.9195 12.7016
88
+ -1.4916 98.1214 201.7126 -4.5574 -999.2500 -999.2500 3.5967
89
+ -999.2500 1.7126 2953.5940 2953.5940 -1.4916 94.2670 0.1880
90
+ 0.0723 0.1880 0.2996 0.1880 8.4863 0.4490 0.8174
91
+ 0.0000 0.1537 0.0000 8.4863 0.0000 0.0000 0.0000
@@ -0,0 +1,219 @@
1
+ require 'spec_helper'
2
+
3
+ describe "CWLS LAS reader" do
4
+
5
+ file_path = File.expand_path(File.dirname(__FILE__) + '/fixtures/files/')
6
+
7
+ describe CWLSLas, "#load_file" do
8
+ context "when loading a file that does not exist" do
9
+ las = CWLSLas.new
10
+ it { expect { las.load_file('whatever.las') }.to raise_error("No such file or directory") }
11
+ end
12
+
13
+ context "when loading a LAS file version other then 1.2 or 2.0" do
14
+ las = CWLSLas.new
15
+ it { expect { las.load_file(file_path+'/LAS_30a_Revised_2010.las') }.to raise_error("LAS version not supported") }
16
+ end
17
+
18
+ # LAS v1.2
19
+ context "when loading LAS v1.2 file: 'example1.las'" do
20
+ las = CWLSLas.new
21
+ las.load_file(file_path+'/example1.las')
22
+ it { las.should be_true }
23
+ end
24
+ context "when loading LAS v1.2 file: 'example2.las'" do
25
+ las = CWLSLas.new
26
+ las.load_file(file_path+'/example2.las')
27
+ it { las.should be_true }
28
+ end
29
+ context "when loading LAS v1.2 file: 'example3.las'" do
30
+ las = CWLSLas.new
31
+ las.load_file(file_path+'/example3.las')
32
+ it { las.should be_true }
33
+ end
34
+
35
+ # LAS v2.0
36
+ context "when loading LAS v2.0 file: 'example21.las'" do
37
+ las = CWLSLas.new
38
+ las.load_file(file_path+'/example21.las')
39
+ it { las.should be_true }
40
+ end
41
+ context "when loading LAS v2.0 file: 'example22.las'" do
42
+ las = CWLSLas.new
43
+ las.load_file(file_path+'/example22.las')
44
+ it { las.should be_true }
45
+ end
46
+ context "when loading LAS v2.0 file: 'example23.las'" do
47
+ las = CWLSLas.new
48
+ las.load_file(file_path+'/example23.las')
49
+ it { las.should be_true }
50
+ end
51
+
52
+ end
53
+
54
+ describe CWLSLas, "#curve_names" do
55
+ context "number of curves in file example1.las" do
56
+ las = CWLSLas.new
57
+ las.load_file(file_path+'/example1.las')
58
+ it { las.curve_names.size.should == 8 }
59
+ end
60
+ context "number of curves in file example2.las" do
61
+ las = CWLSLas.new
62
+ las.load_file(file_path+'/example2.las')
63
+ it { las.curve_names.size.should == 8 }
64
+ end
65
+ context "number of curves in file example3.las" do
66
+ las = CWLSLas.new
67
+ las.load_file(file_path+'/example3.las')
68
+ it { las.curve_names.size.should == 36 }
69
+ end
70
+ end
71
+
72
+ describe CWLSLas, "#curve" do
73
+ context "get depth curve from no_wrap mode LAS v1.2 file 'example1.las'" do
74
+ c = [1670.0, 1669.875 , 1669.750]
75
+ las = CWLSLas.new
76
+ las.load_file(file_path+'/example1.las')
77
+ it { expect(las.curve('DEPT').log_data).to eq(c) }
78
+ end
79
+ context "get depth curve from wrap_mode LAS v1.2 file 'example3.las'" do
80
+ c = [910.0, 909.875, 909.75, 909.625, 909.5]
81
+ las = CWLSLas.new
82
+ las.load_file(file_path+'/example3.las')
83
+ it { expect(las.curve('DEPT').log_data).to eq(c) }
84
+ end
85
+ context "get DT curve from wrap_mode with nil values from LAS v1.2 file 'example3.las'" do
86
+ c = [nil, nil, nil, nil, nil]
87
+ las = CWLSLas.new
88
+ las.load_file(file_path+'/example3.las')
89
+ it { expect(las.curve('DT').log_data).to eq(c) }
90
+ end
91
+ context "get DT curve from wrap_mode with nil values from LAS v2.0 file 'example23.las'" do
92
+ c = [nil, nil, nil, nil, nil]
93
+ las = CWLSLas.new
94
+ las.load_file(file_path+'/example3.las')
95
+ it { expect(las.curve('DT').log_data).to eq(c) }
96
+ end
97
+ end
98
+
99
+ describe CWLSLas, "#well_name" do
100
+ context "get well name from las v1.2 file 'example1.las'" do
101
+ well_name = "ANY ET AL OIL WELL #12"
102
+ las = CWLSLas.new
103
+ las.load_file(file_path+'/example1.las')
104
+ it { expect(las.well_name).to eq(well_name) }
105
+ end
106
+ context "get well name from las v2.0 file 'example21.las'" do
107
+ well_name = "ANY ET AL 12-34-12-34"
108
+ las = CWLSLas.new
109
+ las.load_file(file_path+'/example21.las')
110
+ it { expect(las.well_name).to eq(well_name) }
111
+ end
112
+ end
113
+
114
+ describe CWLSLas, "#company_name" do
115
+ context "get company name from las v1.2 file 'example1.las'" do
116
+ company_name = "ANY OIL COMPANY LTD."
117
+ las = CWLSLas.new
118
+ las.load_file(file_path+'/example1.las')
119
+ it { expect(las.company_name).to eq(company_name) }
120
+ end
121
+ context "get company name from las v2.0 file 'example21.las'" do
122
+ company_name = "ANY OIL COMPANY INC."
123
+ las = CWLSLas.new
124
+ las.load_file(file_path+'/example21.las')
125
+ it { expect(las.company_name).to eq(company_name) }
126
+ end
127
+ end
128
+
129
+ describe CWLSLas, "#field_name" do
130
+ context "get company name from las v1.2 file 'example1.las'" do
131
+ field_name = "EDAM"
132
+ las = CWLSLas.new
133
+ las.load_file(file_path+'/example1.las')
134
+ it { expect(las.field_name).to eq(field_name) }
135
+ end
136
+ context "get company name from las v2.0 file 'example21.las'" do
137
+ field_name = "WILDCAT"
138
+ las = CWLSLas.new
139
+ las.load_file(file_path+'/example21.las')
140
+ it { expect(las.field_name).to eq(field_name) }
141
+ end
142
+ end
143
+
144
+ describe CWLSLas, "#location" do
145
+ context "get location from las v1.2 file 'example1.las'" do
146
+ location = "A9-16-49-20W3M"
147
+ las = CWLSLas.new
148
+ las.load_file(file_path+'/example1.las')
149
+ it { expect(las.location).to eq(location) }
150
+ end
151
+ context "get location from las v2.0 file 'example21.las'" do
152
+ location = "12-34-12-34W5M"
153
+ las = CWLSLas.new
154
+ las.load_file(file_path+'/example21.las')
155
+ it { expect(las.location).to eq(location) }
156
+ end
157
+ end
158
+
159
+ describe CWLSLas, "#province" do
160
+ context "get province from las v1.2 file 'example1.las'" do
161
+ province = "SASKATCHEWAN"
162
+ las = CWLSLas.new
163
+ las.load_file(file_path+'/example1.las')
164
+ it { expect(las.province).to eq(province) }
165
+ end
166
+ context "get province from las v2.0 file 'example21.las'" do
167
+ province = "ALBERTA"
168
+ las = CWLSLas.new
169
+ las.load_file(file_path+'/example21.las')
170
+ it { expect(las.province).to eq(province) }
171
+ end
172
+ end
173
+
174
+ describe CWLSLas, "#service_company" do
175
+ context "get service company from las v1.2 file 'example1.las'" do
176
+ service_company = "ANY LOGGING COMPANY LTD."
177
+ las = CWLSLas.new
178
+ las.load_file(file_path+'/example1.las')
179
+ it { expect(las.service_company).to eq(service_company) }
180
+ end
181
+ context "get service company from las v2.0 file 'example21.las'" do
182
+ service_company = "ANY LOGGING COMPANY INC."
183
+ las = CWLSLas.new
184
+ las.load_file(file_path+'/example21.las')
185
+ it { expect(las.service_company).to eq(service_company) }
186
+ end
187
+ end
188
+
189
+ describe CWLSLas, "#log_date" do
190
+ context "get log date from las v1.2 file 'example1.las'" do
191
+ log_date = "25-DEC-1988"
192
+ las = CWLSLas.new
193
+ las.load_file(file_path+'/example1.las')
194
+ it { expect(las.log_date).to eq(log_date) }
195
+ end
196
+ context "get log date from las v2.0 file 'example21.las'" do
197
+ log_date = "13-DEC-86"
198
+ las = CWLSLas.new
199
+ las.load_file(file_path+'/example21.las')
200
+ it { expect(las.log_date).to eq(log_date) }
201
+ end
202
+ end
203
+
204
+ describe CWLSLas, "#uwi" do
205
+ context "get unique well id from las v1.2 file 'example1.las'" do
206
+ uwi = "100091604920W300"
207
+ las = CWLSLas.new
208
+ las.load_file(file_path+'/example1.las')
209
+ it { expect(las.uwi).to eq(uwi) }
210
+ end
211
+ context "get unique well id from las v2.0 file 'example21.las'" do
212
+ uwi = "100123401234W500"
213
+ las = CWLSLas.new
214
+ las.load_file(file_path+'/example21.las')
215
+ it { expect(las.uwi).to eq(uwi) }
216
+ end
217
+ end
218
+
219
+ end
@@ -0,0 +1,8 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ require 'las_reader' # and any other gems you need
5
+
6
+ RSpec.configure do |config|
7
+ # some (optional) config here
8
+ end
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: las_reader
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
5
- prerelease:
4
+ prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 0
9
- - 1
10
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
11
10
  platform: ruby
12
11
  authors:
13
12
  - Gilberto P. Carmo Jr.
@@ -15,7 +14,8 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2013-01-04 00:00:00 Z
17
+ date: 2013-01-08 00:00:00 -02:00
18
+ default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rspec
@@ -25,7 +25,6 @@ dependencies:
25
25
  requirements:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
- hash: 3
29
28
  segments:
30
29
  - 0
31
30
  version: "0"
@@ -40,8 +39,31 @@ extensions: []
40
39
 
41
40
  extra_rdoc_files: []
42
41
 
43
- files: []
44
-
42
+ files:
43
+ - .gitignore
44
+ - .rspec
45
+ - Gemfile
46
+ - LICENSE.txt
47
+ - README.md
48
+ - Rakefile
49
+ - las_reader.gemspec
50
+ - lib/las_reader.rb
51
+ - lib/las_reader/curve.rb
52
+ - lib/las_reader/curve_info.rb
53
+ - lib/las_reader/mnemonic.rb
54
+ - lib/las_reader/version.rb
55
+ - lib/las_reader/well_info.rb
56
+ - spec/fixtures/files/LAS_30a_Revised_2010.las
57
+ - spec/fixtures/files/example1.las
58
+ - spec/fixtures/files/example2.las
59
+ - spec/fixtures/files/example21.las
60
+ - spec/fixtures/files/example22.las
61
+ - spec/fixtures/files/example23.las
62
+ - spec/fixtures/files/example24.las
63
+ - spec/fixtures/files/example3.las
64
+ - spec/las_reader_spec.rb
65
+ - spec/spec_helper.rb
66
+ has_rdoc: true
45
67
  homepage: https://github.com/gpcarmo/cwls-las-reader
46
68
  licenses: []
47
69
 
@@ -55,7 +77,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
55
77
  requirements:
56
78
  - - ">="
57
79
  - !ruby/object:Gem::Version
58
- hash: 3
59
80
  segments:
60
81
  - 0
61
82
  version: "0"
@@ -64,16 +85,24 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
85
  requirements:
65
86
  - - ">="
66
87
  - !ruby/object:Gem::Version
67
- hash: 3
68
88
  segments:
69
89
  - 0
70
90
  version: "0"
71
91
  requirements: []
72
92
 
73
93
  rubyforge_project:
74
- rubygems_version: 1.8.24
94
+ rubygems_version: 1.3.7.1
75
95
  signing_key:
76
96
  specification_version: 3
77
97
  summary: Read CWLS LAS files
78
- test_files: []
79
-
98
+ test_files:
99
+ - spec/fixtures/files/LAS_30a_Revised_2010.las
100
+ - spec/fixtures/files/example1.las
101
+ - spec/fixtures/files/example2.las
102
+ - spec/fixtures/files/example21.las
103
+ - spec/fixtures/files/example22.las
104
+ - spec/fixtures/files/example23.las
105
+ - spec/fixtures/files/example24.las
106
+ - spec/fixtures/files/example3.las
107
+ - spec/las_reader_spec.rb
108
+ - spec/spec_helper.rb