import geopandas as gpd
import numpy as np
import rasterio
import rasterio.mask
def crop_gee_output(city, raster_name):
with rasterio.open(city + '/output/' + raster_name + '.tif') as src:
array = src.read(1)
out_meta = src.meta.copy()
out_meta.update({'nodata': 'nan'})
with rasterio.open(city + '/output/' + raster_name + '.tif', 'w', **out_meta) as dest:
dest.write(array, 1)
city = 'Pristina'
city_lower = city.lower()
crop_gee_output(city, city_lower + '_Summer')
crop_gee_output(city, city_lower + '_VIIRS_soc_14_21')
crop_gee_output(city, city_lower + '_VIIRS_sol_14_21')