METFLIX
8400 fields for each files, 1920 by 1080 points, 0.01' of resolution, 350 days hourly for the SP1 and parties SP2 and SP3 Meteo-France Opendata Arome, XXZ/01,02,03 set continuously, lossy, but factor 1000 saved in size compared to raw and 100 to grib.

Decompression and Data Processing

Each X264 fileis approx 500Mb, a X265 would be 200mb at same quality (but less portable) compared to 70Gb of raw float32, relative error lower that 0.01% 5000X compression ratio or more (based on x265 parameters), with video data quantized to 12-bit luminance.

See original Depot : numpy_compress on github contact filippi_j@univ-corse.fr CNRS/Università di Corsica

Decompress the video and extract metadata:

ffmpeg -i float2t2_video.mp4 -f rawvideo -pix_fmt gray16 uint16_float2t2.raw
ffprobe -v error -select_streams v:0 -show_entries format_tags=comment -of default=noprint_wrappers=1:nokey=1 float2t2_video.mp4

Python Script

Reads the decompressed raw video using mmap, rescales it, and structures it into a NumPy array:

import numpy as np
import mmap
import sys

def process_raw_video(raw_video_path, ni, nj, min_val, max_val):
    with open(raw_video_path, 'rb') as f:
        mm = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
        frame_size = ni * nj * 2  # bytes per frame (uint16)
        nframes = mm.size() // frame_size
        raw_data = np.frombuffer(mm, dtype=np.uint16, count=nframes*nj*ni)
        raw_data = raw_data.reshape((nframes, nj, ni))
        float_data = raw_data.astype(np.float32)
        float_data = (float_data / 65535.0) * (max_val - min_val) + min_val
        mm.close()
        return float_data

if __name__ == "__main__":
    if len(sys.argv) != 6:
        print("Usage: python process_raw_video.py     ")
        sys.exit(1)

    raw_video_path = sys.argv[1]
    ni = int(sys.argv[2])
    nj = int(sys.argv[3])
    min_val = float(sys.argv[4])
    max_val = float(sys.argv[5])

    float_data = process_raw_video(raw_video_path, ni, nj, min_val, max_val)
    print(f"Data shape: {float_data.shape}")
Note: This Python script uses mmap for efficient memory-mapped file access and takes the following arguments:

Run the script as follows:

python process_raw_video.py uint16_float2t2.raw 1920 1080 250.344 304.073