Data Automobile type fuels

Automobile type fuel

Last imported 09:57AM UTC on Tuesday, March 26, 2013. See log

Automobiles by type and fuel (e.g. Passenger cars diesel).

We derive annual distance and emissions factors from our automobile type fuel year data. We derive number of vehicles and fuel consumption from our automobile activity year type fuel data.

Citing this data

To cite this data, reference Brighter Planet, "Automobile type fuels," <http://data.brighterplanet.com/automobile_type_fuels>, retrieved 2013-05-20 04:34:42 UTC.

Download

Total: 4 records.

Random data sample

Sample: 4 records.

name type name fuel family annual distance annual distance units fuel consumption fuel consumption units ch4 emission factor ch4 emission factor units n2o emission factor n2o emission factor units vehicles
Light-duty trucks diesel Light-duty trucks diesel 23440.3 kilometres 4470570000.0 litres 1.52969e-05 kilograms_co2e_per_kilometre 0.000274923 kilograms_co2e_per_kilometre 3075840.0
Light-duty trucks gasoline Light-duty trucks gasoline 19626.6 kilometres 129881000000.0 litres 0.000507492 kilograms_co2e_per_kilometre 0.00748644 kilograms_co2e_per_kilometre 87877200.0
Passenger cars diesel Passenger cars diesel 17939.5 kilometres 1340040000.0 litres 7.76714e-06 kilograms_co2e_per_kilometre 0.000185169 kilograms_co2e_per_kilometre 708704.0
Passenger cars gasoline Passenger cars gasoline 16429.7 kilometres 325617000000.0 litres 0.000380097 kilograms_co2e_per_kilometre 0.00476413 kilograms_co2e_per_kilometre 158792000.0

Import steps

Click a step for more detail.

  1. Ensure AutomobileTypeFuelYear is populated

    AutomobileTypeFuelYear.run_data_miner!
    
  2. Derive from AutomobileTypeFuelYear

    ::Earth::Utils.insert_ignore(:src => (AutomobileTypeFuelYear), :dest => (AutomobileTypeFuel), :cols => ({ [:type_name, :fuel_family] => :name, :type_name => :type_name, :fuel_family => :fuel_family }))
    
  3. Derive annual distance and emission factors from AutomobileTypeFuelYear

    type_fuels = arel_table
    type_fuel_years = AutomobileTypeFuelYear.arel_table
    join_relation = type_fuel_years[:type_name].eq(type_fuels[:type_name]).and(type_fuel_years[:fuel_family].eq(type_fuels[:fuel_family]))
    ["annual_distance", "ch4_emission_factor", "n2o_emission_factor"].each do |item|
      item_sql = AutomobileTypeFuelYear.where(join_relation).weighted_average_relation("#{item}", :weighted_by => :share_of_type).to_sql
      item_units = AutomobileTypeFuelYear.first.send("#{item}_units")
      update_all(" #{item} = (#{item_sql}), #{item}_units = '#{item_units}' ")
    end
    
  4. Ensure AutomobileActivityYearTypeFuel is populated

    AutomobileActivityYearTypeFuel.run_data_miner!
    
  5. Derive number of vehicles and fuel consumption from AutomobileActivityYearTypeFuel

    safe_find_each do |atf|
      atf.update_attributes!(:vehicles => ((atf.latest_activity_year_type_fuel.distance / atf.annual_distance)), :fuel_consumption => (atf.latest_activity_year_type_fuel.fuel_consumption), :fuel_consumption_units => (atf.latest_activity_year_type_fuel.fuel_consumption_units))
    end
    

Table structure

CREATE TABLE automobile_type_fuels
  (
     name                      CHARACTER VARYING(255) NOT NULL PRIMARY KEY,
     type_name                 CHARACTER VARYING(255),
     fuel_family               CHARACTER VARYING(255),
     annual_distance           FLOAT,
     annual_distance_units     CHARACTER VARYING(255),
     fuel_consumption          FLOAT,
     fuel_consumption_units    CHARACTER VARYING(255),
     ch4_emission_factor       FLOAT,
     ch4_emission_factor_units CHARACTER VARYING(255),
     n2o_emission_factor       FLOAT,
     n2o_emission_factor_units CHARACTER VARYING(255),
     vehicles                  FLOAT
  );