Skip to content

Instantly share code, notes, and snippets.

View aquilesC's full-sized avatar

Aquiles Carattino aquilesC

View GitHub Profile
<a href="https://www.aquicarattino.com/other-en/reinvent-the-wheel-and-make-it-elon-musk-style/">Elon Musk</a> did a great job selling the idea that electric cars are the indisputable future. However, in the time of alternative realities, it is always wise to verify some of the facts that are given for granted. It is true that an electric car does not emit gases while in circulation, but the generation of electricity needed for moving as well as the fabrication of the batteries must be taken into account.
There are two numbers that can be calculated for any product: the emissions generated during the use and the emissions generated since the start of the fabrication process. During use, I've found a magical number quoted in several sources, a diesel car would emit around <code><code>120g CO2/km</code></code>[1]. For an electric car, the consumption is around <code>0.2kWh/km</code>, while in Europe the emissions for generating electricity are around <code>300gCO2/kWh</code>. With this values, it can be calcul
import h5py
filename = 'test.hdf5'
f = h5py.File(filename,'a')
g = f.create_group('BigArray')
dset = g.create_dataset('timelapse', (1000,1000, 1000), compression='gzip')
for i in range(1000):
for j in range(1000):
dset[i,j,0] = 1
f.flush()
@aquilesC
aquilesC / pm_write.py
Last active August 29, 2015 14:19
pm_write
import serial
inst = serial.Serial('COM1',baudrate=9600, timeout=1)
inst.write('W532\n')
@aquilesC
aquilesC / simple_powermeter.py
Last active August 29, 2015 14:19
simple_powermeter
import serial
inst = serial.Serial('COM1', baudrate=9600, bytesize=8, timeout=1)
inst.write('O\n')