How to write a COG in Python #863
Replies: 8 comments 13 replies
-
Hi! While reproducing the error, I got the below output mentioning
Will keep posting the updates here. |
Beta Was this translation helpful? Give feedback.
-
Can we test the script after adding the below line, (this can be line 188) -
So, the script shall look something like -
I can't test it as the script execution is getting killed. |
Beta Was this translation helpful? Give feedback.
-
I could execute the script for generating COG and non-COG output. The
|
Beta Was this translation helpful? Give feedback.
-
Hi @nehahunka ..Please find below the code for writing COG in Python. We found out that using For now, I have kept different options for generating COG as comments in the script -
The final code, notebook and generated COG with masks are stored in my shared bucket at PS: To check file sizes in a directory, I run |
Beta Was this translation helpful? Give feedback.
-
Corresponding ticket-#867 |
Beta Was this translation helpful? Give feedback.
-
To optimize the script, I ran a memory profiler over the code and it outputs the following:
I am curious to know if the final memory usage is ~20 Gb, why the script is not running with a 32 Gb DPS image. |
Beta Was this translation helpful? Give feedback.
-
@wildintellect You're correct. With the suggested changes, the memory requirement falls down to ~14 Gb. Here is the profiler output:
|
Beta Was this translation helpful? Give feedback.
-
[WIP] On my side, I was trying to compile the
and calling it by
However, I am not sure if it is going to make super-enhancements. Moreover, it will reduce the descriptiveness of the code. Maybe, it would make sense to parallelize the array operations into smaller sub-arrays instead of file operations. |
Beta Was this translation helpful? Give feedback.
-
@nehahunka would like help modifiying the writing of GeoTIFF at the bottom of this script to write Cloud-Optimized GeoTIFF (COG)
https://repo.maap-project.org/lduncanson/biomass_harmonization/-/blob/master/country_summaries/IPCC_classes_DPS/IPCC_GEDI_Table4.7.py
The Data team is going to help with this, since it's not really a bug (though might end up in the documentation), we're putting a notice on the board so others can find the answer later.
Beta Was this translation helpful? Give feedback.
All reactions