postgresql-unit
postgresql-unit copied to clipboard
Carbon Footprint
I was wondering if there is an easy way to add CO2e to units? Carbon Dioxide equivalence is a way to normalize different greenhouse gases..
The standard unit for measuring carbon footprints is the Carbon dioxide equivalent (CO2e), which is expressed as parts per million by volume, ppmv. The idea is to express the impact of each different greenhouse gas in terms of the amount of CO2 that would create the same amount of warming. That way, a carbon footprint consisting of lots of different greenhouse gases can be expressed as a single number.
Not quite sure how to add this concept?
Hi Dan,
I'm not familiar with that unit, but if it's a "normal" physical unit that can be expressed in SI base units, you can do this:
postgres =# insert into unit_units values ('co2equiv', 'ppm/m³');
INSERT 0 1
postgres=# select '500 co2equiv'::unit;
unit
─────────────
0.0005 m^-3
postgres =# insert into unit_units values ('methane_equiv', '84 co2equiv');
INSERT 0 1
postgres=# select 'methane_equiv'::unit;
unit
──────────────
8.4e-05 m^-3
The default list of units is imported from GNU units, so ideally these units would be added there first.
If it's more complicated than that, GNU units has the notion of functions and lookup tables, but postgresql-unit doesn't implement these yet. (Though I'm open to idea how to implement them.)
If you are still interested, please get in touch with GNU units to get the definitions added there first.
Thanks for reminding me! Let me take a look again and give it some thought…I have some upcoming discussions related to this with other users so will see what I can learn.
Dan
On Jan 6, 2023, at 10:52 AM, Christoph Berg @.***> wrote:
Closed #35 https://github.com/df7cb/postgresql-unit/issues/35 as completed.
— Reply to this email directly, view it on GitHub https://github.com/df7cb/postgresql-unit/issues/35#event-8170357705, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPCTNN3L6ENLFM2G3WJOO3WRA5TBANCNFSM57IXOGUA. You are receiving this because you authored the thread.