Closed Gutschlhofer closed 5 years ago
ad "add livestock products that were cut off before but can now be added":
Added for allocation 1 and 2013, crashed because of memory allocation problem on our RStudio -> restarted for 2012:2008, which means that allocation 2 2013 is still missing
also now failed after allocation 2, 2011, so allocation 2 2010-2008 are also missing!
2010-2008 done. Deleted 2013-livestock, re-ran to add all and to have more precision for the old data that was only multiplied by 1000.
This of course also needs to be done for the EXIO-hybrid IO-Leontief.
I now deleted 2013 livestock for EXIO with
DELETE FROM "input-output_leontief" WHERE year = 2013 AND from_product BETWEEN 97 AND 110 AND to_region >= 193;
and am now inserting the new numbers for 2013. As for the other years I will probably also do the exact same thing if it does not take too long and then repeat for FABIO IO-L, too. Otherwise I would just go for filtering all values < 0.01 (that would have been omitted before), multiply them by 1000 and then keep the ones > 0.01, what I did for FABIO 2012 and below.
Updated 2013 (took approx. 40 minutes * 2 allocations) and I now deleted all EXIO IO-L livestock before 2013 and will add the new livestock data.
DELETE FROM "input-output_leontief" WHERE year < 2013 AND from_product BETWEEN 97 AND 110 AND to_region >= 193;
I also need to divide by 1000 in the IO-L for each livestock to_product
For data already in the database I do the following:
UPDATE "input-output_leontief"
SET amount = amount / 1000
WHERE to_product IN (SELECT id FROM product WHERE product_group = 3);