Rasterize point data by summing all Z values within one raster cell Python

309 Views Asked by At

I have large (~3 GB) CSV Data which holds information on timestep, lon, lat, and emissions (Z value). I would like to convert this data to raster data using Python by summing all emission values of points within a certain cell.

The pandas dataframe looks like this:

date                lon     lat         IMO         emission    
2015-01-01 00:05:00 5.13700 61.98248    6926622.0   0.003370
2015-01-01 00:10:00 5.13700 61.98249    6926622.0   0.003497
2015-01-01 00:15:00 5.13699 61.98249    6926622.0   0.001663
..

The raster is a 12kmx12km with 196 rows/cols defined LCC:

-1275000.000 -1000000.000 12000.000 12000.000 196 196 1

How can I do this? I checked make_geoube geocube package, however it should be as fast as possible, because data is large and there are more files to be processed. Also i am not quite sure if it excatly does what I want.

But if so, how would I get the LCC raster to be used by geocube?

In R the rasterize function seems to do what I want.

Thanks!

0

There are 0 best solutions below