The library for the plume emission estimation is [ddeq](https://gitlab.com/empa503/remote-sensing/ddeq). The output products from the MAPIES framework will be used by the plume estimation module

```mermaid

flowchart TD

A[<b>WEB</b>] --> B{<b>MAPIES</b> framework}

C["Winds <b>ERA5</b>"] ---> D1["Plume application (<em>ddeq</em>)"]

D["Sources \n locations (lat,lon)"] ---> D1["Plume application (<em>ddeq</em>)"]

B ----> D1["Plume application (<em>ddeq</em>)"]

B ---> E[Other Applications \n - <b>Monarch-DA</b>  \n <b>-Providentia</b>]

  

subgraph P[-]

direction TB

P1[Input sources]

P2[Preprocessing]

P3[Emission estimation]

P4[Postprocessing]

P1 --> P2

P2 --> P3

P3 --> P4

end

  

D1 --> P1

  

classDef plumeClass fill:#f9f,stroke:#333,stroke-width:2px;

class P1,P2,P3,P4 plumeClass;

```


# Input source needed

**Sentinel 5P**

NO<sub>2</sub> L2  + Uncertainty (NO<sub>2</sub> and NO<sub>2</sub>_Precision)
- Units atribute
- Noise level atribute
- the central longitude and latitude of the pixels need to be provided as lon and lat.


There is an example in the [tutorial with one NO2 TROPOMI](https://ddeq.readthedocs.io/en/latest/example_tropomi_Matimba.html) file. It has the following attributes:

| Name | Long Name | Type |
|------|-----------|------|
| NO2 | Tropospheric vertical column of nitrogen dioxide | float32 |
| NO2_std | Precision of the tropospheric vertical column of nitrogen dioxide | float64 |
| latc | N/A | float32 |
| lonc | N/A | float32 |
| averaging_kernel | Averaging kernel | float32 |
| air_mass_factor_troposphere | Tropospheric air mass factor | float32 |
| tm5_constant_a | TM5 hybrid A coefficient at upper and lower interface levels | float32 |
| tm5_constant_b | TM5 hybrid B coefficient at upper and lower interface levels | float32 |
| psurf | Surface pressure | float32 |
| clouds | Effective cloud fraction from the cloud product | float32 |
| lat | N/A | float32 |
| lon | N/A | float32 |
| time | N/A | int64 |
| orbit | N/A | int64 |

If you need to explore quickly TROPOMI information you can use this [TROPOMI browser resource](https://mpc-l2.tropomi.eu/maps.html)

**ERA5 (or ERA5Land)**

The ddeq library uses as well information from winds. The locations for this datasets in BSC are:

- ERA 5
  /esarchive/recon/ecmwf/era5
 
- ERA5Land
  /esarchive/recon/ecmwf/era5land


# ERA5 Format of `SMARTCARB_winds_2015042311.nc`

## Variables Information

| Variable Name | Dimensions | Size | Data Type | Units | Long Name |
|---------------|------------|------|-----------|-------|-----------|
| U_GNFR_A      | ('time', 'rlat', 'rlon') | 420000 | float32 | m s-1 | U-component of wind weighted with GNFR-A emission profile |
| V_GNFR_A      | ('time', 'rlat', 'rlon') | 420000 | float32 | m s-1 | V-component of wind weighted with GNFR-A emission profile |
| rlat          | ('rlat',) | 600 | float64 | N/A | N/A |
| rlon          | ('rlon',) | 700 | float64 | N/A | N/A |
| time          | ('time',) | 1 | int64 | days since 2015-04-23T11:00:00 | N/A |
| height_10m    | () | 1 | float32 | m | height above the surface |
| lon           | ('rlat', 'rlon') | 420000 | float32 | degrees_east | longitude |
| lat           | ('rlat', 'rlon') | 420000 | float32 | degrees_north | latitude |



# Format of Matimba_ERA5-wind-20150401t1200.nc

## Variables Information

| Variable Name | Dimensions | Size | Data Type | Units | Long Name |
|---------------|------------|------|-----------|-------|-----------|
| longitude     | ('longitude',) | 3  | float32  | degrees_east | longitude |
| latitude      | ('latitude',)  | 3  | float32  | degrees_north | latitude |
| level         | ('level',)     | 12 | int32    | millibars     | pressure_level |
| time          | ('time',)      | 1  | int32    | hours since 1900-01-01 00:00:00.0 | time |
| z             | ('time', 'level', 'latitude', 'longitude') | 108 | int16 | m**2 s**-2 | Geopotential |
| t             | ('time', 'level', 'latitude', 'longitude') | 108 | int16 | K        | Temperature |
| u             | ('time', 'level', 'latitude', 'longitude') | 108 | int16 | m s**-1  | U component of wind |
| v             | ('time', 'level', 'latitude', 'longitude') | 108 | int16 | m s**-1  | V component of wind |






