aleip / eealocatorplots Goto Github PK
View Code? Open in Web Editor NEWEU-GIRP (EU-Greenhouse gas Inventory Reporting Plots): R program to generate plots from EEA-locator CRF data
License: GNU General Public License v2.0
EU-GIRP (EU-Greenhouse gas Inventory Reporting Plots): R program to generate plots from EEA-locator CRF data
License: GNU General Public License v2.0
See e.g. https://r-pkgs.org/whole-game.html
Add a section about non-key categories
make sure all EU's are EU-KP in the text.
This needs to be better explained, maybe the calculation made more transparent. The target value it NOT 1, but a value > 1, as otherwise some losses have not been considered. It can be <= 1 if bedding is considered.
In step 6 there Key source categories are loaded and flags calculated (to make ticking in the EMRT easier). However, this uses old code and - what is more risky - loads also old files.
The whole part needs to be carefully checked and updated, both in content and programming.
It is disactivated with logicals 'dokeycategories' and 'doaddflags'.
Also we need to see if the outlier files that are generated need all these fields or if it would be more user friendly to reduce the fields (then, they don't have to be calculated).
hi gema, thanks! i think you are right - this formulae is not correct - needs to be corrected.
From: CARMONA GARCIA Gema (JRC-ISPRA)
Sent: 05 December 2018 16:01
To: LEIP Adrian (JRC-ISPRA)
Subject: CAPRI - Inventory comparison
Hi Adrian,
I am checking a bit how things are calculated in CAPRI for comparison with the inventory data. For emissions from MMS, I think there is a problem with the equations in CAPRI_in_NIR_format.gms (folder 'gams\comparisonplots'). When allocating manure to the MMS, we have:
**Calculation of N excretion per MMS (in kt N/year)
caprinv_allagri2(party,variableUID,InvYears_) $ [UID_TO_ALLTYPE(variableUID,"Liquid") ] = SUM((RALL,MPACT) $ [MAP_IPCC_TO_RALL(party,RALL) and UID_TO_MPACT(variableUID,MPACT) and UID_TO_ALLTYPE(variableUID,"Liquid")] , DATA2(RALL,MPACT,"MANN",InvYears_) * DATA2(RALL,MPACT,"LEVL",InvYears_) * p_nemiDAT_time2(RALL,MPACT,"N","TypeShare","Liquid",InvYears_) * 0.001) ;
caprinv_allagri2(party,variableUID,InvYears_) $ [UID_TO_ALLTYPE(variableUID,"Solid") ] = SUM((RALL,MPACT) $ [MAP_IPCC_TO_RALL(party,RALL) and UID_TO_MPACT(variableUID,MPACT) and UID_TO_ALLTYPE(variableUID,"Solid")] , DATA2(RALL,MPACT,"MANN",InvYears_) * DATA2(RALL,MPACT,"LEVL",InvYears_) * p_nemiDAT_time2(RALL,MPACT,"N","TypeShare","Solid",InvYears_) * 0.001) ;
caprinv_allagri2(party,variableUID,InvYears_) $ [UID_TO_ALLTYPE(variableUID,"GRAZ") ] = SUM((RALL,MPACT) $ [MAP_IPCC_TO_RALL(party,RALL) and UID_TO_MPACT(variableUID,MPACT) and UID_TO_ALLTYPE(variableUID,"GRAZ")] , DATA2(RALL,MPACT,"MANN",InvYears_) * DATA2(RALL,MPACT,"LEVL",InvYears_) * p_nemiDAT_time2(RALL,MPACT,"N","TypeShare","GRAZ",InvYears_) * 0.001) ;
As far as I understand, this considers that Typeshare solid+liquid+grazing= 1. If this is right, it is not correct, because in CAPREG (ammo) we have Typeshare housing + grazing = 1, and housing contains liquid + solid (therefore liquid + solid = 1, they are expressed as a fraction of what is excreted other than on pastures).
Could you please have a look when you have some time and see if I am mistaken?
Thanks,
Gema
Section 5.2 Emission trends contained the following sentence:
Only emissions from follow the opposite trend, contributing to compensate the emission decrease but with a very low impact (% of agriculture total trend
Check if the IPCC default ranges are all correct - and correct if necessary!
Check:
alldata$sector_number<-unlist(lapply(c(1:nrow(alldata)),function(x) gsub("Other \\(please specify\\)","",alldata$sector_number[x])))
alldata$category<-unlist(lapply(c(1:nrow(alldata)),function(x) gsub("livestock","Livestock",alldata$category[x])))
alldata$sector_number<-unlist(lapply(c(1:nrow(alldata)),function(x) gsub(alldata$category[x],"",alldata$sector_number[x])))
This file calculates the average values for animal types and items that are weighted (by population) .
It is called several times, once for 'swine' and 'sheep', once for 'Dairy Cattle' and 'Non-Dairy Cattle', and once for 'Cattle' (aggregating dairy and non-dairy).
The file loops of meastypes, gases, sources etc. in a quite intransparent way.
Lines 27ff the function simpifytestmatrix works only with data.frames. Currently called
allmethods<-simplifytestmatrix(as.data.frame(allmethods),"year",years2keep)
allinfos<-simplifytestmatrix(as.data.frame(allinfos),"year",years2keep)
allnotations<-simplifytestmatrix(as.data.frame(allnotations),"year",years2keep)
Table3.B(a)s2 data are not complete yet (MCF and CLIMA) - needs to be filled!
Table not well formatted.
This is calculated in Step 4 'Calculating trends and growth rates'.
It uses the agrishares versus Total emissions without LULUCF and applied a maxshare.
However, there are a few questions to be solved, such for what years should it be calculated? Is it suffficient that a category is PSI or does it matter how large the under or overestimation is? I.e if a source category is huge but the potential over/underestimation is very small, then it is not PSI - this should be included in the calculation.
Currently disactivated with 'dontdoforthemoment'.
Requires thinking not only at this point, but also when writing out the individual issues.
This function in file eugirp_funnirplots.r prepares the data for one plot.
It is coded to work with different datasources for comparison plots, and value or ief plots, calculating ranges etc.
The coding is very intransparent with little documentation and likely contains a lot of code that is not required (any more) or is done in a complicated way. It has been adapted to work with data.table for ADEM but not yet for other modes and not for multiple data sources.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.