Skip to content

Instantly share code, notes, and snippets.

@ghtmtt
Created August 4, 2020 09:43
Show Gist options
  • Save ghtmtt/766e7c62f9b08542f2e484fb42af5802 to your computer and use it in GitHub Desktop.
Save ghtmtt/766e7c62f9b08542f2e484fb42af5802 to your computer and use it in GitHub Desktop.
import ee
from ee_plugin import Map
# Sentinel data
collection = ee.ImageCollection('COPERNICUS/S5P/OFFL/L3_NO2')
# Band of NO2
collection = collection.select('tropospheric_NO2_column_number_density')
# 2019 data
collection2019 = collection.filterDate('2019-03-01', '2019-04-30')
# 2020 data
collection2020 = collection.filterDate('2020-03-01', '2020-04-30')
# Milano county borders
dataset = ee.FeatureCollection('FAO/GAUL/2015/level2');
area = dataset.filter(ee.Filter.inList('ADM2_NAME', ee.List(["Milano"])))
# mean calculation of all layers and area clipping
region_clip_2019 = collection2019.mean().clip(area)
region_clip_2020 = collection2020.mean().clip(area)
# vizualization options
band_viz = {
'min': 0,
'max': 0.0002,
}
# loading XYZ data
Map.addLayer(region_clip_2019, band_viz, 'NO2019')
Map.addLayer(region_clip_2020, band_viz, 'NO2020')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment