las2witsml 0.1.3 → 0.1.4
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.
- checksums.yaml +4 -4
- data/bin/las2witsml +8 -2
- data/lib/las2witsml.rb +2 -2
- data/lib/las_file.rb +1 -0
- data/lib/uom.json +1450 -0
- data/lib/uom.rb +32 -0
- data/lib/witsml_file.rb +4 -167
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa4fc245989bfce59ebfbd113ae2d834e5770823
|
4
|
+
data.tar.gz: e5f278bba13a39d059bd3fffff47b64b8b8f86cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b3ee9d49069145a5da173ba8853f7813e6f3f34946973ec060d743f799c92e4ecd0b6cdeaf51f047423f09372dbb43dc2cd936a2486926db003ad73a662f171
|
7
|
+
data.tar.gz: abea5c4ebc9eb65f006fbe4f47998e68fdd56c8fd211af35d4543582c45eeabeef3c7701b406026c27f3133cbc4596921fd0ffcdd63086d202284ef3534c3a20
|
data/bin/las2witsml
CHANGED
@@ -19,11 +19,12 @@ require 'optparse'
|
|
19
19
|
require "las_file"
|
20
20
|
require "witsml_file"
|
21
21
|
require "las2witsml"
|
22
|
+
require "uom"
|
22
23
|
|
23
24
|
options = {:v=>false}
|
24
25
|
|
25
26
|
opts =OptionParser.new do |o|
|
26
|
-
o.banner = "Usage: las2witsml [-n name] [-u uid] [-b uid] [-l uid] [-x version] [-h] [-v] lasfile"
|
27
|
+
o.banner = "Usage: las2witsml [-n name] [-u uid] [-b uid] [-l uid] [-m uomfile] [-x version] [-h] [-v] lasfile"
|
27
28
|
|
28
29
|
o.on("-n", "--namelog name", "Name to give the WITSML log; default 'Untitled'") do |v|
|
29
30
|
options[:name] = v
|
@@ -41,6 +42,11 @@ opts =OptionParser.new do |o|
|
|
41
42
|
o.on("-x", "--version version", "WITSML version to emit, either 1.3.1 or 1.4.1; default 1.4.1") do |v|
|
42
43
|
options[:version] = v
|
43
44
|
end
|
45
|
+
|
46
|
+
o.on("-m", "--uomfile path", "Path to a units of measure JSON file, mapping foreign to WITSML units of measure (like default file '#{Uom::default_uom_file}')") do |v|
|
47
|
+
options[:uom_file] = v
|
48
|
+
end
|
49
|
+
|
44
50
|
o.on("-v", "--verbose", "Emit diagnostic output on stderr") do |v|
|
45
51
|
options[:v] = v
|
46
52
|
end
|
@@ -72,7 +78,7 @@ ARGV.each do|a|
|
|
72
78
|
version = 1410
|
73
79
|
end
|
74
80
|
begin
|
75
|
-
succeed = l2w.run infile, outfile, options[:uw] || "", options[:uwb] || "", options[:ul] || "", options[:name] || 'Untitled', version, options[:v] != false
|
81
|
+
succeed = l2w.run infile, outfile, options[:uw] || "", options[:uwb] || "", options[:ul] || "", options[:name] || 'Untitled', version, options[:v] != false, options[:uom_file]
|
76
82
|
succeed ? 0 : 1
|
77
83
|
rescue => e
|
78
84
|
$stderr.puts e.backtrace
|
data/lib/las2witsml.rb
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
require 'las_file'
|
3
3
|
require 'witsml_file'
|
4
4
|
class Las2Witsml
|
5
|
-
def run in_stream, out_stream, uid_well, uid_wellbore, uid_log, name_log, version = 1411, verbose=false
|
5
|
+
def run in_stream, out_stream, uid_well, uid_wellbore, uid_log, name_log, version = 1411, verbose=false, uom_file=nil
|
6
6
|
begin
|
7
7
|
|
8
8
|
las =LasFile.new in_stream
|
9
9
|
las.process verbose
|
10
10
|
$stderr.puts 'processed las file'
|
11
11
|
|
12
|
-
witsml = WitsmlFile.new out_stream, version
|
12
|
+
witsml = WitsmlFile.new out_stream, version, uom_file
|
13
13
|
$stderr.puts 'made witsmlFile' if verbose
|
14
14
|
witsml.from_las_file(las, uid_well, uid_wellbore, uid_log, name_log, verbose)
|
15
15
|
$stderr.puts 'read from lasFile' if verbose
|