Created
December 27, 2020 11:14
-
-
Save DSCF-1224/90a5e8621ddea6cc565824cbb231e85e to your computer and use it in GitHub Desktop.
python で fortran の unformatted で出力した INT32 と REAL64 型のデータを読み出す
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import numpy | |
def read_int32(file_stream): | |
return numpy.fromfile(file= file_stream, dtype= numpy.int32, count=1)[0] | |
def read_real64(file_stream): | |
return numpy.fromfile(file= file_stream, dtype= numpy.float64, count=1)[0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment