0

The following code is a valid section from a script:

import numpy as np
from scipy.linalg import norm
import os.path

filename = os.path.join('filename.hdr')
rows, bands, cols = 500,425,680
mm = np.memmap(filename, dtype=np.float32, mode='r',shape=(rows,bands,cols))

However, it gives me the following error:

ValueError: mmap length is greater than file size

Replacing the mode with 'r+' is not a valid option because it creates a blank file which causes problems later.

0 Answers0