Sha256: f8e4a802af3a236335c7e41f9511ed11472582b98b38ccf376aa9aba249e257a

Contents?: true

Size: 918 Bytes

Versions: 12

Compression:

Stored size: 918 Bytes

Contents

EgridCountry.class_eval do
  data_miner do
    import "eGRID 2012 national-level data",
           :url => 'http://www.epa.gov/cleanenergy/documents/egridzips/eGRID2012V1_0_year09_DATA.xls',
           :sheet => 'GGL09',
           :skip => 4,
           :select => proc { |row| row['REGION'] == 'U.S.' } do
      key 'name',                   :field_name => 'REGION'
      store 'generation',           :field_name => 'GENERAT',  :units => :megawatt_hours
      store 'foreign_interchange',  :field_name => 'FRGNINTC', :units => :megawatt_hours
      store 'domestic_interchange', :field_name => 'INTRCHNG', :units => :megawatt_hours
      store 'consumption',          :field_name => 'CONSUMP',  :units => :megawatt_hours
    end
    
    process "Calculate loss factor" do
      update_all "loss_factor = (1.0 * generation + foreign_interchange + domestic_interchange - consumption) / generation"
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
earth-1.2.1 lib/earth/locality/egrid_country/data_miner.rb
earth-1.1.2 lib/earth/locality/egrid_country/data_miner.rb
earth-1.1.1 lib/earth/locality/egrid_country/data_miner.rb
earth-1.1.0 lib/earth/locality/egrid_country/data_miner.rb
earth-1.0.3 lib/earth/locality/egrid_country/data_miner.rb
earth-1.0.2 lib/earth/locality/egrid_country/data_miner.rb
earth-1.0.1 lib/earth/locality/egrid_country/data_miner.rb
earth-1.0.0 lib/earth/locality/egrid_country/data_miner.rb
earth-0.12.4 lib/earth/locality/egrid_country/data_miner.rb
earth-0.12.3 lib/earth/locality/egrid_country/data_miner.rb
earth-0.12.2 lib/earth/locality/egrid_country/data_miner.rb
earth-0.12.1 lib/earth/locality/egrid_country/data_miner.rb