Sha256: a8e4f94db24e22afb49f52ba357a46756b1c21c8d3d9fc282963baea4a02fe28

Contents?: true

Size: 909 Bytes

Versions: 8

Compression:

Stored size: 909 Bytes

Contents

EgridRegion.class_eval do
  data_miner do
    import "eGRID 2012 region 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

8 entries across 8 versions & 1 rubygems

Version Path
earth-1.2.1 lib/earth/locality/egrid_region/data_miner.rb
earth-1.1.2 lib/earth/locality/egrid_region/data_miner.rb
earth-1.1.1 lib/earth/locality/egrid_region/data_miner.rb
earth-1.1.0 lib/earth/locality/egrid_region/data_miner.rb
earth-1.0.3 lib/earth/locality/egrid_region/data_miner.rb
earth-1.0.2 lib/earth/locality/egrid_region/data_miner.rb
earth-1.0.1 lib/earth/locality/egrid_region/data_miner.rb
earth-1.0.0 lib/earth/locality/egrid_region/data_miner.rb