I found this document, which suggests your file is not a valid pfm file.
- The PFM header is 3 consecutive "lines" of ASCII text. Your file has 5 lines
- The identifier line contains the characters "PF" or "Pf". PF means it's a color PFM. Pf means it's a grayscale PFM. You don't appear to have this line.
- The dimensions line contains two positive decimal integers, separated by a blank. The first is the width of the image; the second is the height. Both are in pixels. You file places the values on separate lines.
- The Scale Factor / Endianness line indicates if the numbers are stored in little endian or big endian format. Your file doesn't have this line.
However, with that information, it is possible to turn it into a valid pfm file format and use the function Walter pointed to to load it. BTW, your file uses big endian format. So you just need to replace your header
With a valid header. I didn't know the scale factor so I used 1.
Once you've made those changes to your file, you can load and visualize it with the following code. I've attached your file updated to a pfm format. I had to change the extension to txt to be able to attach it here.
img = read_pfm("PF_file.txt", false)