...
The operator has only one parameter. The cacheSize
parameter defines the cache size in MB of this operator instance. If the limit is reached old cached data is removed. If this removed data is required later the data must be recomputed and the request cannot be served by the cache anymore. In order to know how big the cache should be, you can consider three characteristics of the product which is cached.
The number of Bands
The data type of Bands
The image size of Bands
Let's assume the product has 13 bands, all with a size of 4000x4000 pixels. 10 of the band have the data type float32 (4 byte), 2 are short (2 byte) and one is a byte (1 byte, ) band.
numBytesPixel = 10*4 + 2*2 + 1 = 45 byte
numPixels = 4000 * 4000 = 16000000 pixels
oneMegabyte = 1024 * 1024
dataAmount = numBytesPixel * numPixels = 720000000 byte = 720000000 / oneMegabyte = 686 MB
The amount of data is roughly 700 MB. You should add a bit of a margin. For example, in this calculation, we haven’t considered masks and tie-point grids yet. But as a first guess it usable. You can calculate more accurately if you like.
Instead of letting the cache hold the complete data of the product you can try if maybe 4 tiles are sufficient. The tile size is shown in the information window of a product in SNAP Desktop. Assuming, the tile size is 256x256, we calculate a cache size for 4 tiles of 11,25 MB.