@sander.niemeijer I am using bin_spatial to regrid the data to approximately 1 km by 1 km. However, the issue I am facing is that I am unable to derive the area.
I want to obtain the final result as a GeoDataFrame with polygon geometry, as I was achieving before using bin_spatial, as shown in the image
operations_trop = ";".join([
"tropospheric_NO2_column_number_density_validity>30",
"latitude>31.0",
"latitude<32.0",
"longitude>74.0",
"longitude<75.0",
"keep(latitude_bounds,longitude_bounds,tropospheric_NO2_column_number_density, latitude, longitude)",
"bin_spatial(100, 31.05, 0.008983, 100, 73.65, 0.008983)",
"derive(latitude {latitude})",
"derive(longitude {longitude})",
"derive(tropospheric_NO2_column_number_density [Pmolec/cm2])",
"derive(area {time} [km2])",
])
tropomi_NO2 = harp.import_product(file_path, operations=operations_trop)
idx = tropomi_NO2.latitude_bounds.data.shape[0]
# loop over pixels
for x in range(idx):
lat_c = tropomi_NO2.latitude_bounds.data[x]
lon_c = tropomi_NO2.longitude_bounds.data[x]
poly = Polygon(zip(lon_c, lat_c))
tropomi.loc[x, 'pixel_id'] = x
tropomi.loc[x, 'geometry'] = poly
tropomi.loc[x, 'NO2'] = tropomi_NO2.tropospheric_NO2_column_number_density.data[x]
tropomi.loc[x, 'lat'] = tropomi_NO2.latitude.data[x]
tropomi.loc[x, 'long'] = tropomi_NO2.longitude.data[x]
tropomi.loc[x, 'pixelarea'] = tropomi_NO2.area.data[x]