Skip to content

Instantly share code, notes, and snippets.

@previtus
Created March 14, 2024 20:38
Show Gist options
  • Save previtus/f30ddd4b36d2e22be12cd9f503549af7 to your computer and use it in GitHub Desktop.
Save previtus/f30ddd4b36d2e22be12cd9f503549af7 to your computer and use it in GitHub Desktop.
snippet about IME calculation (source - https://github.com/nasa/EMIT-Data-Resources )
def calc_ime(plume_da):
molar_volume = 22.4 # L/mol at STP
molar_mass_ch4 = 0.01604 #kg/mol
kg = plume_da * (1/1e6) * (60*60) * (1000) * (1/molar_volume) * molar_mass_ch4
ime = np.nansum(kg)
return ime

4. Calculating the IME for each plume

The integrated mass enhancement (IME), a sum of the mass of methane present in each plume is calculated by summing the mass of methane present in all plume pixels. The IME in kilograms (kg) can be estimated by using the equation below which includes the mixing ratio length per pixel (ppmm), the area of the pixel (m^2), where 22.4 is the volume of 1 mole of gas at standard temperature and pressure (STP) in liters, and 0.01604 is the molar mass of methane in kg/mol.

The IME can be combined with a plume length and windspeed to estimate emissions in units of kg per hour, but in this tutorial, we will not calculate emissions, rather keep things simple and calculate the IME for each plume and observe how these values change over time.

$$\ kg\ \ (per \ \ pixel) = \frac{pixel \ \ value \ \ ppm \cdot m}{1} \frac{1}{1 \cdot 10^6 \ \ ppm} \frac {60 \ \ m \cdot 60 \ \ m} {1} \frac {1000 \ \ L} {m^3} \frac {1 \ \ mol} {22.4 \ \ L} \frac {0.01604 \ \ kg} {1 \ \ mol}$$

We can write this as a function for each pixel, then apply it to the entire timeseries to calculate the IME for each plume.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment