Sha256: 3fdb3bcab2ef5a5e01a5edf12f86bdaacf98027a121354fff56698662b6d6834

Contents?: true

Size: 1.21 KB

Versions: 9

Compression:

Stored size: 1.21 KB

Contents

EgridRegion.class_eval do
  data_miner do
    import "eGRID regions and loss factors derived from eGRID 2007 data",
           :url => 'http://www.epa.gov/cleanenergy/documents/egridzips/eGRID2007_Version1-1.zip',
           :filename => 'eGRID2007_Version1-1/eGRID2007V1_1_year0504_STIE_USGC.xls',
           :sheet => 'STIE05',
           :skip => 4,
           :select => lambda { |row| row['eGRID2007 2005 file State sequence number'].to_i.between?(1, 51) } do
      key   'name', :field_name => 'Grid region (E=Eastern grid, W=Western grid, AK=Alaska, HI=Hawaii, TX=Texas)'
      store 'loss_factor', :field_name => '2005 grid gross loss factor'
    end
    
    # resurrected from a7bb363f10d951957dd051ff3cfb81c280f61151
    import "the US average grid loss factor derived eGRID 2007 data",
           :url => 'http://www.epa.gov/cleanenergy/documents/egridzips/eGRID2007_Version1-1.zip',
           :filename => 'eGRID2007_Version1-1/eGRID2007V1_1_year0504_STIE_USGC.xls',
           :sheet => 'USGC',
           :skip => 5 do
      key 'name', :static => 'US'
      store 'loss_factor', :synthesize => lambda { |row| (row['USTNGN05'].to_f + row['USTNFI05'].to_f - row['USTCON05'].to_f) / row['USTNGN05'].to_f }
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
earth-0.11.0 lib/earth/locality/egrid_region/data_miner.rb
earth-0.7.0 lib/earth/locality/egrid_region/data_miner.rb
earth-0.6.6 lib/earth/locality/egrid_region/data_miner.rb
earth-0.6.5 lib/earth/locality/egrid_region/data_miner.rb
earth-0.6.4 lib/earth/locality/egrid_region/data_miner.rb
earth-0.6.3 lib/earth/locality/egrid_region/data_miner.rb
earth-0.6.2 lib/earth/locality/egrid_region/data_miner.rb
earth-0.6.1 lib/earth/locality/egrid_region/data_miner.rb
earth-0.6.0 lib/earth/locality/egrid_region/data_miner.rb