Class: LasFile

Inherits:
Object
  • Object
show all
Defined in:
lib/las_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(io) ⇒ LasFile

Returns a new instance of LasFile.



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/las_file.rb', line 22

def initialize(io)
  @log_curve_infos = []
  @curve_values = []
  @in = io
  @next_line=nil

  @measured_depth_unit =nil
  @start_measured_depth_index=nil
  @stop_measured_depth_index=nil
  @start_date_time_index=nil
  @stop_date_time_index=nil
  @null_value=nil
  @service_company=nil
  @curve_values=nil
  @elevation_kelly_bushing=nil
  @log_measured_from=nil
  @permanent_datum=nil
  @above_permanent_datum=nil
  @elevation_permanent_datum = nil
  

end

Instance Attribute Details

#above_permanent_datumObject (readonly)

Returns the value of attribute above_permanent_datum.



14
15
16
# File 'lib/las_file.rb', line 14

def above_permanent_datum
  @above_permanent_datum
end

#curve_valuesObject (readonly)

Returns the value of attribute curve_values.



14
15
16
# File 'lib/las_file.rb', line 14

def curve_values
  @curve_values
end

#elevation_kelly_bushingObject (readonly)

Returns the value of attribute elevation_kelly_bushing.



14
15
16
# File 'lib/las_file.rb', line 14

def elevation_kelly_bushing
  @elevation_kelly_bushing
end

#elevation_permanent_datumObject (readonly)

Returns the value of attribute elevation_permanent_datum.



14
15
16
# File 'lib/las_file.rb', line 14

def elevation_permanent_datum
  @elevation_permanent_datum
end

#log_curve_infosObject (readonly)

Returns the value of attribute log_curve_infos.



14
15
16
# File 'lib/las_file.rb', line 14

def log_curve_infos
  @log_curve_infos
end

#log_measured_fromObject (readonly)

Returns the value of attribute log_measured_from.



14
15
16
# File 'lib/las_file.rb', line 14

def log_measured_from
  @log_measured_from
end

#measured_depth_unitObject (readonly)

Returns the value of attribute measured_depth_unit.



14
15
16
# File 'lib/las_file.rb', line 14

def measured_depth_unit
  @measured_depth_unit
end

#null_valueObject (readonly)

Returns the value of attribute null_value.



14
15
16
# File 'lib/las_file.rb', line 14

def null_value
  @null_value
end

#permanent_datumObject (readonly)

Returns the value of attribute permanent_datum.



14
15
16
# File 'lib/las_file.rb', line 14

def permanent_datum
  @permanent_datum
end

#service_companyObject (readonly)

Returns the value of attribute service_company.



14
15
16
# File 'lib/las_file.rb', line 14

def service_company
  @service_company
end

#start_date_time_indexObject (readonly)

Returns the value of attribute start_date_time_index.



14
15
16
# File 'lib/las_file.rb', line 14

def start_date_time_index
  @start_date_time_index
end

#start_measured_depth_indexObject (readonly)

Returns the value of attribute start_measured_depth_index.



14
15
16
# File 'lib/las_file.rb', line 14

def start_measured_depth_index
  @start_measured_depth_index
end

#stop_date_time_indexObject (readonly)

Returns the value of attribute stop_date_time_index.



14
15
16
# File 'lib/las_file.rb', line 14

def stop_date_time_index
  @stop_date_time_index
end

#stop_measured_depth_indexObject (readonly)

Returns the value of attribute stop_measured_depth_index.



14
15
16
# File 'lib/las_file.rb', line 14

def stop_measured_depth_index
  @stop_measured_depth_index
end

Instance Method Details

#each_data_line(verbose = false) ⇒ Object

each_data_line is an optimization so we don’t have to store 8 million or so ruby objects in memory (uses up 1.6GB).



52
53
54
55
56
57
58
59
60
# File 'lib/las_file.rb', line 52

def each_data_line verbose=false
  lines_processed = 0
  while line = next_line
    yield(line.split)
    lines_processed = lines_processed + 1
    $stderr.puts "processed #{lines_processed} lines" if (verbose && lines_processed % 1000 == 0 )
  end
  
end

#process(verbose = false) ⇒ Object



45
46
47
# File 'lib/las_file.rb', line 45

def process verbose=false
  while block(verbose); end
end