C2SM-RCM / emiproc

Preprocessing of emissions: from any inventory to any model
BSD 3-Clause "New" or "Revised" License
3 stars 9 forks source link

Adding profiles #15

Closed ghost closed 1 year ago

ghost commented 1 year ago

Adding vertical profiles and temporal profiles for the emissions

ghost commented 1 year ago

I wrote an issue on the previous gitlab :

We want to generate the profiles of the emissions.

Requirements

Profiles are simply scaling factors to apply to the emission map.

Profiles must have dimensions:

Profiles can have additional dimensions for which they vary:

Data adding

This explains conceptually how the data will/can/must be added.

Vertical

Each source in the data can have a vertical value assigned to it. This can be very easy in the gdfs to set a single value to each source.

For gridded emissions we need to assign a profile to the data.

Temporal

Each source must have a profile. we must assume that the sum of the values of the profile equals to one. considering a yearly profile. However we might have daily, weekly, monthly profiles as well. These ones are not covering the full domain alone. This means that their value don't sum to 1, but vary around 1.

Missing data

In the case of missing data it might be impossible to generate some kind of output. In that case we want to make sure that we have a good way to specify the missing data.

Suggested solution

We need to adopt many parts of the code the this profiles and we don't want to change the existing framework too much.

In the inventory class, we want to add the following

Vertical data for the sources (gdfs)

gdfs should contain a 3d points or geometry such that we could extract the vertical data from them.

profiles attribute

This should be a xarray dataset containing all the profiles. A convention should be decided for how to treat exactly these things, but the use of multiple dimensions (with names following the conventions) should make it determinable what kind of scaling should be used for generating data higher than the 2-D maps.

general operations notes

When doing inventory operations, one should be careful how the profiles are implemented.

One should make sure that the results come as expected using testing on basic test inventories.

merging inventories

When putting two inventories together, it is possible to keep the original profiles of the two inventories, or to combine them. Combining profiles should be done using a weighted method scaling based on the emission values of the inventories. If now we merge two inventories with different dimensions it should be possible to either downscale the dimensions of the profiles or to upscale them.

Test case

Roofs for zurich mapluft

For the heating sector we could use some of the height of the buildings to create the vertical profiles.

TNO profiles

TNO has profiles already shipped with it. We can use these to test reading to emiproc format and then exporting.

lionel42 commented 1 year ago

This is now implementing a minimum of features we need. The missing features can be discussed and implemented in issue #22 Otherwise this is now going in the main branch.