|
|
# open a binary file and read header
|
|
|
```
|
|
|
file = "/home/marie/LPJmL/lpjmlinput_resolution5/MarocN.cowreg.5200p_h43.bin"
|
|
|
file = open(file, "rb")
|
|
|
|
|
|
file = "/home/marie/LPJmL/lpjmlinput_resolution5/MarocN.cowreg.5200p_h43.bin"
|
|
|
file = open(file, "rb")
|
|
|
´´´
|
|
|
#header
|
|
|
#file.read(43)
|
|
|
file_type = file.read(7)
|
... | ... | @@ -25,5 +25,5 @@ cellsize = struct.unpack('f',file.read(4))[0] |
|
|
print("cellsize:",cellsize)
|
|
|
scalar = round(struct.unpack('f',file.read(4))[0],4)
|
|
|
print("scalar:",scalar)
|
|
|
´´´
|
|
|
```
|
|
|
|