An Adaptive Sub-Sampling Method for In-Memory Compression of Scientific Data